1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #ifdef WITH_DOCSTRINGS
24 %include MEDCoupling_doc.i
31 #include "MEDCouplingMemArray.hxx"
32 #include "MEDCouplingUMesh.hxx"
33 #include "MEDCouplingMappedExtrudedMesh.hxx"
34 #include "MEDCouplingCMesh.hxx"
35 #include "MEDCouplingIMesh.hxx"
36 #include "MEDCouplingCurveLinearMesh.hxx"
37 #include "MEDCoupling1GTUMesh.hxx"
38 #include "MEDCouplingField.hxx"
39 #include "MEDCouplingFieldDouble.hxx"
40 #include "MEDCouplingFieldInt.hxx"
41 #include "MEDCouplingFieldFloat.hxx"
42 #include "MEDCouplingFieldTemplate.hxx"
43 #include "MEDCouplingGaussLocalization.hxx"
45 #include "MEDCouplingMultiFields.hxx"
46 #include "MEDCouplingFieldOverTime.hxx"
47 #include "MEDCouplingDefinitionTime.hxx"
48 #include "MEDCouplingFieldDiscretization.hxx"
49 #include "MEDCouplingCartesianAMRMesh.hxx"
50 #include "MEDCouplingAMRAttribute.hxx"
51 #include "MEDCouplingMatrix.hxx"
52 #include "MEDCouplingPartDefinition.hxx"
53 #include "MEDCouplingSkyLineArray.hxx"
54 #include "MEDCouplingTypemaps.i"
56 #include "InterpKernelAutoPtr.hxx"
57 #include "BoxSplittingOptions.hxx"
59 using namespace MEDCoupling;
60 using namespace INTERP_KERNEL;
64 %template(ivec) std::vector<int>;
65 %template(dvec) std::vector<double>;
66 %template(svec) std::vector<std::string>;
69 %typemap(out) MEDCoupling::MEDCouplingMesh*
71 $result=convertMesh($1,$owner);
74 %typemap(out) MEDCouplingMesh*
76 $result=convertMesh($1,$owner);
81 %typemap(out) MEDCoupling::MEDCouplingPointSet*
83 $result=convertMesh($1,$owner);
86 %typemap(out) MEDCouplingPointSet*
88 $result=convertMesh($1,$owner);
93 %typemap(out) MEDCouplingCartesianAMRPatchGen*
95 $result=convertCartesianAMRPatch($1,$owner);
100 %typemap(out) MEDCouplingCartesianAMRMeshGen*
102 $result=convertCartesianAMRMesh($1,$owner);
107 %typemap(out) MEDCouplingDataForGodFather*
109 $result=convertDataForGodFather($1,$owner);
114 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
116 $result=convertMesh($1,$owner);
119 %typemap(out) MEDCoupling1GTUMesh*
121 $result=convertMesh($1,$owner);
126 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
128 $result=convertMesh($1,$owner);
131 %typemap(out) MEDCouplingStructuredMesh*
133 $result=convertMesh($1,$owner);
138 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
140 $result=convertFieldDiscretization($1,$owner);
143 %typemap(out) MEDCouplingFieldDiscretization*
145 $result=convertFieldDiscretization($1,$owner);
150 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
152 $result=convertMultiFields($1,$owner);
155 %typemap(out) MEDCouplingMultiFields*
157 $result=convertMultiFields($1,$owner);
162 %typemap(out) MEDCoupling::PartDefinition*
164 $result=convertPartDefinition($1,$owner);
167 %typemap(out) PartDefinition*
169 $result=convertPartDefinition($1,$owner);
174 %init %{ import_array(); %}
177 %init %{ initializeMe(); %}
179 %feature("autodoc", "1");
180 %feature("docstring");
182 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
183 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
184 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
185 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
186 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
187 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
188 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
189 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
190 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
191 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
192 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
193 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
194 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
195 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
196 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
197 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
198 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
199 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
200 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
201 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
202 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
203 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
204 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
205 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
206 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
207 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
208 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
209 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
210 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
211 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
212 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
213 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
214 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
215 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
216 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
217 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
218 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
235 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
236 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
237 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
238 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
239 %newobject MEDCoupling::MEDCouplingFieldInt::New;
240 %newobject MEDCoupling::MEDCouplingFieldInt::convertToDblField;
241 %newobject MEDCoupling::MEDCouplingFieldInt::getArray;
242 %newobject MEDCoupling::MEDCouplingFieldInt::deepCopy;
243 %newobject MEDCoupling::MEDCouplingFieldInt::clone;
244 %newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh;
245 %newobject MEDCoupling::MEDCouplingFieldInt::buildSubPart;
246 %newobject MEDCoupling::MEDCouplingFieldInt::buildSubPartRange;
247 %newobject MEDCoupling::MEDCouplingFieldInt::__getitem__;
248 %newobject MEDCoupling::MEDCouplingFieldFloat::New;
249 %newobject MEDCoupling::MEDCouplingFieldFloat::convertToDblField;
250 %newobject MEDCoupling::MEDCouplingFieldFloat::getArray;
251 %newobject MEDCoupling::MEDCouplingFieldFloat::deepCopy;
252 %newobject MEDCoupling::MEDCouplingFieldFloat::clone;
253 %newobject MEDCoupling::MEDCouplingFieldFloat::cloneWithMesh;
254 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPart;
255 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPartRange;
256 %newobject MEDCoupling::MEDCouplingFieldFloat::__getitem__;
257 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
258 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
259 %newobject MEDCoupling::MEDCouplingMesh::clone;
260 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
261 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
262 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
263 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
264 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
265 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
266 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
267 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
268 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
269 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
270 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
271 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
272 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
273 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
274 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
275 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
276 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
277 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
278 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
279 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
280 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
281 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
282 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
283 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
284 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
285 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
286 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
287 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
288 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
289 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
290 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
291 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
292 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
293 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
294 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
295 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
296 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
297 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
298 %newobject MEDCoupling::MEDCouplingUMesh::New;
299 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
300 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
301 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
302 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
303 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
304 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
305 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
306 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
307 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
308 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
309 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
310 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
311 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
312 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
313 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
314 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
315 %newobject MEDCoupling::MEDCouplingUMesh::conformize3D;
316 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
317 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
318 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
319 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
320 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
321 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
322 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
323 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
324 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
325 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
326 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
327 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
328 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
329 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
330 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
331 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
332 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
333 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
334 %newobject MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords;
335 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
336 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
337 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
338 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
339 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
340 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
341 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
342 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
343 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
344 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
345 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
346 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
347 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
348 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
349 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
350 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
351 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
352 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
353 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
354 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
355 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
356 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
357 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
358 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
359 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
360 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
361 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
362 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
363 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
364 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
365 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
366 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
367 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
368 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
369 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
370 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
371 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
372 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
373 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
374 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
375 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
376 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
377 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
378 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
379 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
380 %newobject MEDCoupling::MEDCouplingCMesh::New;
381 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
382 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
383 %newobject MEDCoupling::MEDCouplingIMesh::New;
384 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
385 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
386 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
387 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
388 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
389 %newobject MEDCoupling::MEDCouplingMultiFields::New;
390 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
391 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
392 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
393 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
394 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
395 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
396 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
397 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
398 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
399 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
400 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
401 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
402 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
403 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
404 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
405 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
406 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
407 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
408 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
409 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
410 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
411 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
412 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
413 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
414 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
415 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
416 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
417 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
418 %newobject MEDCoupling::DenseMatrix::New;
419 %newobject MEDCoupling::DenseMatrix::deepCopy;
420 %newobject MEDCoupling::DenseMatrix::shallowCpy;
421 %newobject MEDCoupling::DenseMatrix::getData;
422 %newobject MEDCoupling::DenseMatrix::matVecMult;
423 %newobject MEDCoupling::DenseMatrix::MatVecMult;
424 %newobject MEDCoupling::DenseMatrix::__add__;
425 %newobject MEDCoupling::DenseMatrix::__sub__;
426 %newobject MEDCoupling::DenseMatrix::__mul__;
427 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
428 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
429 %newobject MEDCoupling::MEDCouplingSkyLineArray::BuildFromPolyhedronConn;
431 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
432 %feature("unref") MEDCouplingMesh "$this->decrRef();"
433 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
434 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
435 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
436 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
437 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
438 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
439 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
440 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
441 %feature("unref") MEDCouplingField "$this->decrRef();"
442 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
443 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
444 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
445 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
446 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
447 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
448 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
449 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
450 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
451 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
452 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
453 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
454 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
455 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
456 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
457 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
458 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
459 %feature("unref") DenseMatrix "$this->decrRef();"
460 %feature("unref") MEDCouplingSkyLineArray "$this->decrRef();"
462 %rename(assign) *::operator=;
463 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
464 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
465 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
466 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
470 %rename (InterpKernelException) INTERP_KERNEL::Exception;
472 %include "MEDCouplingRefCountObject.i"
473 %include "MEDCouplingMemArray.i"
477 {// AGY : here initialization of C++ traits in MEDCouplingDataArrayTypemaps.i for code factorization. Awful, I know, but no other solutions.
478 SWIGTITraits<double>::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble;
479 SWIGTITraits<float>::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat;
480 SWIGTITraits<int>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt;
481 SWIGTITraits<double>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple;
482 SWIGTITraits<float>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayFloatTuple;
483 SWIGTITraits<int>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayIntTuple;
487 namespace INTERP_KERNEL
490 * \class BoxSplittingOptions
491 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
493 class BoxSplittingOptions
496 BoxSplittingOptions();
497 void init() throw(INTERP_KERNEL::Exception);
498 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
499 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
500 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
501 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
502 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
503 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
504 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
505 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
506 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
507 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
508 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
509 std::string printOptions() const throw(INTERP_KERNEL::Exception);
512 std::string __str__() const throw(INTERP_KERNEL::Exception)
514 return self->printOptions();
520 namespace MEDCoupling
536 CONST_ON_TIME_INTERVAL = 7
537 } TypeOfTimeDiscretization;
545 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
546 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
548 } MEDCouplingMeshType;
551 class DataArrayDouble;
552 class MEDCouplingUMesh;
553 class MEDCouplingCMesh;
554 class MEDCouplingFieldDouble;
556 %extend RefCountObject
558 std::string getHiddenCppPointer() const
560 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
565 %extend MEDCouplingGaussLocalization
567 std::string __str__() const throw(INTERP_KERNEL::Exception)
569 return self->getStringRepr();
572 std::string __repr__() const throw(INTERP_KERNEL::Exception)
574 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
575 oss << self->getStringRepr();
582 class MEDCouplingMesh : public RefCountObject, public TimeLabel
585 void setName(const std::string& name);
586 std::string getName() const;
587 void setDescription(const std::string& descr);
588 std::string getDescription() const;
589 void setTime(double val, int iteration, int order);
590 void setTimeUnit(const std::string& unit);
591 std::string getTimeUnit() const;
592 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
593 bool isStructured() const throw(INTERP_KERNEL::Exception);
594 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
595 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
596 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
597 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
598 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
599 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
600 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
601 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
602 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
603 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
604 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
605 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
606 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
607 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
608 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
609 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
610 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
611 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
612 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
613 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
614 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
615 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
616 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
617 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
618 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
619 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
620 virtual std::string getVTKFileExtension() const;
621 std::string getVTKFileNameOf(const std::string& fileName) const;
623 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
624 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
625 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
626 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
627 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
628 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
629 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
630 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
631 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
632 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
633 virtual void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings) throw(INTERP_KERNEL::Exception);
634 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
635 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
636 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
637 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
638 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
639 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
640 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
643 std::string __str__() const throw(INTERP_KERNEL::Exception)
645 return self->simpleRepr();
648 PyObject *getTime() throw(INTERP_KERNEL::Exception)
651 double tmp0=self->getTime(tmp1,tmp2);
652 PyObject *res = PyList_New(3);
653 PyList_SetItem(res,0,SWIG_From_double(tmp0));
654 PyList_SetItem(res,1,SWIG_From_int(tmp1));
655 PyList_SetItem(res,2,SWIG_From_int(tmp2));
659 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
661 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
662 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
668 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
672 DataArrayDoubleTuple *aa;
673 std::vector<double> bb;
675 int spaceDim=self->getSpaceDimension();
676 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
677 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
678 return self->getCellContainingPoint(pos,eps);
681 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
685 DataArrayDoubleTuple *aa;
686 std::vector<double> bb;
688 int spaceDim=self->getSpaceDimension();
689 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
690 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
691 MCAuto<DataArrayInt> elts,eltsIndex;
692 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
693 PyObject *ret=PyTuple_New(2);
694 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
695 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
699 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
701 MCAuto<DataArrayInt> elts,eltsIndex;
702 int spaceDim=self->getSpaceDimension();
704 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
705 if (!SWIG_IsOK(res1))
708 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
709 int nbOfPoints=size/spaceDim;
712 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
714 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
718 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
720 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
721 da2->checkAllocated();
722 int size=da2->getNumberOfTuples();
723 int nbOfCompo=da2->getNumberOfComponents();
724 if(nbOfCompo!=spaceDim)
726 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
728 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
730 PyObject *ret=PyTuple_New(2);
731 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
732 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
736 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
740 DataArrayDoubleTuple *aa;
741 std::vector<double> bb;
743 int spaceDim=self->getSpaceDimension();
744 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
745 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
746 std::vector<int> elts;
747 self->getCellsContainingPoint(pos,eps,elts);
748 DataArrayInt *ret=DataArrayInt::New();
749 ret->alloc((int)elts.size(),1);
750 std::copy(elts.begin(),elts.end(),ret->getPointer());
751 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
754 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
756 MCAuto<DataArrayInt> d0=DataArrayInt::New();
757 MCAuto<DataArrayInt> d1=DataArrayInt::New();
758 self->getReverseNodalConnectivity(d0,d1);
759 PyObject *ret=PyTuple_New(2);
760 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
761 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
765 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
768 int v0; std::vector<int> v1;
769 const int *ids(convertIntStarLikePyObjToCppIntStar(li,sw,sz,v0,v1));
770 self->renumberCells(ids,check);
773 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
775 DataArrayInt *cellCor, *nodeCor;
776 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
777 PyObject *res = PyList_New(2);
778 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
779 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
783 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
785 DataArrayInt *cellCor=0,*nodeCor=0;
786 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
787 PyObject *res = PyList_New(2);
788 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
789 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
793 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
795 DataArrayInt *cellCor=0;
796 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
800 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
803 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
804 if (!SWIG_IsOK(res1))
807 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
808 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
812 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
814 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
815 da2->checkAllocated();
816 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
819 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
821 std::vector<int> conn;
822 self->getNodeIdsOfCell(cellId,conn);
823 return convertIntArrToPyList2(conn);
826 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
828 std::vector<double> coo;
829 self->getCoordinatesOfNode(nodeId,coo);
830 return convertDblArrToPyList2(coo);
833 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
837 DataArrayDoubleTuple *aa;
838 std::vector<double> bb;
840 int spaceDim=self->getSpaceDimension();
841 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
842 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
843 self->scale(pointPtr,factor);
846 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
848 int spaceDim=self->getSpaceDimension();
849 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
850 self->getBoundingBox(tmp);
851 PyObject *ret=convertDblArrToPyListOfTuple<double>(tmp,2,spaceDim);
855 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
858 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
859 PyObject *ret=PyTuple_New(2);
860 PyObject *ret0Py=ret0?Py_True:Py_False;
862 PyTuple_SetItem(ret,0,ret0Py);
863 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
867 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
869 int szArr,sw,iTypppArr;
870 std::vector<int> stdvecTyyppArr;
871 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
872 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
873 if(sw==3)//DataArrayInt
875 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
876 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
877 std::string name=argpt->getName();
879 ret->setName(name.c_str());
881 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
884 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
886 int szArr,sw,iTypppArr;
887 std::vector<int> stdvecTyyppArr;
889 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
890 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
891 if(sw==3)//DataArrayInt
893 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
894 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
895 std::string name=argpt->getName();
897 ret->setName(name.c_str());
900 PyObject *res = PyList_New(2);
901 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
902 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
903 PyList_SetItem(res,0,obj0);
904 PyList_SetItem(res,1,obj1);
908 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
912 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
913 PyObject *res = PyTuple_New(2);
914 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
917 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
919 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
920 PyTuple_SetItem(res,0,obj0);
921 PyTuple_SetItem(res,1,obj1);
925 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
927 std::vector<int> vals=self->getDistributionOfTypes();
929 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
930 PyObject *ret=PyList_New((int)vals.size()/3);
931 for(int j=0;j<(int)vals.size()/3;j++)
933 PyObject *ret1=PyList_New(3);
934 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
935 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
936 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
937 PyList_SetItem(ret,j,ret1);
942 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
944 std::vector<int> code;
945 std::vector<const DataArrayInt *> idsPerType;
946 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
947 convertPyToNewIntArr4(li,1,3,code);
948 return self->checkTypeConsistencyAndContig(code,idsPerType);
951 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
953 std::vector<int> code;
954 std::vector<DataArrayInt *> idsInPflPerType;
955 std::vector<DataArrayInt *> idsPerType;
956 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
957 PyObject *ret=PyTuple_New(3);
960 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
961 PyObject *ret0=PyList_New((int)code.size()/3);
962 for(int j=0;j<(int)code.size()/3;j++)
964 PyObject *ret00=PyList_New(3);
965 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
966 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
967 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
968 PyList_SetItem(ret0,j,ret00);
970 PyTuple_SetItem(ret,0,ret0);
972 PyObject *ret1=PyList_New(idsInPflPerType.size());
973 for(std::size_t j=0;j<idsInPflPerType.size();j++)
974 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
975 PyTuple_SetItem(ret,1,ret1);
976 int n=idsPerType.size();
977 PyObject *ret2=PyList_New(n);
979 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
980 PyTuple_SetItem(ret,2,ret2);
984 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
988 DataArrayDoubleTuple *aa;
989 std::vector<double> bb;
991 int spaceDim=self->getSpaceDimension();
992 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
993 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
994 self->translate(vectorPtr);
997 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
999 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1002 DataArrayDoubleTuple *aa;
1003 std::vector<double> bb;
1005 int spaceDim=self->getSpaceDimension();
1006 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1007 self->rotate(centerPtr,0,alpha);
1010 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
1012 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1014 DataArrayDouble *a,*a2;
1015 DataArrayDoubleTuple *aa,*aa2;
1016 std::vector<double> bb,bb2;
1018 int spaceDim=self->getSpaceDimension();
1019 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1020 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,spaceDim,false);//vectorPtr can be null in case of space dim 2
1021 self->rotate(centerPtr,vectorPtr,alpha);
1024 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1026 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1027 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1028 PyObject *res=PyList_New(result.size());
1029 for(int i=0;iL!=result.end(); i++, iL++)
1030 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1034 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
1036 std::vector<double> a0;
1037 std::vector<int> a1;
1038 std::vector<std::string> a2;
1039 self->getTinySerializationInformation(a0,a1,a2);
1040 PyObject *ret(PyTuple_New(3));
1041 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1042 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1044 PyObject *ret2(PyList_New(sz));
1046 for(int i=0;i<sz;i++)
1047 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1049 PyTuple_SetItem(ret,2,ret2);
1053 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1055 DataArrayInt *a0Tmp(0);
1056 DataArrayDouble *a1Tmp(0);
1057 self->serialize(a0Tmp,a1Tmp);
1058 PyObject *ret(PyTuple_New(2));
1059 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1060 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1064 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1066 std::vector<std::string> littleStrings;
1067 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1070 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1071 {// put an empty dict in input to say to __new__ to call __init__...
1072 PyObject *ret(PyTuple_New(1));
1073 PyObject *ret0(PyDict_New());
1074 PyTuple_SetItem(ret,0,ret0);
1078 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1080 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1081 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1082 PyObject *ret(PyTuple_New(2));
1083 PyTuple_SetItem(ret,0,ret0);
1084 PyTuple_SetItem(ret,1,ret1);
1088 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1090 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1091 if(!PyTuple_Check(inp))
1092 throw INTERP_KERNEL::Exception(MSG);
1093 int sz(PyTuple_Size(inp));
1095 throw INTERP_KERNEL::Exception(MSG);
1096 PyObject *elt0(PyTuple_GetItem(inp,0));
1097 PyObject *elt1(PyTuple_GetItem(inp,1));
1098 std::vector<double> a0;
1099 std::vector<int> a1;
1100 std::vector<std::string> a2;
1101 DataArrayInt *b0(0);
1102 DataArrayDouble *b1(0);
1104 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1105 throw INTERP_KERNEL::Exception(MSG);
1106 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1108 fillArrayWithPyListDbl3(a0py,tmp,a0);
1109 convertPyToNewIntArr3(a1py,a1);
1110 fillStringVector(a2py,a2);
1113 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1114 throw INTERP_KERNEL::Exception(MSG);
1115 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1117 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1118 if(!SWIG_IsOK(status))
1119 throw INTERP_KERNEL::Exception(MSG);
1120 b0=reinterpret_cast<DataArrayInt *>(argp);
1121 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1122 if(!SWIG_IsOK(status))
1123 throw INTERP_KERNEL::Exception(MSG);
1124 b1=reinterpret_cast<DataArrayDouble *>(argp);
1126 // useless here to call resizeForUnserialization because arrays are well resized.
1127 self->unserialization(a0,a1,b0,b1,a2);
1130 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1132 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1133 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1134 return MEDCouplingMesh::MergeMeshes(tmp);
1140 //== MEDCouplingMesh End
1142 %include "NormalizedGeometricTypes"
1143 %include "MEDCouplingNatureOfFieldEnum"
1145 namespace MEDCoupling
1147 class MEDCouplingNatureOfField
1150 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1151 static std::string GetReprNoThrow(NatureOfField nat);
1152 static std::string GetAllPossibilitiesStr();
1156 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1157 // include "MEDCouplingTimeDiscretization.i"
1159 namespace MEDCoupling
1161 class MEDCouplingGaussLocalization
1164 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1165 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1166 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1167 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1168 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1169 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1170 int getDimension() const throw(INTERP_KERNEL::Exception);
1171 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1172 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1173 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1174 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1176 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1177 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1178 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1179 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1180 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1181 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1182 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1183 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1184 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1185 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1186 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1187 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1189 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1193 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const throw(INTERP_KERNEL::Exception)
1195 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1199 MEDCouplingUMesh *buildRefCell() const throw(INTERP_KERNEL::Exception)
1201 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1207 class MEDCouplingSkyLineArray
1210 static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayInt* c, const DataArrayInt* cI ) throw(INTERP_KERNEL::Exception);
1212 void set( DataArrayInt* index, DataArrayInt* value );
1213 void set3( DataArrayInt* superIndex, DataArrayInt* index, DataArrayInt* value );
1215 int getSuperNumberOf() const;
1216 int getNumberOf() const;
1217 int getLength() const;
1219 DataArrayInt* getSuperIndexArray() const;
1220 DataArrayInt* getIndexArray() const;
1221 DataArrayInt* getValuesArray() const;
1223 void deletePack(const int i, const int j) throw(INTERP_KERNEL::Exception);
1227 MEDCouplingSkyLineArray() throw(INTERP_KERNEL::Exception)
1229 return MEDCouplingSkyLineArray::New();
1232 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value) throw(INTERP_KERNEL::Exception)
1234 return MEDCouplingSkyLineArray::New(index, value);
1237 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value ) throw(INTERP_KERNEL::Exception)
1239 return MEDCouplingSkyLineArray::New(index, value);
1242 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other ) throw(INTERP_KERNEL::Exception)
1244 return MEDCouplingSkyLineArray::New(other);
1247 std::string __str__() const throw(INTERP_KERNEL::Exception)
1249 return self->simpleRepr();
1252 PyObject *getSimplePackSafe(int absolutePackId) const throw(INTERP_KERNEL::Exception)
1254 std::vector<int> ret;
1255 self->getSimplePackSafe(absolutePackId,ret);
1256 return convertIntArrToPyList2(ret);
1259 PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const throw(INTERP_KERNEL::Exception)
1261 std::vector<int> vpack, vspIdx, out;
1263 convertPyToNewIntArr3(superPackIndices,vspIdx);
1264 convertPyToNewIntArr3(pack,vpack);
1266 self->findPackIds(vspIdx, vpack.data(), vpack.data()+vpack.size(), out);
1267 return convertIntArrToPyList2(out);
1270 void pushBackPack(const int i, PyObject *pack) throw(INTERP_KERNEL::Exception)
1272 std::vector<int> vpack;
1273 convertPyToNewIntArr3(pack,vpack);
1274 self->pushBackPack(i,vpack.data(), vpack.data()+vpack.size());
1277 void replaceSimplePack(const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1279 std::vector<int> vpack;
1280 convertPyToNewIntArr3(pack,vpack);
1281 self->replaceSimplePack(idx, vpack.data(), vpack.data()+vpack.size());
1284 void replacePack(const int superIdx, const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1286 std::vector<int> vpack;
1287 convertPyToNewIntArr3(pack,vpack);
1288 self->replacePack(superIdx, idx, vpack.data(), vpack.data()+vpack.size());
1291 PyObject *convertToPolyhedronConn() const throw(INTERP_KERNEL::Exception)
1293 MCAuto<DataArrayInt> d0=DataArrayInt::New();
1294 MCAuto<DataArrayInt> d1=DataArrayInt::New();
1295 self->convertToPolyhedronConn(d0,d1);
1296 PyObject *ret=PyTuple_New(2);
1297 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1298 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1305 %include "MEDCouplingFieldDiscretization.i"
1307 //== MEDCouplingPointSet
1309 namespace MEDCoupling
1311 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1314 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1315 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1316 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1317 void zipCoords() throw(INTERP_KERNEL::Exception);
1318 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1319 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1320 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1321 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1322 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1323 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1324 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1325 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1326 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1327 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1328 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1329 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1330 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1331 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1332 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1333 virtual DataArrayInt *findBoundaryNodes() const;
1334 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1335 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1336 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1337 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1338 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1339 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1340 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1341 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1342 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1345 std::string __str__() const throw(INTERP_KERNEL::Exception)
1347 return self->simpleRepr();
1350 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1353 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1354 PyObject *res = PyList_New(2);
1355 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1356 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1360 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1362 DataArrayInt *comm, *commIndex;
1363 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1364 PyObject *res = PyList_New(2);
1365 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1366 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1370 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1372 DataArrayDouble *ret1=self->getCoords();
1375 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1378 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1380 int szArr,sw,iTypppArr;
1381 std::vector<int> stdvecTyyppArr;
1382 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1383 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1384 if(sw==3)//DataArrayInt
1386 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1387 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1388 std::string name=argpt->getName();
1390 ret->setName(name.c_str());
1392 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1395 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1397 int szArr,sw,iTypppArr;
1398 std::vector<int> stdvecTyyppArr;
1399 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1400 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1401 if(sw==3)//DataArrayInt
1403 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1404 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1405 std::string name=argpt->getName();
1407 ret->setName(name.c_str());
1409 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1412 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1414 int szArr,sw,iTypppArr;
1415 std::vector<int> stdvecTyyppArr;
1416 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1417 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1418 if(sw==3)//DataArrayInt
1420 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1421 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1422 std::string name=argpt->getName();
1424 ret->setName(name.c_str());
1426 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1429 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1431 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1432 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1435 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1437 int szArr,sw,iTypppArr;
1438 std::vector<int> stdvecTyyppArr;
1439 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1440 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1441 if(sw==3)//DataArrayInt
1443 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1444 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1445 std::string name=argpt->getName();
1447 ret->setName(name.c_str());
1449 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1452 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1454 int szArr,sw,iTypppArr;
1455 std::vector<int> stdvecTyyppArr;
1456 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1457 self->renumberNodes(tmp,newNbOfNodes);
1460 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1462 int szArr,sw,iTypppArr;
1463 std::vector<int> stdvecTyyppArr;
1464 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1465 self->renumberNodesCenter(tmp,newNbOfNodes);
1468 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1470 int spaceDim=self->getSpaceDimension();
1472 DataArrayDouble *a,*a2;
1473 DataArrayDoubleTuple *aa,*aa2;
1474 std::vector<double> bb,bb2;
1476 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1477 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1478 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1479 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1480 std::vector<int> nodes;
1481 self->findNodesOnLine(p,v,eps,nodes);
1482 DataArrayInt *ret=DataArrayInt::New();
1483 ret->alloc((int)nodes.size(),1);
1484 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1485 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1487 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1489 int spaceDim=self->getSpaceDimension();
1491 DataArrayDouble *a,*a2;
1492 DataArrayDoubleTuple *aa,*aa2;
1493 std::vector<double> bb,bb2;
1495 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1496 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1497 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1498 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1499 std::vector<int> nodes;
1500 self->findNodesOnPlane(p,v,eps,nodes);
1501 DataArrayInt *ret=DataArrayInt::New();
1502 ret->alloc((int)nodes.size(),1);
1503 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1504 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1507 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1511 DataArrayDoubleTuple *aa;
1512 std::vector<double> bb;
1514 int spaceDim=self->getSpaceDimension();
1515 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1516 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1517 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1518 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1521 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1523 DataArrayInt *c=0,*cI=0;
1527 DataArrayDoubleTuple *aa;
1528 std::vector<double> bb;
1530 int spaceDim=self->getSpaceDimension();
1531 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1532 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1533 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1534 PyObject *ret=PyTuple_New(2);
1535 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1536 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1540 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1542 DataArrayInt *c=0,*cI=0;
1543 int spaceDim=self->getSpaceDimension();
1546 DataArrayDoubleTuple *aa;
1547 std::vector<double> bb;
1550 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1551 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1553 PyObject *ret=PyTuple_New(2);
1554 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1555 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1559 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1563 DataArrayDoubleTuple *aa;
1564 std::vector<double> bb;
1566 int spaceDim=self->getSpaceDimension();
1567 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1568 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1570 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1571 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1574 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1578 std::vector<int> multiVal;
1579 std::pair<int, std::pair<int,int> > slic;
1580 MEDCoupling::DataArrayInt *daIntTyypp=0;
1581 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1585 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1587 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1589 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1591 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1595 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1597 DataArrayInt *v0=0,*v1=0;
1598 self->findCommonCells(compType,startCellId,v0,v1);
1599 PyObject *res = PyList_New(2);
1600 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1601 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1606 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1609 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1610 if (!SWIG_IsOK(res1))
1613 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1614 self->renumberNodesInConn(tmp);
1618 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1620 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1621 da2->checkAllocated();
1622 self->renumberNodesInConn(da2->getConstPointer());
1626 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1629 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1630 PyObject *ret=PyTuple_New(2);
1631 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1632 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1636 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1638 DataArrayInt *ret=0;
1640 int szArr,sw,iTypppArr;
1641 std::vector<int> stdvecTyyppArr;
1642 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1643 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1647 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1651 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1652 PyObject *res = PyList_New(3);
1653 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1654 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1655 PyList_SetItem(res,2,SWIG_From_int(ret2));
1659 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1663 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1664 PyObject *res = PyList_New(3);
1665 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1666 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1667 PyList_SetItem(res,2,SWIG_From_int(ret2));
1671 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1674 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1675 if (!SWIG_IsOK(res1))
1678 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1679 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1683 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1685 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1686 da2->checkAllocated();
1687 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1691 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1695 std::vector<int> multiVal;
1696 std::pair<int, std::pair<int,int> > slic;
1697 MEDCoupling::DataArrayInt *daIntTyypp=0;
1698 int nbc=self->getNumberOfCells();
1699 convertIntStarOrSliceLikePyObjToCpp(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1706 std::ostringstream oss;
1707 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1708 throw INTERP_KERNEL::Exception(oss.str().c_str());
1711 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1716 int tmp=nbc+singleVal;
1717 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1721 std::ostringstream oss;
1722 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1723 throw INTERP_KERNEL::Exception(oss.str().c_str());
1729 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1733 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1738 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1739 daIntTyypp->checkAllocated();
1740 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1743 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1747 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1750 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1751 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1752 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1753 for(int i=0;i<sz;i++)
1754 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1757 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1760 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1762 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1763 std::vector<double> val3;
1764 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1765 "Rotate2DAlg",2,true,nbNodes);
1767 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1768 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1771 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1774 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1775 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1776 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1777 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1778 for(int i=0;i<sz;i++)
1779 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1782 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1785 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1787 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1788 std::vector<double> val3;
1789 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1790 "Rotate3DAlg",3,true,nbNodes);
1792 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1793 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1794 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1799 //== MEDCouplingPointSet End
1801 class MEDCouplingUMeshCell
1804 INTERP_KERNEL::NormalizedCellType getType() const;
1807 std::string __str__() const throw(INTERP_KERNEL::Exception)
1809 return self->repr();
1812 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1815 const int *r=self->getAllConn(ret2);
1816 PyObject *ret=PyTuple_New(ret2);
1817 for(int i=0;i<ret2;i++)
1818 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1824 class MEDCouplingUMeshCellIterator
1831 MEDCouplingUMeshCell *ret=self->nextt();
1833 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1836 PyErr_SetString(PyExc_StopIteration,"No more data.");
1843 class MEDCouplingUMeshCellByTypeIterator
1846 ~MEDCouplingUMeshCellByTypeIterator();
1851 MEDCouplingUMeshCellEntry *ret=self->nextt();
1853 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1856 PyErr_SetString(PyExc_StopIteration,"No more data.");
1863 class MEDCouplingUMeshCellByTypeEntry
1866 ~MEDCouplingUMeshCellByTypeEntry();
1869 MEDCouplingUMeshCellByTypeIterator *__iter__()
1871 return self->iterator();
1876 class MEDCouplingUMeshCellEntry
1879 INTERP_KERNEL::NormalizedCellType getType() const;
1880 int getNumberOfElems() const;
1883 MEDCouplingUMeshCellIterator *__iter__()
1885 return self->iterator();
1890 //== MEDCouplingUMesh
1892 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1895 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1896 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1897 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1898 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1899 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1900 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1901 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1902 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1903 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1904 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1905 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1906 void computeTypes() throw(INTERP_KERNEL::Exception);
1907 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1908 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1910 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1911 DataArrayInt *conformize3D(double eps) throw(INTERP_KERNEL::Exception);
1912 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1913 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1914 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1915 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1916 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1917 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1918 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1919 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1920 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1921 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1922 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1923 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1924 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1925 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1926 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1927 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1928 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1929 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1930 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1931 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1932 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1933 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1934 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1935 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1936 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1937 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1938 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1939 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1940 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1941 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1942 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1943 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1944 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1945 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1946 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1947 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1948 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1949 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1950 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1951 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1952 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1953 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1954 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1955 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1956 int split2DCells(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *subNodesInSeg, const DataArrayInt *subNodesInSegI, const DataArrayInt *midOpt=0, const DataArrayInt *midOptI=0) throw(INTERP_KERNEL::Exception);
1957 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1958 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1959 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1960 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1961 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1963 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1965 return MEDCouplingUMesh::New();
1968 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1970 return MEDCouplingUMesh::New(meshName,meshDim);
1974 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1976 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1979 std::string __str__() const throw(INTERP_KERNEL::Exception)
1981 return self->simpleRepr();
1984 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1986 std::ostringstream oss;
1987 self->reprQuickOverview(oss);
1991 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1993 return self->cellIterator();
1996 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
1998 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
2002 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
2004 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
2005 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2006 PyObject *res=PyList_New(result.size());
2007 for(int i=0;iL!=result.end(); i++, iL++)
2008 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2012 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2016 std::vector<int> multiVal;
2017 std::pair<int, std::pair<int,int> > slic;
2018 MEDCoupling::DataArrayInt *daIntTyypp=0;
2019 int nbc=self->getNumberOfCells();
2020 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2027 std::ostringstream oss;
2028 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2029 throw INTERP_KERNEL::Exception(oss.str().c_str());
2033 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2040 int tmp=nbc+singleVal;
2041 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2046 std::ostringstream oss;
2047 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2048 throw INTERP_KERNEL::Exception(oss.str().c_str());
2054 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2060 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2061 daIntTyypp->checkAllocated();
2062 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2066 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
2070 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2074 std::vector<int> multiVal;
2075 std::pair<int, std::pair<int,int> > slic;
2076 MEDCoupling::DataArrayInt *daIntTyypp=0;
2077 int nbc=self->getNumberOfCells();
2078 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2085 std::ostringstream oss;
2086 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2087 throw INTERP_KERNEL::Exception(oss.str().c_str());
2091 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2098 int tmp=nbc+singleVal;
2099 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2104 std::ostringstream oss;
2105 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2106 throw INTERP_KERNEL::Exception(oss.str().c_str());
2112 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2117 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2123 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2124 daIntTyypp->checkAllocated();
2125 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2129 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2133 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2135 int szArr,sw,iTypppArr;
2136 std::vector<int> stdvecTyyppArr;
2137 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2140 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2141 throw INTERP_KERNEL::Exception(oss.str().c_str());
2143 self->insertNextCell(type,size,tmp);
2146 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2148 int szArr,sw,iTypppArr;
2149 std::vector<int> stdvecTyyppArr;
2150 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2151 self->insertNextCell(type,szArr,tmp);
2154 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2156 DataArrayInt *ret=self->getNodalConnectivity();
2161 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2163 DataArrayInt *ret=self->getNodalConnectivityIndex();
2169 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2171 int szArr,sw,iTypppArr;
2172 std::vector<int> stdvecTyyppArr;
2173 const int *seedPtr=convertIntStarLikePyObjToCppIntStar(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2174 int nbOfDepthPeelingPerformed=0;
2175 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2176 PyObject *res=PyTuple_New(2);
2177 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2178 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2182 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2184 DataArrayInt *v0=0,*v1=0;
2185 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2186 PyObject *res = PyList_New(2);
2187 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2188 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2192 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2196 DataArrayDoubleTuple *aa;
2197 std::vector<double> bb;
2199 int nbOfCompo=self->getSpaceDimension();
2200 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2203 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2204 PyObject *ret=PyTuple_New(2);
2205 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2206 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2210 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2212 DataArrayInt *ret1=0;
2213 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2214 PyObject *ret=PyTuple_New(2);
2215 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2216 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2220 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2223 DataArrayInt *ret1(0);
2224 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2225 PyObject *ret=PyTuple_New(3);
2226 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2227 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2228 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2232 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2234 std::vector<int> cells;
2235 self->checkButterflyCells(cells,eps);
2236 DataArrayInt *ret=DataArrayInt::New();
2237 ret->alloc((int)cells.size(),1);
2238 std::copy(cells.begin(),cells.end(),ret->getPointer());
2239 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2242 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2244 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2246 PyObject *ret = PyList_New(sz);
2247 for(int i=0;i<sz;i++)
2248 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2252 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2254 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2255 int sz=retCpp.size();
2256 PyObject *ret=PyList_New(sz);
2257 for(int i=0;i<sz;i++)
2258 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2262 static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2264 std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2265 int sz=retCpp.size();
2266 PyObject *ret=PyList_New(sz);
2267 for(int i=0;i<sz;i++)
2268 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2272 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2275 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2276 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2277 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2280 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2283 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2284 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2288 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2291 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2292 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2296 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2298 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2299 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2300 PyObject *ret=PyTuple_New(3);
2301 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2302 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2303 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2307 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2309 DataArrayInt *tmp0=0,*tmp1=0;
2310 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2311 PyObject *ret=PyTuple_New(2);
2312 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2313 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2317 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2321 std::vector<int> multiVal;
2322 std::pair<int, std::pair<int,int> > slic;
2323 MEDCoupling::DataArrayInt *daIntTyypp=0;
2324 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2328 return self->duplicateNodes(&singleVal,&singleVal+1);
2330 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2332 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2334 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2338 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2342 std::vector<int> multiVal;
2343 std::pair<int, std::pair<int,int> > slic;
2344 MEDCoupling::DataArrayInt *daIntTyypp=0;
2345 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2349 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2351 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2353 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2355 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2359 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2362 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2363 DataArrayInt *tmp0,*tmp1=0;
2364 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2365 PyObject *ret=PyTuple_New(2);
2366 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2367 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2371 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2373 DataArrayInt *ret0=0,*ret1=0;
2374 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2375 PyObject *ret=PyTuple_New(2);
2376 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2377 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2381 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2383 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2384 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2385 DataArrayInt *ret1=0,*ret2=0;
2386 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2387 PyObject *ret=PyTuple_New(3);
2388 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2389 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2390 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2394 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2396 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2397 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2398 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2399 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2402 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2405 std::vector<const MEDCouplingUMesh *> meshes;
2406 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2407 std::vector<DataArrayInt *> corr;
2408 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2410 PyObject *ret1=PyList_New(sz);
2411 for(int i=0;i<sz;i++)
2412 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2413 PyObject *ret=PyList_New(2);
2414 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2415 PyList_SetItem(ret,1,ret1);
2419 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2421 std::vector<MEDCouplingUMesh *> meshes;
2422 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2423 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2426 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2428 std::vector<MEDCouplingUMesh *> meshes;
2429 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2430 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2433 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2437 std::vector<int> multiVal;
2438 std::pair<int, std::pair<int,int> > slic;
2439 MEDCoupling::DataArrayInt *daIntTyypp=0;
2441 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2442 convertIntStarOrSliceLikePyObjToCpp(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2446 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2448 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2450 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2452 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2456 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2458 DataArrayInt *arrOut=0,*arrIndexOut=0;
2461 std::vector<int> multiVal;
2462 std::pair<int, std::pair<int,int> > slic;
2463 MEDCoupling::DataArrayInt *daIntTyypp=0;
2465 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2466 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2471 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2476 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2481 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2485 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2487 PyObject *ret=PyTuple_New(2);
2488 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2489 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2493 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2495 DataArrayInt *arrOut=0,*arrIndexOut=0;
2496 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2497 PyObject *ret=PyTuple_New(2);
2498 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2499 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2503 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2505 if(!PySlice_Check(slic))
2506 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2507 Py_ssize_t strt=2,stp=2,step=2;
2508 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2510 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2511 arrIndxIn->checkAllocated();
2512 if(arrIndxIn->getNumberOfComponents()!=1)
2513 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2514 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2515 DataArrayInt *arrOut=0,*arrIndexOut=0;
2516 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2517 PyObject *ret=PyTuple_New(2);
2518 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2519 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2523 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2524 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2525 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2527 DataArrayInt *arrOut=0,*arrIndexOut=0;
2530 std::vector<int> multiVal;
2531 std::pair<int, std::pair<int,int> > slic;
2532 MEDCoupling::DataArrayInt *daIntTyypp=0;
2534 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2535 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2540 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2545 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2550 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2554 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2556 PyObject *ret=PyTuple_New(2);
2557 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2558 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2562 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2563 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2567 std::vector<int> multiVal;
2568 std::pair<int, std::pair<int,int> > slic;
2569 MEDCoupling::DataArrayInt *daIntTyypp=0;
2571 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2572 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2577 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2582 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2587 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2591 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2595 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2599 DataArrayDoubleTuple *aa;
2600 std::vector<double> bb;
2602 int spaceDim=self->getSpaceDimension();
2603 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2604 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2606 std::vector<int> cells;
2607 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2608 DataArrayInt *ret=DataArrayInt::New();
2609 ret->alloc((int)cells.size(),1);
2610 std::copy(cells.begin(),cells.end(),ret->getPointer());
2611 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2614 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2618 DataArrayDoubleTuple *aa;
2619 std::vector<double> bb;
2621 int spaceDim=self->getSpaceDimension();
2622 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2623 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2624 self->orientCorrectly2DCells(v,polyOnly);
2627 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2629 std::vector<int> cells;
2630 self->arePolyhedronsNotCorrectlyOriented(cells);
2631 DataArrayInt *ret=DataArrayInt::New();
2632 ret->alloc((int)cells.size(),1);
2633 std::copy(cells.begin(),cells.end(),ret->getPointer());
2634 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2637 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2641 self->getFastAveragePlaneOfThis(vec,pos);
2643 std::copy(vec,vec+3,vals);
2644 std::copy(pos,pos+3,vals+3);
2645 return convertDblArrToPyListOfTuple<double>(vals,3,2);
2648 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2650 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2651 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2652 return MEDCouplingUMesh::MergeUMeshes(tmp);
2655 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2658 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2659 PyObject *ret=PyTuple_New(2);
2660 PyObject *ret0Py=ret0?Py_True:Py_False;
2662 PyTuple_SetItem(ret,0,ret0Py);
2663 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2667 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2670 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2671 PyObject *ret=PyTuple_New(2);
2672 PyObject *ret0Py=ret0?Py_True:Py_False;
2674 PyTuple_SetItem(ret,0,ret0Py);
2675 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2679 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2681 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2682 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2683 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2684 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2685 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2686 PyObject *ret=PyTuple_New(5);
2687 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2688 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2689 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2690 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2691 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2695 PyObject *explodeIntoEdges() const throw(INTERP_KERNEL::Exception)
2697 MCAuto<DataArrayInt> desc,descIndex,revDesc,revDescIndx;
2698 MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2699 PyObject *ret=PyTuple_New(5);
2700 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2701 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2702 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2703 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2704 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2708 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2710 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2711 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2712 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2713 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2714 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2715 PyObject *ret=PyTuple_New(5);
2716 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2717 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2718 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2719 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2720 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2724 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2726 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2727 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2728 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2729 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2730 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2731 PyObject *ret=PyTuple_New(5);
2732 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2733 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2734 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2735 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2736 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2740 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2742 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2743 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2744 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2745 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2746 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2747 PyObject *ret=PyTuple_New(5);
2748 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2749 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2750 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2751 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2752 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2756 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2758 DataArrayInt *neighbors=0,*neighborsIdx=0;
2759 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2760 PyObject *ret=PyTuple_New(2);
2761 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2762 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2766 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2768 DataArrayInt *neighbors=0,*neighborsIdx=0;
2769 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2770 PyObject *ret=PyTuple_New(2);
2771 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2772 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2776 PyObject *computeEnlargedNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2778 MCAuto<DataArrayInt> neighbors,neighborsIdx;
2779 self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2780 PyObject *ret=PyTuple_New(2);
2781 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2782 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2786 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const throw(INTERP_KERNEL::Exception)
2788 MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
2789 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2790 PyObject *ret=PyTuple_New(2);
2791 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2792 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2796 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2798 DataArrayInt *neighbors=0,*neighborsIdx=0;
2799 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2800 PyObject *ret=PyTuple_New(2);
2801 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2802 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2806 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2808 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2809 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2810 DataArrayInt *d2,*d3,*d4,*dd5;
2811 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2812 PyObject *ret=PyTuple_New(7);
2813 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2814 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2815 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2816 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2817 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2818 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2819 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2823 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2826 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2827 da->checkAllocated();
2828 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2831 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2834 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2835 da->checkAllocated();
2836 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2839 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2842 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2843 da->checkAllocated();
2844 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2847 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2850 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2851 da->checkAllocated();
2852 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2853 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2854 PyObject *res = PyList_New(result.size());
2855 for (int i=0;iL!=result.end(); i++, iL++)
2856 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2860 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2863 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2864 da->checkAllocated();
2865 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2866 ret->setName(da->getName().c_str());
2870 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2872 DataArrayInt *cellNb1=0,*cellNb2=0;
2873 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2874 PyObject *ret=PyTuple_New(3);
2875 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2876 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2877 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2881 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2883 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2884 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2885 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2886 PyObject *ret(PyTuple_New(4));
2887 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2888 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2889 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2890 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2894 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2896 int spaceDim=self->getSpaceDimension();
2898 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2900 DataArrayDouble *a,*a2;
2901 DataArrayDoubleTuple *aa,*aa2;
2902 std::vector<double> bb,bb2;
2904 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2905 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2906 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2907 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2909 DataArrayInt *cellIds=0;
2910 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2911 PyObject *ret=PyTuple_New(2);
2912 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2913 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2917 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2919 int spaceDim=self->getSpaceDimension();
2921 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2923 DataArrayDouble *a,*a2;
2924 DataArrayDoubleTuple *aa,*aa2;
2925 std::vector<double> bb,bb2;
2927 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2928 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2929 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2930 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2932 DataArrayInt *cellIds=0;
2933 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2934 PyObject *ret=PyTuple_New(2);
2935 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2936 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2940 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2943 DataArrayDouble *a,*a2;
2944 DataArrayDoubleTuple *aa,*aa2;
2945 std::vector<double> bb,bb2;
2947 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st paramater for origin.";
2948 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd paramater for vector.";
2949 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2950 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2951 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2955 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2957 int spaceDim=self->getSpaceDimension();
2959 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2961 DataArrayDouble *a,*a2;
2962 DataArrayDoubleTuple *aa,*aa2;
2963 std::vector<double> bb,bb2;
2965 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2966 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2967 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2968 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2969 return self->getCellIdsCrossingPlane(orig,vect,eps);
2972 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2976 std::vector<int> pos2;
2977 DataArrayInt *pos3=0;
2978 DataArrayIntTuple *pos4=0;
2979 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2984 self->convertToPolyTypes(&pos1,&pos1+1);
2991 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2996 self->convertToPolyTypes(pos3->begin(),pos3->end());
3000 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
3004 void convertAllToPoly();
3005 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
3006 bool unPolyze() throw(INTERP_KERNEL::Exception);
3007 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
3008 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
3009 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
3012 //== MEDCouplingUMesh End
3014 //== MEDCouplingMappedExtrudedMesh
3016 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
3019 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
3020 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
3021 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
3022 int get2DCellIdForExtrusion() const;
3024 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
3026 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3029 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
3031 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3034 MEDCouplingMappedExtrudedMesh()
3036 return MEDCouplingMappedExtrudedMesh::New();
3039 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3041 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
3044 std::string __str__() const throw(INTERP_KERNEL::Exception)
3046 return self->simpleRepr();
3049 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3051 std::ostringstream oss;
3052 self->reprQuickOverview(oss);
3056 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
3058 MEDCouplingUMesh *ret=self->getMesh2D();
3061 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3063 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
3065 MEDCouplingUMesh *ret=self->getMesh1D();
3068 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3070 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
3072 DataArrayInt *ret=self->getMesh3DIds();
3075 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3080 //== MEDCouplingMappedExtrudedMesh End
3082 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3085 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3086 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3087 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
3088 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
3089 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
3090 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
3093 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
3095 int szArr,sw,iTypppArr;
3096 std::vector<int> stdvecTyyppArr;
3097 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3098 self->insertNextCell(tmp,tmp+szArr);
3101 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3103 DataArrayInt *ret=self->getNodalConnectivity();
3104 if(ret) ret->incrRef();
3108 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3110 std::vector< const MEDCoupling1GTUMesh *> parts;
3111 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3112 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3117 //== MEDCoupling1SGTUMesh
3119 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3122 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3123 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3124 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
3125 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
3126 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
3127 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3128 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
3129 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
3130 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
3133 MEDCoupling1SGTUMesh()
3135 return MEDCoupling1SGTUMesh::New();
3138 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3140 return MEDCoupling1SGTUMesh::New(name,type);
3143 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3145 return MEDCoupling1SGTUMesh::New(m);
3148 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3150 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
3153 std::string __str__() const throw(INTERP_KERNEL::Exception)
3155 return self->simpleRepr();
3158 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3160 std::ostringstream oss;
3161 self->reprQuickOverview(oss);
3165 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3167 DataArrayInt *cellPerm(0),*nodePerm(0);
3168 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3169 PyObject *ret(PyTuple_New(3));
3170 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3171 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3172 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3176 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3178 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3179 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3180 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3183 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3185 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3186 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3187 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3192 //== MEDCoupling1SGTUMesh End
3194 //== MEDCoupling1DGTUMesh
3196 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3199 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3200 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3201 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3202 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3203 bool isPacked() const throw(INTERP_KERNEL::Exception);
3206 MEDCoupling1DGTUMesh()
3208 return MEDCoupling1DGTUMesh::New();
3210 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3212 return MEDCoupling1DGTUMesh::New(name,type);
3215 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3217 return MEDCoupling1DGTUMesh::New(m);
3220 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3222 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3225 std::string __str__() const throw(INTERP_KERNEL::Exception)
3227 return self->simpleRepr();
3230 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3232 std::ostringstream oss;
3233 self->reprQuickOverview(oss);
3237 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3239 DataArrayInt *ret=self->getNodalConnectivityIndex();
3240 if(ret) ret->incrRef();
3244 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3246 DataArrayInt *ret1=0,*ret2=0;
3247 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3248 PyObject *ret0Py=ret0?Py_True:Py_False;
3250 PyObject *ret=PyTuple_New(3);
3251 PyTuple_SetItem(ret,0,ret0Py);
3252 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3253 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3257 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3260 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3261 PyObject *ret=PyTuple_New(2);
3262 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3263 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3264 PyTuple_SetItem(ret,1,ret1Py);
3268 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3270 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3271 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3272 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3275 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3277 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3278 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3279 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3282 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3284 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3285 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3286 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3291 //== MEDCoupling1DGTUMeshEnd
3293 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3296 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3297 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3298 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3299 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3300 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3301 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3302 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3303 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3304 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3305 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3306 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3307 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3308 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3309 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3310 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3313 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3315 int tmpp1=-1,tmpp2=-1;
3316 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3317 std::vector< std::pair<int,int> > inp;
3321 for(int i=0;i<tmpp1;i++)
3322 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3327 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3328 inp.resize(tmpp1/2);
3329 for(int i=0;i<tmpp1/2;i++)
3330 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3333 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3334 return self->buildStructuredSubPart(inp);
3337 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3339 std::vector< std::pair<int,int> > inp;
3340 convertPyToVectorPairInt(part,inp);
3342 int szArr,sw,iTypppArr;
3343 std::vector<int> stdvecTyyppArr;
3344 const int *tmp4=convertIntStarLikePyObjToCppIntStar(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3345 std::vector<int> tmp5(tmp4,tmp4+szArr);
3347 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3350 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3352 std::vector< std::pair<int,int> > inp;
3353 convertPyToVectorPairInt(part,inp);
3354 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3357 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3359 std::vector< std::pair<int,int> > inp;
3360 convertPyToVectorPairInt(part,inp);
3361 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3364 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3366 std::vector< std::pair<int,int> > inp;
3367 convertPyToVectorPairInt(part,inp);
3368 std::vector<int> stWithGhost;
3369 std::vector< std::pair<int,int> > partWithGhost;
3370 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3371 PyObject *ret(PyTuple_New(2));
3372 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3373 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3377 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3379 std::vector< std::pair<int,int> > inp;
3380 convertPyToVectorPairInt(partCompactFormat,inp);
3381 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3384 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3386 std::vector< std::pair<int,int> > inp;
3387 convertPyToVectorPairInt(partCompactFormat,inp);
3388 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3391 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3393 std::vector< std::pair<int,int> > inp;
3394 convertPyToVectorPairInt(part,inp);
3395 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3398 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3400 int szArr,sw,iTypppArr;
3401 std::vector<int> stdvecTyyppArr;
3402 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3403 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3406 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3408 int szArr,sw,iTypppArr;
3409 std::vector<int> stdvecTyyppArr;
3410 const int *tmp(convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3411 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3414 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3416 std::vector< std::pair<int,int> > inp;
3417 convertPyToVectorPairInt(partCompactFormat,inp);
3418 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3421 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3423 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3424 PyObject *retPy=PyList_New(ret.size());
3425 for(std::size_t i=0;i<ret.size();i++)
3427 PyObject *tmp=PyTuple_New(2);
3428 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3429 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3430 PyList_SetItem(retPy,i,tmp);
3435 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3437 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3438 convertPyToVectorPairInt(r1,r1Cpp);
3439 convertPyToVectorPairInt(r2,r2Cpp);
3440 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3441 PyObject *retPy=PyList_New(ret.size());
3442 for(std::size_t i=0;i<ret.size();i++)
3444 PyObject *tmp=PyTuple_New(2);
3445 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3446 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3447 PyList_SetItem(retPy,i,tmp);
3452 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3454 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3455 convertPyToVectorPairInt(r1,r1Cpp);
3456 convertPyToVectorPairInt(r2,r2Cpp);
3457 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3460 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3462 int szArr,sw,iTypppArr;
3463 std::vector<int> stdvecTyyppArr;
3464 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3465 int szArr2,sw2,iTypppArr2;
3466 std::vector<int> stdvecTyyppArr2;
3467 const int *tmp2=convertIntStarLikePyObjToCppIntStar(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3468 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3469 std::vector< std::pair<int,int> > partCompactFormat;
3470 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3471 PyObject *ret=PyTuple_New(2);
3472 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3473 PyTuple_SetItem(ret,0,ret0Py);
3474 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3475 for(std::size_t i=0;i<partCompactFormat.size();i++)
3477 PyObject *tmp4=PyTuple_New(2);
3478 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3479 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3480 PyList_SetItem(ret1Py,i,tmp4);
3482 PyTuple_SetItem(ret,1,ret1Py);
3486 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3488 std::vector< std::pair<int,int> > param0,param1,ret;
3489 convertPyToVectorPairInt(bigInAbs,param0);
3490 convertPyToVectorPairInt(partOfBigInAbs,param1);
3491 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3492 PyObject *retPy(PyList_New(ret.size()));
3493 for(std::size_t i=0;i<ret.size();i++)
3495 PyObject *tmp(PyTuple_New(2));
3496 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3497 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3498 PyList_SetItem(retPy,i,tmp);
3503 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3505 std::vector< std::pair<int,int> > param0;
3506 convertPyToVectorPairInt(part,param0);
3507 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3508 PyObject *retPy(PyList_New(ret.size()));
3509 for(std::size_t i=0;i<ret.size();i++)
3511 PyObject *tmp(PyTuple_New(2));
3512 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3513 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3514 PyList_SetItem(retPy,i,tmp);
3519 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3521 std::vector< std::pair<int,int> > param0,param1;
3522 convertPyToVectorPairInt(startingFrom,param0);
3523 convertPyToVectorPairInt(goingTo,param1);
3524 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3527 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3529 std::vector< std::pair<int,int> > param0,param1,ret;
3530 convertPyToVectorPairInt(bigInAbs,param0);
3531 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3532 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3533 PyObject *retPy(PyList_New(ret.size()));
3534 for(std::size_t i=0;i<ret.size();i++)
3536 PyObject *tmp(PyTuple_New(2));
3537 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3538 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3539 PyList_SetItem(retPy,i,tmp);
3546 class MEDCouplingCurveLinearMesh;
3548 //== MEDCouplingCMesh
3550 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3553 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3554 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3555 void setCoords(const DataArrayDouble *coordsX,
3556 const DataArrayDouble *coordsY=0,
3557 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3558 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3559 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3561 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3563 return MEDCouplingCMesh::New();
3565 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3567 return MEDCouplingCMesh::New(meshName);
3570 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3572 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3574 std::string __str__() const throw(INTERP_KERNEL::Exception)
3576 return self->simpleRepr();
3578 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3580 std::ostringstream oss;
3581 self->reprQuickOverview(oss);
3584 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3586 DataArrayDouble *ret=self->getCoordsAt(i);
3594 //== MEDCouplingCMesh End
3596 //== MEDCouplingCurveLinearMesh
3598 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3601 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3602 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3603 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3605 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3607 return MEDCouplingCurveLinearMesh::New();
3609 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3611 return MEDCouplingCurveLinearMesh::New(meshName);
3613 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3615 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3617 std::string __str__() const throw(INTERP_KERNEL::Exception)
3619 return self->simpleRepr();
3621 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3623 std::ostringstream oss;
3624 self->reprQuickOverview(oss);
3627 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3629 DataArrayDouble *ret=self->getCoords();
3634 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3636 int szArr,sw,iTypppArr;
3637 std::vector<int> stdvecTyyppArr;
3638 const int *tmp=convertIntStarLikePyObjToCppIntStar(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3639 self->setNodeGridStructure(tmp,tmp+szArr);
3644 //== MEDCouplingCurveLinearMesh End
3646 //== MEDCouplingIMesh
3648 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3651 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3653 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3654 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3655 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3656 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3657 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3658 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3659 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3660 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3661 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3662 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3663 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3668 return MEDCouplingIMesh::New();
3670 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3672 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3673 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3674 const int *nodeStrctPtr(0);
3675 const double *originPtr(0),*dxyzPtr(0);
3677 std::vector<int> bb0;
3678 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
3681 std::vector<double> bb,bb2;
3683 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3684 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3686 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3689 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3691 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3694 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3696 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3699 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3702 std::vector<int> bb0;
3703 const int *nodeStrctPtr(convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0));
3704 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3707 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3709 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3712 DataArrayDoubleTuple *aa;
3713 std::vector<double> bb;
3715 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3716 self->setOrigin(originPtr,originPtr+nbTuples);
3719 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3721 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3724 DataArrayDoubleTuple *aa;
3725 std::vector<double> bb;
3727 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3728 self->setDXYZ(originPtr,originPtr+nbTuples);
3731 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3733 std::vector< std::pair<int,int> > inp;
3734 convertPyToVectorPairInt(fineLocInCoarse,inp);
3735 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3738 static void CondenseFineToCoarseGhost(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA, int ghostSize) throw(INTERP_KERNEL::Exception)
3740 std::vector< std::pair<int,int> > inp;
3741 convertPyToVectorPairInt(fineLocInCoarse,inp);
3742 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3745 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3747 std::vector< std::pair<int,int> > inp;
3748 convertPyToVectorPairInt(fineLocInCoarse,inp);
3749 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3752 static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, int ghostSize) throw(INTERP_KERNEL::Exception)
3754 std::vector< std::pair<int,int> > inp;
3755 convertPyToVectorPairInt(fineLocInCoarse,inp);
3756 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3759 static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, int ghostSize) throw(INTERP_KERNEL::Exception)
3761 std::vector< std::pair<int,int> > inp;
3762 convertPyToVectorPairInt(fineLocInCoarse,inp);
3763 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3766 std::string __str__() const throw(INTERP_KERNEL::Exception)
3768 return self->simpleRepr();
3770 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3772 std::ostringstream oss;
3773 self->reprQuickOverview(oss);
3779 //== MEDCouplingIMesh End
3783 namespace MEDCoupling
3785 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3788 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3789 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3790 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3791 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3792 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3793 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3794 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3795 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3796 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3797 std::string getName() const throw(INTERP_KERNEL::Exception);
3798 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3799 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3800 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3801 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3802 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3803 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3804 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3805 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3806 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3807 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3808 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3809 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3810 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3811 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3812 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3813 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3815 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3817 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3820 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3823 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3825 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3828 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3831 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3833 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3834 return convertIntArrToPyList3(ret);
3837 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3840 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3841 PyObject *ret=PyTuple_New(2);
3842 PyObject *ret0Py=ret0?Py_True:Py_False;
3844 PyTuple_SetItem(ret,0,ret0Py);
3845 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3849 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3851 DataArrayInt *ret1=0;
3852 MEDCouplingMesh *ret0=0;
3854 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3855 if (!SWIG_IsOK(res1))
3858 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3859 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3863 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3865 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3866 da2->checkAllocated();
3867 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3869 PyObject *res = PyList_New(2);
3870 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3871 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3875 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3877 DataArrayInt *ret1=0;
3879 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3880 PyObject *res=PyTuple_New(2);
3881 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3883 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3886 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3887 PyTuple_SetItem(res,1,res1);
3892 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3895 int v0; std::vector<int> v1;
3896 const int *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
3897 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3900 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3901 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3904 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3905 if (!SWIG_IsOK(res1))
3908 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3909 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3913 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3915 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3916 da2->checkAllocated();
3917 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3921 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3923 std::vector<int> tmp;
3924 self->getCellIdsHavingGaussLocalization(locId,tmp);
3925 DataArrayInt *ret=DataArrayInt::New();
3926 ret->alloc((int)tmp.size(),1);
3927 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3928 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3931 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3933 std::vector<int> inp0;
3934 convertPyToNewIntArr4(code,1,3,inp0);
3935 std::vector<const DataArrayInt *> inp1;
3936 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3937 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3942 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3945 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3946 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f) throw(INTERP_KERNEL::Exception);
3947 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3948 static MEDCouplingFieldTemplate *New(TypeOfField type);
3949 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3950 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3953 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3955 return MEDCouplingFieldTemplate::New(f);
3958 MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f) throw(INTERP_KERNEL::Exception)
3960 return MEDCouplingFieldTemplate::New(f);
3963 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3965 return MEDCouplingFieldTemplate::New(f);
3968 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3970 return MEDCouplingFieldTemplate::New(type);
3973 std::string __str__() const throw(INTERP_KERNEL::Exception)
3975 return self->simpleRepr();
3978 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3980 std::ostringstream oss;
3981 self->reprQuickOverview(oss);
3987 class MEDCouplingFieldInt;
3989 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3992 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3993 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3994 void setTimeUnit(const std::string& unit);
3995 std::string getTimeUnit() const;
3996 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3997 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3998 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3999 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4000 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4001 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
4002 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
4003 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
4004 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
4005 MEDCouplingFieldDouble *deepCopy() const;
4006 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
4007 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
4008 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
4009 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
4010 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
4011 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
4012 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
4013 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
4014 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
4015 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4016 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4017 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4018 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
4019 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
4020 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
4021 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
4022 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
4023 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
4024 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4025 void setIteration(int it) throw(INTERP_KERNEL::Exception);
4026 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
4027 void setOrder(int order) throw(INTERP_KERNEL::Exception);
4028 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
4029 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
4030 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
4031 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4032 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4033 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4034 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4035 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4036 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4037 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
4038 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
4039 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
4040 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
4041 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
4042 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
4043 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
4044 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
4045 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
4046 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
4047 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
4048 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
4049 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
4050 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4051 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4052 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4053 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4054 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4055 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4056 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
4057 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
4058 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
4059 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
4060 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
4061 double getMaxValue() const throw(INTERP_KERNEL::Exception);
4062 double getMinValue() const throw(INTERP_KERNEL::Exception);
4063 double getAverageValue() const throw(INTERP_KERNEL::Exception);
4064 double norm2() const throw(INTERP_KERNEL::Exception);
4065 double normMax() const throw(INTERP_KERNEL::Exception);
4066 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4067 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4068 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4069 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
4070 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
4071 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
4072 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
4073 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4074 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4075 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4076 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4077 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4078 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4079 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4080 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4081 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4082 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4083 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4084 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4085 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4086 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4087 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
4089 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4091 return MEDCouplingFieldDouble::New(type,td);
4094 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4096 return MEDCouplingFieldDouble::New(ft,td);
4099 std::string __str__() const throw(INTERP_KERNEL::Exception)
4101 return self->simpleRepr();
4104 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4106 std::ostringstream oss;
4107 self->reprQuickOverview(oss);
4111 MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
4113 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4117 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
4119 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4123 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4125 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4127 DataArrayDouble *a,*a2;
4128 DataArrayDoubleTuple *aa,*aa2;
4129 std::vector<double> bb,bb2;
4131 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4132 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4133 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4136 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
4138 DataArrayDouble *ret=self->getArray();
4144 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4146 std::vector<DataArrayDouble *> arrs=self->getArrays();
4147 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4151 PyObject *ret=PyTuple_New(sz);
4152 for(int i=0;i<sz;i++)
4155 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4157 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4162 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4164 std::vector<const DataArrayDouble *> tmp;
4165 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4167 std::vector<DataArrayDouble *> arrs(sz);
4168 for(int i=0;i<sz;i++)
4169 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4170 self->setArrays(arrs);
4173 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4175 DataArrayDouble *ret=self->getEndArray();
4181 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4185 DataArrayDoubleTuple *aa;
4186 std::vector<double> bb;
4188 const MEDCouplingMesh *mesh=self->getMesh();
4190 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4191 int spaceDim=mesh->getSpaceDimension();
4192 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4193 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4195 int sz=self->getNumberOfComponents();
4196 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4197 self->getValueOn(spaceLoc,res);
4198 return convertDblArrToPyList<double>(res,sz);
4201 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4203 int sz=self->getNumberOfComponents();
4204 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4205 self->getValueOnPos(i,j,k,res);
4206 return convertDblArrToPyList<double>(res,sz);
4209 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4211 const MEDCouplingMesh *mesh(self->getMesh());
4213 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4216 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4217 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4218 mesh->getSpaceDimension(),true,nbPts);
4219 return self->getValueOnMulti(inp,nbPts);
4222 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4226 DataArrayDoubleTuple *aa;
4227 std::vector<double> bb;
4229 const MEDCouplingMesh *mesh=self->getMesh();
4231 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4232 int spaceDim=mesh->getSpaceDimension();
4233 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4234 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4237 int sz=self->getNumberOfComponents();
4238 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4239 self->getValueOn(spaceLoc,time,res);
4240 return convertDblArrToPyList<double>(res,sz);
4243 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4245 if(self->getArray()!=0)
4246 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4249 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4250 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4251 self->setArray(arr);
4255 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4258 double tmp0=self->getTime(tmp1,tmp2);
4259 PyObject *res = PyList_New(3);
4260 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4261 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4262 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4266 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4269 double tmp0=self->getStartTime(tmp1,tmp2);
4270 PyObject *res = PyList_New(3);
4271 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4272 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4273 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4277 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4280 double tmp0=self->getEndTime(tmp1,tmp2);
4281 PyObject *res = PyList_New(3);
4282 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4283 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4284 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4287 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4289 int sz=self->getNumberOfComponents();
4290 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4291 self->accumulate(tmp);
4292 return convertDblArrToPyList<double>(tmp,sz);
4294 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4296 int sz=self->getNumberOfComponents();
4297 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4298 self->integral(isWAbs,tmp);
4299 return convertDblArrToPyList<double>(tmp,sz);
4301 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4303 int sz=self->getNumberOfComponents();
4304 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4305 self->getWeightedAverageValue(tmp,isWAbs);
4306 return convertDblArrToPyList<double>(tmp,sz);
4308 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4310 int sz=self->getNumberOfComponents();
4311 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4313 return convertDblArrToPyList<double>(tmp,sz);
4315 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4317 int sz=self->getNumberOfComponents();
4318 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4320 return convertDblArrToPyList<double>(tmp,sz);
4322 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4324 int szArr,sw,iTypppArr;
4325 std::vector<int> stdvecTyyppArr;
4326 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4327 self->renumberCells(tmp,check);
4330 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4332 int szArr,sw,iTypppArr;
4333 std::vector<int> stdvecTyyppArr;
4334 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4335 self->renumberCellsWithoutMesh(tmp,check);
4338 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4340 int szArr,sw,iTypppArr;
4341 std::vector<int> stdvecTyyppArr;
4342 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4343 self->renumberNodes(tmp,eps);
4346 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4348 int szArr,sw,iTypppArr;
4349 std::vector<int> stdvecTyyppArr;
4350 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4351 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4354 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4356 return fieldT_buildSubPart(self,li);
4359 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4361 return fieldT__getitem__(self,li);
4364 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4367 double r1=self->getMaxValue2(tmp);
4368 PyObject *ret=PyTuple_New(2);
4369 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4370 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4374 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4377 double r1=self->getMinValue2(tmp);
4378 PyObject *ret=PyTuple_New(2);
4379 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4380 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4384 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4386 std::vector<int> tmp;
4387 convertPyToNewIntArr3(li,tmp);
4388 return self->keepSelectedComponents(tmp);
4391 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4393 std::vector<int> tmp;
4394 convertPyToNewIntArr3(li,tmp);
4395 self->setSelectedComponents(f,tmp);
4398 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4401 DataArrayDouble *a,*a2;
4402 DataArrayDoubleTuple *aa,*aa2;
4403 std::vector<double> bb,bb2;
4406 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4407 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4408 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4409 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4411 return self->extractSlice3D(orig,vect,eps);
4414 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4416 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4419 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4421 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4424 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4426 const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__sub__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4427 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4430 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4432 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4434 return (*self)-(*other);
4436 throw INTERP_KERNEL::Exception(msg);
4441 DataArrayDoubleTuple *aa;
4442 std::vector<double> bb;
4444 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4449 if(!self->getArray())
4450 throw INTERP_KERNEL::Exception(msg2);
4451 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4452 ret->applyLin(1.,-val);
4453 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4454 ret2->setArray(ret);
4459 if(!self->getArray())
4460 throw INTERP_KERNEL::Exception(msg2);
4461 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4462 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4463 ret2->setArray(ret);
4468 if(!self->getArray())
4469 throw INTERP_KERNEL::Exception(msg2);
4470 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4471 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4472 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4473 ret2->setArray(ret);
4478 if(!self->getArray())
4479 throw INTERP_KERNEL::Exception(msg2);
4480 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4481 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4482 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4483 ret2->setArray(ret);
4487 { throw INTERP_KERNEL::Exception(msg); }
4491 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4493 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4496 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4498 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4501 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4503 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4506 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4508 const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__div__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4509 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4512 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4514 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4516 return (*self)/(*other);
4518 throw INTERP_KERNEL::Exception(msg);
4523 DataArrayDoubleTuple *aa;
4524 std::vector<double> bb;
4526 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4532 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4533 if(!self->getArray())
4534 throw INTERP_KERNEL::Exception(msg2);
4535 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4536 ret->applyLin(1./val,0);
4537 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4538 ret2->setArray(ret);
4543 if(!self->getArray())
4544 throw INTERP_KERNEL::Exception(msg2);
4545 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4546 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4547 ret2->setArray(ret);
4552 if(!self->getArray())
4553 throw INTERP_KERNEL::Exception(msg2);
4554 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4555 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4556 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4557 ret2->setArray(ret);
4562 if(!self->getArray())
4563 throw INTERP_KERNEL::Exception(msg2);
4564 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4565 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4566 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4567 ret2->setArray(ret);
4571 { throw INTERP_KERNEL::Exception(msg); }
4575 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4577 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4580 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4582 const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__pow__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4583 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4586 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4588 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4590 return (*self)^(*other);
4592 throw INTERP_KERNEL::Exception(msg);
4597 DataArrayDoubleTuple *aa;
4598 std::vector<double> bb;
4600 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4605 if(!self->getArray())
4606 throw INTERP_KERNEL::Exception(msg2);
4607 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4609 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4610 ret2->setArray(ret);
4615 if(!self->getArray())
4616 throw INTERP_KERNEL::Exception(msg2);
4617 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4618 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4619 ret2->setArray(ret);
4624 if(!self->getArray())
4625 throw INTERP_KERNEL::Exception(msg2);
4626 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4627 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4628 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4629 ret2->setArray(ret);
4634 if(!self->getArray())
4635 throw INTERP_KERNEL::Exception(msg2);
4636 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4637 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4638 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4639 ret2->setArray(ret);
4643 { throw INTERP_KERNEL::Exception(msg); }
4647 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4649 return self->negate();
4652 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4654 const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__iadd__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4655 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4658 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4660 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4664 Py_XINCREF(trueSelf);
4668 throw INTERP_KERNEL::Exception(msg);
4673 DataArrayDoubleTuple *aa;
4674 std::vector<double> bb;
4676 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4681 if(!self->getArray())
4682 throw INTERP_KERNEL::Exception(msg2);
4683 self->getArray()->applyLin(1.,val);
4684 Py_XINCREF(trueSelf);
4689 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4692 Py_XINCREF(trueSelf);
4697 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4698 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4699 ret2->setArray(aaa);
4701 Py_XINCREF(trueSelf);
4706 if(!self->getArray())
4707 throw INTERP_KERNEL::Exception(msg2);
4708 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4709 self->getArray()->addEqual(aaa);
4710 Py_XINCREF(trueSelf);
4714 { throw INTERP_KERNEL::Exception(msg); }
4718 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4720 const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__isub__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4721 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4724 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4726 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4730 Py_XINCREF(trueSelf);
4734 throw INTERP_KERNEL::Exception(msg);
4739 DataArrayDoubleTuple *aa;
4740 std::vector<double> bb;
4742 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4747 if(!self->getArray())
4748 throw INTERP_KERNEL::Exception(msg2);
4749 self->getArray()->applyLin(1.,-val);
4750 Py_XINCREF(trueSelf);
4755 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4758 Py_XINCREF(trueSelf);
4763 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4764 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4765 ret2->setArray(aaa);
4767 Py_XINCREF(trueSelf);
4772 if(!self->getArray())
4773 throw INTERP_KERNEL::Exception(msg2);
4774 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4775 self->getArray()->substractEqual(aaa);
4776 Py_XINCREF(trueSelf);
4780 { throw INTERP_KERNEL::Exception(msg); }
4784 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4786 const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__imul__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4787 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4790 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4792 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4796 Py_XINCREF(trueSelf);
4800 throw INTERP_KERNEL::Exception(msg);
4805 DataArrayDoubleTuple *aa;
4806 std::vector<double> bb;
4808 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4813 if(!self->getArray())
4814 throw INTERP_KERNEL::Exception(msg2);
4815 self->getArray()->applyLin(val,0);
4816 Py_XINCREF(trueSelf);
4821 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4824 Py_XINCREF(trueSelf);
4829 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4830 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4831 ret2->setArray(aaa);
4833 Py_XINCREF(trueSelf);
4838 if(!self->getArray())
4839 throw INTERP_KERNEL::Exception(msg2);
4840 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4841 self->getArray()->multiplyEqual(aaa);
4842 Py_XINCREF(trueSelf);
4846 { throw INTERP_KERNEL::Exception(msg); }
4850 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4852 const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__idiv__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4853 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4856 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4858 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4862 Py_XINCREF(trueSelf);
4866 throw INTERP_KERNEL::Exception(msg);
4871 DataArrayDoubleTuple *aa;
4872 std::vector<double> bb;
4874 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4880 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4881 if(!self->getArray())
4882 throw INTERP_KERNEL::Exception(msg2);
4883 self->getArray()->applyLin(1./val,0);
4884 Py_XINCREF(trueSelf);
4889 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4892 Py_XINCREF(trueSelf);
4897 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4898 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4899 ret2->setArray(aaa);
4901 Py_XINCREF(trueSelf);
4906 if(!self->getArray())
4907 throw INTERP_KERNEL::Exception(msg2);
4908 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4909 self->getArray()->divideEqual(aaa);
4910 Py_XINCREF(trueSelf);
4914 { throw INTERP_KERNEL::Exception(msg); }
4918 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4920 const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__ipow__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4921 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4924 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4926 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4930 Py_XINCREF(trueSelf);
4934 throw INTERP_KERNEL::Exception(msg);
4939 DataArrayDoubleTuple *aa;
4940 std::vector<double> bb;
4942 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4947 if(!self->getArray())
4948 throw INTERP_KERNEL::Exception(msg2);
4949 self->getArray()->applyPow(val);
4950 Py_XINCREF(trueSelf);
4955 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4958 Py_XINCREF(trueSelf);
4963 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4964 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4965 ret2->setArray(aaa);
4967 Py_XINCREF(trueSelf);
4972 if(!self->getArray())
4973 throw INTERP_KERNEL::Exception(msg2);
4974 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4975 self->getArray()->powEqual(aaa);
4976 Py_XINCREF(trueSelf);
4980 { throw INTERP_KERNEL::Exception(msg); }
4984 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4986 std::vector<const MEDCouplingFieldDouble *> tmp;
4987 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4988 return MEDCouplingFieldDouble::MergeFields(tmp);
4991 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4993 std::vector<const MEDCouplingFieldDouble *> tmp;
4994 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4995 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4998 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
5000 std::vector<double> a0;
5001 std::vector<int> a1;
5002 std::vector<std::string> a2;
5003 self->getTinySerializationDbleInformation(a0);
5004 self->getTinySerializationIntInformation(a1);
5005 self->getTinySerializationStrInformation(a2);
5007 PyObject *ret(PyTuple_New(3));
5008 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
5009 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
5011 PyObject *ret2(PyList_New(sz));
5013 for(int i=0;i<sz;i++)
5014 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
5016 PyTuple_SetItem(ret,2,ret2);
5020 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5022 DataArrayInt *ret0(0);
5023 std::vector<DataArrayDouble *> ret1;
5024 self->serialize(ret0,ret1);
5027 std::size_t sz(ret1.size());
5028 PyObject *ret(PyTuple_New(2));
5029 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
5030 PyObject *ret1Py(PyList_New(sz));
5031 for(std::size_t i=0;i<sz;i++)
5035 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5037 PyTuple_SetItem(ret,1,ret1Py);
5041 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
5043 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
5044 if(!PyTuple_Check(args))
5045 throw INTERP_KERNEL::Exception(MSG);
5046 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
5047 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
5048 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
5050 PyObject *tmp0(PyTuple_New(1));
5051 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
5052 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
5054 Py_DECREF(selfMeth);
5055 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
5056 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
5057 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
5059 PyObject *a(PyInt_FromLong(0));
5060 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
5063 throw INTERP_KERNEL::Exception(MSG);
5064 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
5065 throw INTERP_KERNEL::Exception(MSG);
5066 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
5069 Py_DECREF(initMeth);
5074 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
5075 {// put an empty dict in input to say to __new__ to call __init__...
5076 self->checkConsistencyLight();
5077 PyObject *ret(PyTuple_New(1));
5078 PyObject *ret0(PyDict_New());
5080 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
5081 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
5082 PyDict_SetItem(ret0,a,d);
5083 Py_DECREF(a); Py_DECREF(d);
5085 PyTuple_SetItem(ret,0,ret0);
5089 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5091 self->checkConsistencyLight();
5092 PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
5093 PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
5094 const MEDCouplingMesh *mesh(self->getMesh());
5097 PyObject *ret(PyTuple_New(3));
5098 PyTuple_SetItem(ret,0,ret0);
5099 PyTuple_SetItem(ret,1,ret1);
5100 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
5104 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5106 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
5107 if(!PyTuple_Check(inp))
5108 throw INTERP_KERNEL::Exception(MSG);
5109 int sz(PyTuple_Size(inp));
5111 throw INTERP_KERNEL::Exception(MSG);
5113 PyObject *elt2(PyTuple_GetItem(inp,2));
5115 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
5116 if(!SWIG_IsOK(status))
5117 throw INTERP_KERNEL::Exception(MSG);
5118 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
5120 PyObject *elt0(PyTuple_GetItem(inp,0));
5121 PyObject *elt1(PyTuple_GetItem(inp,1));
5122 std::vector<double> a0;
5123 std::vector<int> a1;
5124 std::vector<std::string> a2;
5125 DataArrayInt *b0(0);
5126 std::vector<DataArrayDouble *>b1;
5128 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5129 throw INTERP_KERNEL::Exception(MSG);
5130 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5132 fillArrayWithPyListDbl3(a0py,tmp,a0);
5133 convertPyToNewIntArr3(a1py,a1);
5134 fillStringVector(a2py,a2);
5137 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5138 throw INTERP_KERNEL::Exception(MSG);
5139 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5141 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5142 if(!SWIG_IsOK(status))
5143 throw INTERP_KERNEL::Exception(MSG);
5144 b0=reinterpret_cast<DataArrayInt *>(argp);
5145 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5147 self->checkForUnserialization(a1,b0,b1);
5148 // useless here to call resizeForUnserialization because arrays are well resized.
5149 self->finishUnserialization(a1,a0,a2);
5154 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5157 int getNumberOfFields() const;
5158 MEDCouplingMultiFields *deepCopy() const;
5159 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5160 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5161 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5162 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5163 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5166 std::string __str__() const throw(INTERP_KERNEL::Exception)
5168 return self->simpleRepr();
5170 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5172 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5173 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5175 std::vector<MEDCouplingFieldDouble *> fs(sz);
5176 for(int i=0;i<sz;i++)
5177 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5178 return MEDCouplingMultiFields::New(fs);
5180 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5182 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5183 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5185 std::vector<MEDCouplingFieldDouble *> fs(sz);
5186 for(int i=0;i<sz;i++)
5187 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5188 return MEDCouplingMultiFields::New(fs);
5190 PyObject *getFields() const
5192 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5193 int sz=fields.size();
5194 PyObject *res = PyList_New(sz);
5195 for(int i=0;i<sz;i++)
5199 fields[i]->incrRef();
5200 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5204 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5209 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5211 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5215 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5218 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5220 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5222 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5224 PyObject *res = PyList_New(sz);
5225 for(int i=0;i<sz;i++)
5230 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5234 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5239 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5241 std::vector<int> refs;
5242 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5244 PyObject *res = PyList_New(sz);
5245 for(int i=0;i<sz;i++)
5250 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5254 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5258 PyObject *ret=PyTuple_New(2);
5259 PyTuple_SetItem(ret,0,res);
5260 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5263 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5265 std::vector<DataArrayDouble *> ms=self->getArrays();
5267 PyObject *res = PyList_New(sz);
5268 for(int i=0;i<sz;i++)
5273 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5277 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5282 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5284 std::vector< std::vector<int> > refs;
5285 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5287 PyObject *res = PyList_New(sz);
5288 PyObject *res2 = PyList_New(sz);
5289 for(int i=0;i<sz;i++)
5294 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5298 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5300 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5303 PyObject *ret=PyTuple_New(2);
5304 PyTuple_SetItem(ret,0,res);
5305 PyTuple_SetItem(ret,1,res2);
5311 class MEDCouplingFieldInt : public MEDCouplingField
5314 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5315 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5316 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5317 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5318 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5319 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5320 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5321 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5322 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5323 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5324 MEDCouplingFieldInt *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
5326 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5328 return MEDCouplingFieldInt::New(type,td);
5331 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5333 return MEDCouplingFieldInt::New(ft,td);
5336 std::string __str__() const throw(INTERP_KERNEL::Exception)
5338 return self->simpleRepr();
5341 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5343 std::ostringstream oss;
5344 self->reprQuickOverview(oss);
5348 MEDCouplingFieldInt *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
5350 return fieldT_buildSubPart(self,li);
5353 MEDCouplingFieldInt *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
5355 return fieldT__getitem__(self,li);
5358 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5360 DataArrayInt *ret=self->getArray();
5366 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5369 double tmp0=self->getTime(tmp1,tmp2);
5370 PyObject *res = PyList_New(3);
5371 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5372 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5373 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5379 class MEDCouplingFieldFloat : public MEDCouplingField
5382 static MEDCouplingFieldFloat *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5383 static MEDCouplingFieldFloat *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5384 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5385 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5386 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5387 void setArray(DataArrayFloat *array) throw(INTERP_KERNEL::Exception);
5388 MEDCouplingFieldFloat *deepCopy() const throw(INTERP_KERNEL::Exception);
5389 MEDCouplingFieldFloat *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5390 MEDCouplingFieldFloat *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5391 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5392 MEDCouplingFieldFloat *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
5394 MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5396 return MEDCouplingFieldFloat::New(type,td);
5399 MEDCouplingFieldFloat(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5401 return MEDCouplingFieldFloat::New(ft,td);
5404 std::string __str__() const throw(INTERP_KERNEL::Exception)
5406 return self->simpleRepr();
5409 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5411 std::ostringstream oss;
5412 self->reprQuickOverview(oss);
5416 MEDCouplingFieldFloat *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
5418 return fieldT_buildSubPart(self,li);
5421 MEDCouplingFieldFloat *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
5423 return fieldT__getitem__(self,li);
5426 DataArrayFloat *getArray() throw(INTERP_KERNEL::Exception)
5428 DataArrayFloat *ret=self->getArray();
5434 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5437 double tmp0=self->getTime(tmp1,tmp2);
5438 PyObject *res = PyList_New(3);
5439 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5440 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5441 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5447 class MEDCouplingDefinitionTime
5450 MEDCouplingDefinitionTime();
5451 void assign(const MEDCouplingDefinitionTime& other);
5452 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5453 double getTimeResolution() const;
5454 std::vector<double> getHotSpotsTime() const;
5457 std::string __str__() const throw(INTERP_KERNEL::Exception)
5459 std::ostringstream oss;
5460 self->appendRepr(oss);
5464 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5466 int meshId,arrId,arrIdInField,fieldId;
5467 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5468 PyObject *res=PyList_New(4);
5469 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5470 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5471 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5472 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5476 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5478 int meshId,arrId,arrIdInField,fieldId;
5479 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5480 PyObject *res=PyList_New(4);
5481 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5482 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5483 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5484 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5490 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5493 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5494 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5498 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5500 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5501 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5503 std::vector<MEDCouplingFieldDouble *> fs(sz);
5504 for(int i=0;i<sz;i++)
5505 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5506 return MEDCouplingFieldOverTime::New(fs);
5508 std::string __str__() const throw(INTERP_KERNEL::Exception)
5510 return self->simpleRepr();
5512 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5514 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5515 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5517 std::vector<MEDCouplingFieldDouble *> fs(sz);
5518 for(int i=0;i<sz;i++)
5519 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5520 return MEDCouplingFieldOverTime::New(fs);
5525 class MEDCouplingCartesianAMRMesh;
5527 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5530 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5531 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5532 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5535 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5537 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5545 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5548 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5549 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5550 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5553 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5555 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5556 return convertFromVectorPairInt(ret);
5559 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5561 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5562 return convertFromVectorPairInt(ret);
5565 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5567 std::vector< std::pair<int,int> > inp;
5568 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5569 self->addPatch(inp,factors);
5572 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5574 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5576 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5577 if(patchId==mesh->getNumberOfPatches())
5579 std::ostringstream oss;
5580 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5581 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5584 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5590 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5592 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5594 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5595 mesh->removePatch(patchId);
5598 int __len__() const throw(INTERP_KERNEL::Exception)
5600 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5602 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5603 return mesh->getNumberOfPatches();
5608 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5612 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5615 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5616 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5617 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5618 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5619 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5620 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5621 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5622 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5623 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5624 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5625 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5626 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5627 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5629 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5630 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5631 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5632 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5633 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5634 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5635 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5636 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5637 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5638 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5639 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5640 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5641 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5642 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5643 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5644 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5645 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5646 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5647 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5648 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5651 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5653 std::vector< std::pair<int,int> > inp;
5654 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5655 self->addPatch(inp,factors);
5658 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5660 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5662 PyObject *ret = PyList_New(sz);
5663 for(int i=0;i<sz;i++)
5665 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5668 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5673 // agy : don't know why typemap fails here ??? let it in the extend section
5674 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5676 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5679 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5681 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5682 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5688 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5690 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5691 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5697 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5699 std::vector<int> out1;
5700 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5701 PyObject *ret(PyTuple_New(2));
5702 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5703 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5707 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5709 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5711 PyObject *ret = PyList_New(sz);
5712 for(int i=0;i<sz;i++)
5713 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5717 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5719 std::vector<const DataArrayDouble *> inp;
5720 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5721 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5724 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5726 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5732 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5734 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5740 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5742 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5748 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5750 const MEDCouplingIMesh *ret(self->getImageMesh());
5753 return const_cast<MEDCouplingIMesh *>(ret);
5756 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5758 if(patchId==self->getNumberOfPatches())
5760 std::ostringstream oss;
5761 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5762 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5765 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5771 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5773 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5774 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5775 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5778 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5780 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5781 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5782 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5785 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5787 self->removePatch(patchId);
5790 int __len__() const throw(INTERP_KERNEL::Exception)
5792 return self->getNumberOfPatches();
5797 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5801 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5804 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5807 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5809 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5810 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5811 const int *nodeStrctPtr(0);
5812 const double *originPtr(0),*dxyzPtr(0);
5814 std::vector<int> bb0;
5815 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
5818 std::vector<double> bb,bb2;
5820 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5821 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5823 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5826 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5828 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5829 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5830 std::vector< std::vector<int> > inp2;
5831 convertPyToVectorOfVectorOfInt(factors,inp2);
5832 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5835 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5837 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5840 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5842 return MEDCouplingCartesianAMRMesh::New(mesh);
5847 class MEDCouplingDataForGodFather : public RefCountObject
5850 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5851 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5852 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5853 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5854 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5855 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5856 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5857 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5858 virtual void alloc() throw(INTERP_KERNEL::Exception);
5859 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5862 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5864 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5872 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5875 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5876 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5877 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5878 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5879 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5880 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5881 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5882 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5883 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5886 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5888 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5889 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5890 MEDCouplingAMRAttribute *ret(0);
5893 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5894 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5896 catch(INTERP_KERNEL::Exception&)
5898 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5899 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5904 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5906 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5909 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5911 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5912 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5918 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5920 std::vector< std::vector<std::string> > compNamesCpp;
5921 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5922 self->spillInfoOnComponents(compNamesCpp);
5925 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5927 std::vector<int> inp0;
5928 if(!fillIntVector(nfs,inp0))
5929 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5930 std::size_t sz(inp0.size());
5931 std::vector<NatureOfField> inp00(sz);
5932 for(std::size_t i=0;i<sz;i++)
5933 inp00[i]=(NatureOfField)inp0[i];
5934 self->spillNatures(inp00);
5937 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5939 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5940 int sz((int)ret.size());
5941 PyObject *retPy(PyList_New(sz));
5942 for(int i=0;i<sz;i++)
5943 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5949 class DenseMatrix : public RefCountObject, public TimeLabel
5952 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5953 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5954 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5955 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5957 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5958 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5959 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5960 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5961 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5962 void transpose() throw(INTERP_KERNEL::Exception);
5964 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5965 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5966 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5969 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5971 return DenseMatrix::New(nbRows,nbCols);
5974 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5976 return DenseMatrix::New(array,nbRows,nbCols);
5979 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5982 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5983 PyObject *ret=PyTuple_New(2);
5984 PyObject *ret0Py=ret0?Py_True:Py_False;
5986 PyTuple_SetItem(ret,0,ret0Py);
5987 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5991 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5993 DataArrayDouble *ret(self->getData());
5999 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6001 return MEDCoupling::DenseMatrix::Add(self,other);
6004 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6006 return MEDCoupling::DenseMatrix::Substract(self,other);
6009 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6011 return MEDCoupling::DenseMatrix::Multiply(self,other);
6014 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
6016 return MEDCoupling::DenseMatrix::Multiply(self,other);
6019 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6021 self->addEqual(other);
6022 Py_XINCREF(trueSelf);
6026 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6028 self->substractEqual(other);
6029 Py_XINCREF(trueSelf);
6033 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
6035 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
6045 __filename=os.environ.get('PYTHONSTARTUP')
6046 if __filename and os.path.isfile(__filename):
6047 execfile(__filename)