1 // Copyright (C) 2017-2019 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 (EDF R&D)
21 #ifdef WITH_DOCSTRINGS
22 %include MEDCoupling_doc.i
29 #include "MEDCouplingMemArray.hxx"
30 #include "MEDCouplingUMesh.hxx"
31 #include "MEDCouplingMappedExtrudedMesh.hxx"
32 #include "MEDCouplingCMesh.hxx"
33 #include "MEDCouplingIMesh.hxx"
34 #include "MEDCouplingMap.txx"
35 #include "MEDCouplingCurveLinearMesh.hxx"
36 #include "MEDCoupling1GTUMesh.hxx"
37 #include "MEDCouplingField.hxx"
38 #include "MEDCouplingFieldDouble.hxx"
39 #include "MEDCouplingFieldInt.hxx"
40 #include "MEDCouplingFieldFloat.hxx"
41 #include "MEDCouplingFieldTemplate.hxx"
42 #include "MEDCouplingGaussLocalization.hxx"
44 #include "MEDCouplingMultiFields.hxx"
45 #include "MEDCouplingFieldOverTime.hxx"
46 #include "MEDCouplingDefinitionTime.hxx"
47 #include "MEDCouplingFieldDiscretization.hxx"
48 #include "MEDCouplingCartesianAMRMesh.hxx"
49 #include "MEDCouplingAMRAttribute.hxx"
50 #include "MEDCouplingMatrix.hxx"
51 #include "MEDCouplingPartDefinition.hxx"
52 #include "MEDCouplingSkyLineArray.hxx"
53 #include "MEDCouplingTypemaps.i"
55 #include "InterpKernelAutoPtr.hxx"
56 #include "BoxSplittingOptions.hxx"
58 using namespace MEDCoupling;
59 using namespace INTERP_KERNEL;
63 %template(ivec) std::vector<int>;
64 %template(dvec) std::vector<double>;
65 %template(svec) std::vector<std::string>;
68 %typemap(out) MEDCoupling::MEDCouplingMesh*
70 $result=convertMesh($1,$owner);
73 %typemap(out) MEDCouplingMesh*
75 $result=convertMesh($1,$owner);
80 %typemap(out) MEDCoupling::MEDCouplingPointSet*
82 $result=convertMesh($1,$owner);
85 %typemap(out) MEDCouplingPointSet*
87 $result=convertMesh($1,$owner);
92 %typemap(out) MEDCouplingCartesianAMRPatchGen*
94 $result=convertCartesianAMRPatch($1,$owner);
99 %typemap(out) MEDCouplingCartesianAMRMeshGen*
101 $result=convertCartesianAMRMesh($1,$owner);
106 %typemap(out) MEDCouplingDataForGodFather*
108 $result=convertDataForGodFather($1,$owner);
113 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
115 $result=convertMesh($1,$owner);
118 %typemap(out) MEDCoupling1GTUMesh*
120 $result=convertMesh($1,$owner);
125 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
127 $result=convertMesh($1,$owner);
130 %typemap(out) MEDCouplingStructuredMesh*
132 $result=convertMesh($1,$owner);
137 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
139 $result=convertFieldDiscretization($1,$owner);
142 %typemap(out) MEDCouplingFieldDiscretization*
144 $result=convertFieldDiscretization($1,$owner);
149 %typemap(out) MEDCoupling::MEDCouplingField*
151 $result=convertField($1,$owner);
154 %typemap(out) MEDCouplingField*
156 $result=convertField($1,$owner);
161 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
163 $result=convertMultiFields($1,$owner);
166 %typemap(out) MEDCouplingMultiFields*
168 $result=convertMultiFields($1,$owner);
173 %typemap(out) MEDCoupling::PartDefinition*
175 $result=convertPartDefinition($1,$owner);
178 %typemap(out) PartDefinition*
180 $result=convertPartDefinition($1,$owner);
185 %init %{ import_array(); %}
188 %init %{ initializeMe(); %}
190 %feature("autodoc", "1");
191 %feature("docstring");
193 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
194 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
195 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
196 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
197 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
198 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
199 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
200 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
201 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
202 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToFloatField;
203 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
204 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
205 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
206 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
207 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
208 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
209 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
210 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
211 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
212 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
213 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
214 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
215 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
216 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
217 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
218 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
235 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
236 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
237 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
238 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
239 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
240 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
241 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
242 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
243 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
244 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
245 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
246 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
247 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
248 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
249 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
250 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
251 %newobject MEDCoupling::MEDCouplingFieldInt::New;
252 %newobject MEDCoupling::MEDCouplingFieldInt::convertToDblField;
253 %newobject MEDCoupling::MEDCouplingFieldInt::getArray;
254 %newobject MEDCoupling::MEDCouplingFieldInt::deepCopy;
255 %newobject MEDCoupling::MEDCouplingFieldInt::clone;
256 %newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh;
257 %newobject MEDCoupling::MEDCouplingFieldInt::buildSubPart;
258 %newobject MEDCoupling::MEDCouplingFieldInt::buildSubPartRange;
259 %newobject MEDCoupling::MEDCouplingFieldInt::__getitem__;
260 %newobject MEDCoupling::MEDCouplingFieldFloat::New;
261 %newobject MEDCoupling::MEDCouplingFieldFloat::convertToDblField;
262 %newobject MEDCoupling::MEDCouplingFieldFloat::getArray;
263 %newobject MEDCoupling::MEDCouplingFieldFloat::deepCopy;
264 %newobject MEDCoupling::MEDCouplingFieldFloat::clone;
265 %newobject MEDCoupling::MEDCouplingFieldFloat::cloneWithMesh;
266 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPart;
267 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPartRange;
268 %newobject MEDCoupling::MEDCouplingFieldFloat::__getitem__;
269 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
270 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
271 %newobject MEDCoupling::MEDCouplingMesh::clone;
272 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
273 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
274 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
275 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
276 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
277 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
278 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
279 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
280 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
281 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
282 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
283 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
284 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
285 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
286 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
287 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
288 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
289 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
290 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
291 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
292 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
293 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
294 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
295 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
296 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
297 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
298 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
299 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
300 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
301 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
302 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
303 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
304 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
305 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
306 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
307 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
308 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
309 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
310 %newobject MEDCoupling::MEDCouplingUMesh::New;
311 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
312 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
313 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
314 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
315 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
316 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
317 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
318 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
319 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
320 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
321 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
322 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
323 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
324 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
325 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
326 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
327 %newobject MEDCoupling::MEDCouplingUMesh::conformize3D;
328 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
329 %newobject MEDCoupling::MEDCouplingUMesh::colinearizeKeepingConform2D;
330 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
331 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
332 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
333 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
334 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
335 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
336 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
337 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
338 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
339 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
340 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
341 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
342 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
343 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
344 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
345 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
346 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
347 %newobject MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords;
348 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
349 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
350 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
351 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
352 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
353 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
354 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
355 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
356 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
357 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
358 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
359 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
360 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
361 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
362 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
363 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
364 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
365 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
366 %newobject MEDCoupling::MEDCouplingUMesh::convertDegeneratedCellsAndRemoveFlatOnes;
367 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
368 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
369 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
370 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
371 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
372 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
373 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
374 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
375 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
376 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
377 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
378 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
379 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
380 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
381 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
382 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
383 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
384 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
385 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
386 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
387 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
388 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
389 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
390 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
391 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
392 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
393 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
394 %newobject MEDCoupling::MEDCouplingCMesh::New;
395 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
396 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
397 %newobject MEDCoupling::MEDCouplingIMesh::New;
398 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
399 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
400 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
401 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
402 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
403 %newobject MEDCoupling::MEDCouplingMultiFields::New;
404 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
405 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
406 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
407 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
408 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
409 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
410 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
411 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
412 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
413 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
414 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
415 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
416 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
417 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
418 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
419 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
420 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
421 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
422 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
423 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
424 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
425 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
426 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
427 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
428 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
429 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
430 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
431 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
432 %newobject MEDCoupling::DenseMatrix::New;
433 %newobject MEDCoupling::DenseMatrix::deepCopy;
434 %newobject MEDCoupling::DenseMatrix::shallowCpy;
435 %newobject MEDCoupling::DenseMatrix::getData;
436 %newobject MEDCoupling::DenseMatrix::matVecMult;
437 %newobject MEDCoupling::DenseMatrix::MatVecMult;
438 %newobject MEDCoupling::DenseMatrix::__add__;
439 %newobject MEDCoupling::DenseMatrix::__sub__;
440 %newobject MEDCoupling::DenseMatrix::__mul__;
441 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
442 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
443 %newobject MEDCoupling::MEDCouplingSkyLineArray::BuildFromPolyhedronConn;
444 %newobject MEDCoupling::MEDCouplingSkyLineArray::getSuperIndexArray;
445 %newobject MEDCoupling::MEDCouplingSkyLineArray::getIndexArray;
446 %newobject MEDCoupling::MEDCouplingSkyLineArray::getValuesArray;
448 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
449 %feature("unref") MEDCouplingMesh "$this->decrRef();"
450 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
451 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
452 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
453 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
454 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
455 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
456 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
457 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
458 %feature("unref") MEDCouplingField "$this->decrRef();"
459 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
460 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
461 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
462 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
463 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
464 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
465 %feature("unref") MEDCouplingFieldFloat "$this->decrRef();"
466 %feature("unref") MEDCouplingFieldInt "$this->decrRef();"
467 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
468 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
469 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
470 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
471 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
472 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
473 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
474 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
475 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
476 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
477 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
478 %feature("unref") DenseMatrix "$this->decrRef();"
479 %feature("unref") MEDCouplingSkyLineArray "$this->decrRef();"
481 %rename(assign) *::operator=;
482 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
483 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
484 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
485 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
489 // ABN: Instruct SWIG that INTERP_KERNEL::Exception is an exception class and that it should inherit Exception
490 // on the Python side. Must be put BEFORE the %rename clause:
491 %exceptionclass INTERP_KERNEL::Exception;
492 %rename (InterpKernelException) INTERP_KERNEL::Exception;
494 %include "MEDCouplingRefCountObject.i"
495 %include "MEDCouplingMemArray.i"
499 {// AGY : here initialization of C++ traits in MEDCouplingDataArrayTypemaps.i for code factorization. Awful, I know, but no other solutions.
500 SWIGTITraits<double>::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble;
501 SWIGTITraits<float>::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat;
502 SWIGTITraits<int>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt;
503 SWIGTITraits<double>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple;
504 SWIGTITraits<float>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayFloatTuple;
505 SWIGTITraits<int>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayIntTuple;
509 namespace INTERP_KERNEL
512 * \class BoxSplittingOptions
513 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
515 class BoxSplittingOptions
518 BoxSplittingOptions();
520 double getEfficiencyGoal() const;
521 void setEfficiencyGoal(double efficiency);
522 double getEfficiencyThreshold() const;
523 void setEfficiencyThreshold(double efficiencyThreshold);
524 int getMinimumPatchLength() const;
525 void setMinimumPatchLength(int minPatchLength);
526 int getMaximumPatchLength() const;
527 void setMaximumPatchLength(int maxPatchLength);
528 int getMaximumNbOfCellsInPatch() const;
529 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch);
530 void copyOptions(const BoxSplittingOptions & other);
531 std::string printOptions() const;
534 std::string __str__() const
536 return self->printOptions();
542 namespace MEDCoupling
558 CONST_ON_TIME_INTERVAL = 7
559 } TypeOfTimeDiscretization;
567 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
568 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
570 } MEDCouplingMeshType;
573 class DataArrayDouble;
574 class MEDCouplingUMesh;
575 class MEDCouplingCMesh;
576 class MEDCouplingFieldDouble;
578 %extend RefCountObject
580 std::string getHiddenCppPointer() const
582 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
587 %extend MEDCouplingGaussLocalization
589 std::string __str__() const
591 return self->getStringRepr();
594 std::string __repr__() const
596 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
597 oss << self->getStringRepr();
604 class MEDCouplingMesh : public RefCountObject, public TimeLabel
607 void setName(const std::string& name);
608 std::string getName() const;
609 void setDescription(const std::string& descr);
610 std::string getDescription() const;
611 void setTime(double val, int iteration, int order);
612 void setTimeUnit(const std::string& unit);
613 std::string getTimeUnit() const;
614 virtual MEDCouplingMeshType getType() const;
615 bool isStructured() const;
616 virtual MEDCouplingMesh *deepCopy() const;
617 virtual MEDCouplingMesh *clone(bool recDeepCpy) const;
618 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const;
619 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
620 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const;
621 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other);
622 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other);
623 virtual void checkConsistencyLight() const;
624 virtual void checkConsistency(double eps=1e-12) const;
625 virtual int getNumberOfCells() const;
626 virtual int getNumberOfNodes() const;
627 virtual int getSpaceDimension() const;
628 virtual int getMeshDimension() const;
629 virtual DataArrayDouble *getCoordinatesAndOwner() const;
630 virtual DataArrayDouble *computeCellCenterOfMass() const;
631 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
632 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
633 virtual DataArrayInt *computeNbOfNodesPerCell() const;
634 virtual DataArrayInt *computeNbOfFacesPerCell() const;
635 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const;
636 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const;
637 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
638 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
639 virtual std::string simpleRepr() const;
640 virtual std::string advancedRepr() const;
641 std::string writeVTK(const std::string& fileName, bool isBinary=true) const;
642 virtual std::string getVTKFileExtension() const;
643 std::string getVTKFileNameOf(const std::string& fileName) const;
645 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const;
646 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const;
647 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const;
648 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const;
649 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const;
650 virtual MEDCouplingFieldDouble *buildOrthogonalField() const;
651 virtual MEDCouplingUMesh *buildUnstructured() const;
652 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
653 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const;
654 virtual DataArrayInt *simplexize(int policy);
655 virtual void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings);
656 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2);
657 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type);
658 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type);
659 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type);
660 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
661 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
662 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
665 std::string __str__() const
667 return self->simpleRepr();
673 double tmp0=self->getTime(tmp1,tmp2);
674 PyObject *res = PyList_New(3);
675 PyList_SetItem(res,0,SWIG_From_double(tmp0));
676 PyList_SetItem(res,1,SWIG_From_int(tmp1));
677 PyList_SetItem(res,2,SWIG_From_int(tmp2));
681 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const
683 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
684 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
690 int getCellContainingPoint(PyObject *p, double eps) const
694 DataArrayDoubleTuple *aa;
695 std::vector<double> bb;
697 int spaceDim=self->getSpaceDimension();
698 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
699 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
700 return self->getCellContainingPoint(pos,eps);
703 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const
707 DataArrayDoubleTuple *aa;
708 std::vector<double> bb;
710 int spaceDim=self->getSpaceDimension();
711 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
712 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
713 MCAuto<DataArrayInt> elts,eltsIndex;
714 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
715 PyObject *ret=PyTuple_New(2);
716 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
717 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
721 PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, int nbOfPoints, double eps) const
725 DataArrayDoubleTuple *aa;
726 std::vector<double> bb;
728 int spaceDim=self->getSpaceDimension();
729 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPointsLinearPartOnlyOnNonDynType : ";
730 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
731 MCAuto<DataArrayInt> elts,eltsIndex;
732 self->getCellsContainingPointsLinearPartOnlyOnNonDynType(pos,nbOfPoints,eps,elts,eltsIndex);
733 PyObject *ret=PyTuple_New(2);
734 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
735 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
739 PyObject *getCellsContainingPoints(PyObject *p, double eps) const
741 auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayInt>& d, MCAuto<DataArrayInt>& e) { self->getCellsContainingPoints(a,b,c,d,e); };
742 return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
745 PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, double eps) const
747 auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayInt>& d, MCAuto<DataArrayInt>& e) { self->getCellsContainingPointsLinearPartOnlyOnNonDynType(a,b,c,d,e); };
748 return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
751 PyObject *getCellsContainingPoint(PyObject *p, double eps) const
755 DataArrayDoubleTuple *aa;
756 std::vector<double> bb;
758 int spaceDim=self->getSpaceDimension();
759 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
760 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
761 std::vector<int> elts;
762 self->getCellsContainingPoint(pos,eps,elts);
763 DataArrayInt *ret=DataArrayInt::New();
764 ret->alloc((int)elts.size(),1);
765 std::copy(elts.begin(),elts.end(),ret->getPointer());
766 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
769 virtual PyObject *getReverseNodalConnectivity() const
771 MCAuto<DataArrayInt> d0=DataArrayInt::New();
772 MCAuto<DataArrayInt> d1=DataArrayInt::New();
773 self->getReverseNodalConnectivity(d0,d1);
774 PyObject *ret=PyTuple_New(2);
775 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
776 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
780 void renumberCells(PyObject *li, bool check=true)
783 int v0; std::vector<int> v1;
784 const int *ids(convertIntStarLikePyObjToCppIntStar(li,sw,sz,v0,v1));
785 self->renumberCells(ids,check);
788 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const
790 DataArrayInt *cellCor, *nodeCor;
791 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
792 PyObject *res = PyList_New(2);
793 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
794 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
798 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const
800 DataArrayInt *cellCor=0,*nodeCor=0;
801 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
802 PyObject *res = PyList_New(2);
803 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
804 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
808 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const
810 DataArrayInt *cellCor=0;
811 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
815 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const
818 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
819 if (!SWIG_IsOK(res1))
822 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
823 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
827 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
829 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
830 da2->checkAllocated();
831 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
834 PyObject *getNodeIdsOfCell(int cellId) const
836 std::vector<int> conn;
837 self->getNodeIdsOfCell(cellId,conn);
838 return convertIntArrToPyList2(conn);
841 PyObject *getCoordinatesOfNode(int nodeId) const
843 std::vector<double> coo;
844 self->getCoordinatesOfNode(nodeId,coo);
845 return convertDblArrToPyList2(coo);
848 void scale(PyObject *point, double factor)
852 DataArrayDoubleTuple *aa;
853 std::vector<double> bb;
855 int spaceDim=self->getSpaceDimension();
856 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
857 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
858 self->scale(pointPtr,factor);
861 PyObject *getBoundingBox() const
863 int spaceDim=self->getSpaceDimension();
864 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
865 self->getBoundingBox(tmp);
866 PyObject *ret=convertDblArrToPyListOfTuple<double>(tmp,2,spaceDim);
870 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const
873 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
874 PyObject *ret=PyTuple_New(2);
875 PyObject *ret0Py=ret0?Py_True:Py_False;
877 PyTuple_SetItem(ret,0,ret0Py);
878 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
882 PyObject *buildPart(PyObject *li) const
884 int szArr,sw,iTypppArr;
885 std::vector<int> stdvecTyyppArr;
886 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
887 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
888 if(sw==3)//DataArrayInt
890 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
891 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
892 std::string name=argpt->getName();
894 ret->setName(name.c_str());
896 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
899 PyObject *buildPartAndReduceNodes(PyObject *li) const
901 int szArr,sw,iTypppArr;
902 std::vector<int> stdvecTyyppArr;
904 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
905 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
906 if(sw==3)//DataArrayInt
908 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
909 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
910 std::string name=argpt->getName();
912 ret->setName(name.c_str());
915 PyObject *res = PyList_New(2);
916 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
917 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
918 PyList_SetItem(res,0,obj0);
919 PyList_SetItem(res,1,obj1);
923 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const
927 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
928 PyObject *res = PyTuple_New(2);
929 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
932 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
934 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
935 PyTuple_SetItem(res,0,obj0);
936 PyTuple_SetItem(res,1,obj1);
940 PyObject *getDistributionOfTypes() const
942 std::vector<int> vals=self->getDistributionOfTypes();
944 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
945 PyObject *ret=PyList_New((int)vals.size()/3);
946 for(int j=0;j<(int)vals.size()/3;j++)
948 PyObject *ret1=PyList_New(3);
949 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
950 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
951 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
952 PyList_SetItem(ret,j,ret1);
957 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const
959 std::vector<int> code;
960 std::vector<const DataArrayInt *> idsPerType;
961 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
962 convertPyToNewIntArr4(li,1,3,code);
963 return self->checkTypeConsistencyAndContig(code,idsPerType);
966 PyObject *splitProfilePerType(const DataArrayInt *profile, bool smartPflKiller=true) const
968 std::vector<int> code;
969 std::vector<DataArrayInt *> idsInPflPerType;
970 std::vector<DataArrayInt *> idsPerType;
971 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType,smartPflKiller);
972 PyObject *ret=PyTuple_New(3);
975 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
976 PyObject *ret0=PyList_New((int)code.size()/3);
977 for(int j=0;j<(int)code.size()/3;j++)
979 PyObject *ret00=PyList_New(3);
980 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
981 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
982 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
983 PyList_SetItem(ret0,j,ret00);
985 PyTuple_SetItem(ret,0,ret0);
987 PyObject *ret1=PyList_New(idsInPflPerType.size());
988 for(std::size_t j=0;j<idsInPflPerType.size();j++)
989 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
990 PyTuple_SetItem(ret,1,ret1);
991 int n=idsPerType.size();
992 PyObject *ret2=PyList_New(n);
994 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
995 PyTuple_SetItem(ret,2,ret2);
999 void translate(PyObject *vector)
1003 DataArrayDoubleTuple *aa;
1004 std::vector<double> bb;
1006 int spaceDim=self->getSpaceDimension();
1007 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1008 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1009 self->translate(vectorPtr);
1012 void rotate(PyObject *center, double alpha)
1014 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1017 DataArrayDoubleTuple *aa;
1018 std::vector<double> bb;
1020 int spaceDim=self->getSpaceDimension();
1021 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1022 self->rotate(centerPtr,0,alpha);
1025 void rotate(PyObject *center, PyObject *vector, double alpha)
1027 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1029 DataArrayDouble *a,*a2;
1030 DataArrayDoubleTuple *aa,*aa2;
1031 std::vector<double> bb,bb2;
1033 int spaceDim=self->getSpaceDimension();
1034 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1035 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
1036 self->rotate(centerPtr,vectorPtr,alpha);
1039 PyObject *getAllGeoTypes() const
1041 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1042 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1043 PyObject *res=PyList_New(result.size());
1044 for(int i=0;iL!=result.end(); i++, iL++)
1045 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1049 virtual PyObject *getTinySerializationInformation() const
1051 std::vector<double> a0;
1052 std::vector<int> a1;
1053 std::vector<std::string> a2;
1054 self->getTinySerializationInformation(a0,a1,a2);
1055 PyObject *ret(PyTuple_New(3));
1056 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1057 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1059 PyObject *ret2(PyList_New(sz));
1061 for(int i=0;i<sz;i++)
1062 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1064 PyTuple_SetItem(ret,2,ret2);
1068 virtual PyObject *serialize() const
1070 DataArrayInt *a0Tmp(0);
1071 DataArrayDouble *a1Tmp(0);
1072 self->serialize(a0Tmp,a1Tmp);
1073 PyObject *ret(PyTuple_New(2));
1074 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1075 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1079 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const
1081 std::vector<std::string> littleStrings;
1082 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1085 PyObject *__getstate__() const
1087 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1088 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1089 PyObject *ret(PyTuple_New(2));
1090 PyTuple_SetItem(ret,0,ret0);
1091 PyTuple_SetItem(ret,1,ret1);
1095 void __setstate__(PyObject *inp)
1097 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1098 if(!PyTuple_Check(inp))
1099 throw INTERP_KERNEL::Exception(MSG);
1100 int sz(PyTuple_Size(inp));
1102 throw INTERP_KERNEL::Exception(MSG);
1103 PyObject *elt0(PyTuple_GetItem(inp,0));
1104 PyObject *elt1(PyTuple_GetItem(inp,1));
1105 std::vector<double> a0;
1106 std::vector<int> a1;
1107 std::vector<std::string> a2;
1108 DataArrayInt *b0(0);
1109 DataArrayDouble *b1(0);
1111 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1112 throw INTERP_KERNEL::Exception(MSG);
1113 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1115 fillArrayWithPyListDbl3(a0py,tmp,a0);
1116 convertPyToNewIntArr3(a1py,a1);
1117 fillStringVector(a2py,a2);
1120 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1121 throw INTERP_KERNEL::Exception(MSG);
1122 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1124 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1125 if(!SWIG_IsOK(status))
1126 throw INTERP_KERNEL::Exception(MSG);
1127 b0=reinterpret_cast<DataArrayInt *>(argp);
1128 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1129 if(!SWIG_IsOK(status))
1130 throw INTERP_KERNEL::Exception(MSG);
1131 b1=reinterpret_cast<DataArrayDouble *>(argp);
1133 // useless here to call resizeForUnserialization because arrays are well resized.
1134 self->unserialization(a0,a1,b0,b1,a2);
1137 static MEDCouplingMesh *MergeMeshes(PyObject *li)
1139 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1140 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1141 return MEDCouplingMesh::MergeMeshes(tmp);
1147 //== MEDCouplingMesh End
1149 %include "NormalizedGeometricTypes"
1150 %include "MEDCouplingNatureOfFieldEnum"
1152 namespace MEDCoupling
1154 class MEDCouplingNatureOfField
1157 static const char *GetRepr(NatureOfField nat);
1158 static std::string GetReprNoThrow(NatureOfField nat);
1159 static std::string GetAllPossibilitiesStr();
1163 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1164 // include "MEDCouplingTimeDiscretization.i"
1166 namespace MEDCoupling
1168 class MEDCouplingGaussLocalization
1171 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1172 const std::vector<double>& gsCoo, const std::vector<double>& w);
1173 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ);
1174 INTERP_KERNEL::NormalizedCellType getType() const;
1175 void setType(INTERP_KERNEL::NormalizedCellType typ);
1176 int getNumberOfGaussPt() const;
1177 int getDimension() const;
1178 int getNumberOfPtsInRefCell() const;
1179 std::string getStringRepr() const;
1180 void checkConsistencyLight() const;
1181 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const;
1183 const std::vector<double>& getRefCoords() const;
1184 double getRefCoord(int ptIdInCell, int comp) const;
1185 const std::vector<double>& getGaussCoords() const;
1186 double getGaussCoord(int gaussPtIdInCell, int comp) const;
1187 const std::vector<double>& getWeights() const;
1188 double getWeight(int gaussPtIdInCell, double newVal) const;
1189 void setRefCoord(int ptIdInCell, int comp, double newVal);
1190 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal);
1191 void setWeight(int gaussPtIdInCell, double newVal);
1192 void setRefCoords(const std::vector<double>& refCoo);
1193 void setGaussCoords(const std::vector<double>& gsCoo);
1194 void setWeights(const std::vector<double>& w);
1196 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1200 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const
1202 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1206 MEDCouplingUMesh *buildRefCell() const
1208 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1214 class MEDCouplingSkyLineArray
1217 static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayInt* c, const DataArrayInt* cI );
1219 void set( DataArrayInt* index, DataArrayInt* value );
1220 void set3( DataArrayInt* superIndex, DataArrayInt* index, DataArrayInt* value );
1222 int getSuperNumberOf() const;
1223 int getNumberOf() const;
1224 int getLength() const;
1226 void deletePack(const int i, const int j);
1228 void deleteSimplePack(const int i);
1229 void deleteSimplePacks(const DataArrayInt* idx);
1233 MEDCouplingSkyLineArray()
1235 return MEDCouplingSkyLineArray::New();
1238 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value)
1240 return MEDCouplingSkyLineArray::New(index, value);
1243 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value )
1245 return MEDCouplingSkyLineArray::New(index, value);
1248 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other )
1250 return MEDCouplingSkyLineArray::New(other);
1253 std::string __str__() const
1255 return self->simpleRepr();
1258 DataArrayInt *getSuperIndexArray() const
1260 DataArrayInt *ret(self->getSuperIndexArray());
1266 DataArrayInt *getIndexArray() const
1268 DataArrayInt *ret(self->getIndexArray());
1274 DataArrayInt *getValuesArray() const
1276 DataArrayInt *ret(self->getValuesArray());
1282 PyObject *getSimplePackSafe(int absolutePackId) const
1284 std::vector<int> ret;
1285 self->getSimplePackSafe(absolutePackId,ret);
1286 return convertIntArrToPyList2(ret);
1289 PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const
1291 std::vector<int> vpack, vspIdx, out;
1293 convertPyToNewIntArr3(superPackIndices,vspIdx);
1294 convertPyToNewIntArr3(pack,vpack);
1296 self->findPackIds(vspIdx, vpack.data(), vpack.data()+vpack.size(), out);
1297 return convertIntArrToPyList2(out);
1300 void pushBackPack(const int i, PyObject *pack)
1302 std::vector<int> vpack;
1303 convertPyToNewIntArr3(pack,vpack);
1304 self->pushBackPack(i,vpack.data(), vpack.data()+vpack.size());
1307 void replaceSimplePack(const int idx, PyObject *pack)
1309 std::vector<int> vpack;
1310 convertPyToNewIntArr3(pack,vpack);
1311 self->replaceSimplePack(idx, vpack.data(), vpack.data()+vpack.size());
1314 void replaceSimplePacks(const DataArrayInt* idx, PyObject *listePacks)
1316 std::vector<const DataArrayInt*> packs;
1317 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt*>(listePacks,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",packs);
1318 self->replaceSimplePacks(idx, packs);
1321 void replacePack(const int superIdx, const int idx, PyObject *pack)
1323 std::vector<int> vpack;
1324 convertPyToNewIntArr3(pack,vpack);
1325 self->replacePack(superIdx, idx, vpack.data(), vpack.data()+vpack.size());
1328 PyObject *convertToPolyhedronConn() const
1330 MCAuto<DataArrayInt> d0=DataArrayInt::New();
1331 MCAuto<DataArrayInt> d1=DataArrayInt::New();
1332 self->convertToPolyhedronConn(d0,d1);
1333 PyObject *ret=PyTuple_New(2);
1334 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1335 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1342 %include "MEDCouplingFieldDiscretization.i"
1344 //== MEDCouplingPointSet
1346 namespace MEDCoupling
1348 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1351 void setCoords(const DataArrayDouble *coords);
1352 DataArrayDouble *getCoordinatesAndOwner() const;
1353 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const;
1355 double getCaracteristicDimension() const;
1356 void recenterForMaxPrecision(double eps);
1357 void changeSpaceDimension(int newSpaceDim, double dftVal=0.);
1358 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon);
1359 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other);
1360 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const;
1361 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon);
1362 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2);
1363 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type);
1364 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps);
1365 virtual DataArrayInt *computeFetchedNodeIds() const;
1366 virtual int getNumberOfNodesInCell(int cellId) const;
1367 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const;
1368 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps);
1369 virtual DataArrayInt *zipCoordsTraducer();
1370 virtual DataArrayInt *findBoundaryNodes() const;
1371 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0);
1372 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const;
1373 virtual void checkFullyDefined() const;
1374 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const;
1375 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const;
1376 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const;
1377 virtual void renumberNodesWithOffsetInConn(int offset);
1378 virtual bool areAllNodesFetched() const;
1379 virtual MEDCouplingFieldDouble *computeDiameterField() const;
1380 virtual void invertOrientationOfAllCells();
1383 std::string __str__() const
1385 return self->simpleRepr();
1388 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const
1391 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1392 PyObject *res = PyList_New(2);
1393 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1394 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1398 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const
1400 DataArrayInt *comm, *commIndex;
1401 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1402 PyObject *res = PyList_New(2);
1403 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1404 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1408 PyObject *getCoords()
1410 DataArrayDouble *ret1=self->getCoords();
1413 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1416 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const
1418 int szArr,sw,iTypppArr;
1419 std::vector<int> stdvecTyyppArr;
1420 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1421 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1422 if(sw==3)//DataArrayInt
1424 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1425 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1426 std::string name=argpt->getName();
1428 ret->setName(name.c_str());
1430 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1433 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const
1435 int szArr,sw,iTypppArr;
1436 std::vector<int> stdvecTyyppArr;
1437 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1438 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1439 if(sw==3)//DataArrayInt
1441 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1442 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1443 std::string name=argpt->getName();
1445 ret->setName(name.c_str());
1447 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1450 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const
1452 int szArr,sw,iTypppArr;
1453 std::vector<int> stdvecTyyppArr;
1454 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1455 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1456 if(sw==3)//DataArrayInt
1458 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1459 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1460 std::string name=argpt->getName();
1462 ret->setName(name.c_str());
1464 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1467 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const
1469 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1470 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1473 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const
1475 int szArr,sw,iTypppArr;
1476 std::vector<int> stdvecTyyppArr;
1477 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1478 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1479 if(sw==3)//DataArrayInt
1481 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1482 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1483 std::string name=argpt->getName();
1485 ret->setName(name.c_str());
1487 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1490 void renumberNodes(PyObject *li, int newNbOfNodes)
1492 int szArr,sw,iTypppArr;
1493 std::vector<int> stdvecTyyppArr;
1494 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1495 self->renumberNodes(tmp,newNbOfNodes);
1498 void renumberNodesCenter(PyObject *li, int newNbOfNodes)
1500 int szArr,sw,iTypppArr;
1501 std::vector<int> stdvecTyyppArr;
1502 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1503 self->renumberNodesCenter(tmp,newNbOfNodes);
1506 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const
1508 int spaceDim=self->getSpaceDimension();
1510 DataArrayDouble *a,*a2;
1511 DataArrayDoubleTuple *aa,*aa2;
1512 std::vector<double> bb,bb2;
1514 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st parameter for point.";
1515 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd parameter for vector.";
1516 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1517 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1518 std::vector<int> nodes;
1519 self->findNodesOnLine(p,v,eps,nodes);
1520 DataArrayInt *ret=DataArrayInt::New();
1521 ret->alloc((int)nodes.size(),1);
1522 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1523 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1525 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const
1527 int spaceDim=self->getSpaceDimension();
1529 DataArrayDouble *a,*a2;
1530 DataArrayDoubleTuple *aa,*aa2;
1531 std::vector<double> bb,bb2;
1533 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st parameter for point.";
1534 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd parameter for vector.";
1535 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1536 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1537 std::vector<int> nodes;
1538 self->findNodesOnPlane(p,v,eps,nodes);
1539 DataArrayInt *ret=DataArrayInt::New();
1540 ret->alloc((int)nodes.size(),1);
1541 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1542 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1545 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const
1549 DataArrayDoubleTuple *aa;
1550 std::vector<double> bb;
1552 int spaceDim=self->getSpaceDimension();
1553 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1554 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1555 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1556 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1559 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const
1561 DataArrayInt *c=0,*cI=0;
1565 DataArrayDoubleTuple *aa;
1566 std::vector<double> bb;
1568 int spaceDim=self->getSpaceDimension();
1569 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1570 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1571 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1572 PyObject *ret=PyTuple_New(2);
1573 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1574 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1578 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const
1580 DataArrayInt *c=0,*cI=0;
1581 int spaceDim=self->getSpaceDimension();
1584 DataArrayDoubleTuple *aa;
1585 std::vector<double> bb;
1588 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1589 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1591 PyObject *ret=PyTuple_New(2);
1592 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1593 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1597 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const
1601 DataArrayDoubleTuple *aa;
1602 std::vector<double> bb;
1604 int spaceDim=self->getSpaceDimension();
1605 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1606 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1608 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1609 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1612 void duplicateNodesInCoords(PyObject *li)
1616 std::vector<int> multiVal;
1617 std::pair<int, std::pair<int,int> > slic;
1618 MEDCoupling::DataArrayInt *daIntTyypp=0;
1619 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1623 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1625 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1627 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1629 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1633 virtual PyObject *findCommonCells(int compType, int startCellId=0) const
1635 DataArrayInt *v0(nullptr),*v1(nullptr);
1636 self->findCommonCells(compType,startCellId,v0,v1);
1637 PyObject *res = PyList_New(2);
1638 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1639 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1644 virtual void renumberNodesInConn(PyObject *li)
1648 int res1(SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__MapII, 0 | 0 ));
1651 MapII *da2(reinterpret_cast<MapII *>(da));
1652 self->renumberNodesInConn(da2->data());
1656 int res1(SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 ));
1657 if (!SWIG_IsOK(res1))
1660 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1661 self->renumberNodesInConn(tmp);
1665 DataArrayInt *da2(reinterpret_cast< DataArrayInt * >(da));
1667 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1668 da2->checkAllocated();
1669 self->renumberNodesInConn(da2->getConstPointer());
1673 virtual PyObject *getNodeIdsInUse() const
1676 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1677 PyObject *ret=PyTuple_New(2);
1678 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1679 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1683 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1685 DataArrayInt *ret(nullptr);
1687 int szArr,sw,iTypppArr;
1688 std::vector<int> stdvecTyyppArr;
1689 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1690 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1694 virtual PyObject *mergeNodes(double precision)
1698 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1699 PyObject *res = PyList_New(3);
1700 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1701 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1702 PyList_SetItem(res,2,SWIG_From_int(ret2));
1706 virtual PyObject *mergeNodesCenter(double precision)
1710 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1711 PyObject *res = PyList_New(3);
1712 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1713 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1714 PyList_SetItem(res,2,SWIG_From_int(ret2));
1718 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const
1721 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1722 if (!SWIG_IsOK(res1))
1725 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1726 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1730 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1732 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1733 da2->checkAllocated();
1734 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1738 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI)
1742 std::vector<int> multiVal;
1743 std::pair<int, std::pair<int,int> > slic;
1744 MEDCoupling::DataArrayInt *daIntTyypp=0;
1745 int nbc=self->getNumberOfCells();
1746 convertIntStarOrSliceLikePyObjToCpp(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1753 std::ostringstream oss;
1754 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1755 throw INTERP_KERNEL::Exception(oss.str().c_str());
1758 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1763 int tmp=nbc+singleVal;
1764 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1768 std::ostringstream oss;
1769 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1770 throw INTERP_KERNEL::Exception(oss.str().c_str());
1776 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1780 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1785 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1786 daIntTyypp->checkAllocated();
1787 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1790 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1794 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords)
1797 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1798 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1799 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1800 for(int i=0;i<sz;i++)
1801 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1804 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords)
1807 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1809 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1810 std::vector<double> val3;
1811 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1812 "Rotate2DAlg",2,true,nbNodes);
1814 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1815 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1818 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords)
1821 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1822 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1823 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1824 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1825 for(int i=0;i<sz;i++)
1826 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1829 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords)
1832 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1834 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1835 std::vector<double> val3;
1836 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1837 "Rotate3DAlg",3,true,nbNodes);
1839 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1840 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1841 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1846 //== MEDCouplingPointSet End
1848 class MEDCouplingUMeshCell
1851 INTERP_KERNEL::NormalizedCellType getType() const;
1854 std::string __str__() const
1856 return self->repr();
1859 PyObject *getAllConn() const
1862 const int *r=self->getAllConn(ret2);
1863 PyObject *ret=PyTuple_New(ret2);
1864 for(int i=0;i<ret2;i++)
1865 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1871 class MEDCouplingUMeshCellIterator
1878 MEDCouplingUMeshCell *ret=self->nextt();
1880 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1883 PyErr_SetString(PyExc_StopIteration,"No more data.");
1890 class MEDCouplingUMeshCellByTypeIterator
1893 ~MEDCouplingUMeshCellByTypeIterator();
1898 MEDCouplingUMeshCellEntry *ret=self->nextt();
1900 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1903 PyErr_SetString(PyExc_StopIteration,"No more data.");
1910 class MEDCouplingUMeshCellByTypeEntry
1913 ~MEDCouplingUMeshCellByTypeEntry();
1916 MEDCouplingUMeshCellByTypeIterator *__iter__()
1918 return self->iterator();
1923 class MEDCouplingUMeshCellEntry
1926 INTERP_KERNEL::NormalizedCellType getType() const;
1927 int getNumberOfElems() const;
1930 MEDCouplingUMeshCellIterator *__iter__()
1932 return self->iterator();
1937 //== MEDCouplingUMesh
1939 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1942 static MEDCouplingUMesh *New();
1943 static MEDCouplingUMesh *New(const char *meshName, int meshDim);
1944 void checkConsistencyLight() const;
1945 void setMeshDimension(int meshDim);
1946 void allocateCells(int nbOfCells=0);
1947 void finishInsertingCells();
1948 MEDCouplingUMeshCellByTypeEntry *cellsByType();
1949 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true);
1950 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
1951 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis);
1952 int getNodalConnectivityArrayLen() const;
1953 void computeTypes();
1954 std::string reprConnectivityOfThis() const;
1955 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const;
1957 DataArrayInt *conformize2D(double eps);
1958 DataArrayInt *conformize3D(double eps);
1959 DataArrayInt *colinearize2D(double eps);
1960 DataArrayInt *colinearizeKeepingConform2D(double eps);
1961 void shiftNodeNumbersInConn(int delta);
1962 std::vector<bool> getQuadraticStatus() const;
1963 DataArrayInt *findCellIdsOnBoundary() const;
1964 MEDCouplingUMesh *computeSkin() const;
1965 bool checkConsecutiveCellTypes() const;
1966 bool checkConsecutiveCellTypesForMEDFileFrmt() const;
1967 DataArrayInt *rearrange2ConsecutiveCellTypes();
1968 DataArrayInt *sortCellsInMEDFileFrmt();
1969 DataArrayInt *getRenumArrForMEDFileFrmt() const;
1970 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const;
1971 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const;
1972 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const;
1973 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const;
1974 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const;
1975 void orientCorrectlyPolyhedrons();
1976 bool isPresenceOfQuadratic() const;
1977 bool isFullyQuadratic() const;
1978 MEDCouplingFieldDouble *buildDirectionVectorField() const;
1979 bool isContiguous1D() const;
1980 void tessellate2D(double eps);
1981 void convertQuadraticCellsToLinear();
1982 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0);
1983 void convertDegeneratedCells();
1984 DataArrayInt *convertDegeneratedCellsAndRemoveFlatOnes();
1985 bool removeDegenerated1DCells();
1986 bool areOnlySimplexCells() const;
1987 MEDCouplingFieldDouble *getEdgeRatioField() const;
1988 MEDCouplingFieldDouble *getAspectRatioField() const;
1989 MEDCouplingFieldDouble *getWarpField() const;
1990 MEDCouplingFieldDouble *getSkewField() const;
1991 DataArrayDouble *computePlaneEquationOf3DFaces() const;
1992 DataArrayInt *convexEnvelop2D();
1993 std::string cppRepr() const;
1994 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells();
1995 DataArrayInt *findAndCorrectBadOriented3DCells();
1996 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const;
1997 MEDCouplingSkyLineArray *generateGraph() const;
1998 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const;
1999 DataArrayInt *buildUnionOf2DMesh() const;
2000 DataArrayInt *buildUnionOf3DMesh() const;
2001 DataArrayInt *orderConsecutiveCells1D() const;
2002 DataArrayDouble *getBoundingBoxForBBTreeFast() const;
2003 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const;
2004 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const;
2005 void changeOrientationOfCells();
2006 DataArrayDouble *computeCellCenterOfMassWithPrecision(double eps);
2007 int split2DCells(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *subNodesInSeg, const DataArrayInt *subNodesInSegI, const DataArrayInt *midOpt=0, const DataArrayInt *midOptI=0);
2008 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da);
2009 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
2010 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
2011 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn);
2012 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code);
2016 return MEDCouplingUMesh::New();
2019 MEDCouplingUMesh(const char *meshName, int meshDim)
2021 return MEDCouplingUMesh::New(meshName,meshDim);
2024 std::string __str__() const
2026 return self->simpleRepr();
2029 std::string __repr__() const
2031 std::ostringstream oss;
2032 self->reprQuickOverview(oss);
2036 MEDCouplingUMeshCellIterator *__iter__()
2038 return self->cellIterator();
2041 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da)
2043 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
2047 PyObject *getAllGeoTypesSorted() const
2049 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
2050 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2051 PyObject *res=PyList_New(result.size());
2052 for(int i=0;iL!=result.end(); i++, iL++)
2053 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2057 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
2061 std::vector<int> multiVal;
2062 std::pair<int, std::pair<int,int> > slic;
2063 MEDCoupling::DataArrayInt *daIntTyypp=0;
2064 int nbc=self->getNumberOfCells();
2065 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2072 std::ostringstream oss;
2073 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2074 throw INTERP_KERNEL::Exception(oss.str().c_str());
2078 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2085 int tmp=nbc+singleVal;
2086 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2091 std::ostringstream oss;
2092 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2093 throw INTERP_KERNEL::Exception(oss.str().c_str());
2099 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2105 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2106 daIntTyypp->checkAllocated();
2107 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2111 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
2115 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
2119 std::vector<int> multiVal;
2120 std::pair<int, std::pair<int,int> > slic;
2121 MEDCoupling::DataArrayInt *daIntTyypp=0;
2122 int nbc=self->getNumberOfCells();
2123 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2130 std::ostringstream oss;
2131 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2132 throw INTERP_KERNEL::Exception(oss.str().c_str());
2136 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2143 int tmp=nbc+singleVal;
2144 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2149 std::ostringstream oss;
2150 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2151 throw INTERP_KERNEL::Exception(oss.str().c_str());
2157 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2162 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2168 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2169 daIntTyypp->checkAllocated();
2170 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2174 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2178 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li)
2180 int szArr,sw,iTypppArr;
2181 std::vector<int> stdvecTyyppArr;
2182 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2185 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2186 throw INTERP_KERNEL::Exception(oss.str().c_str());
2188 self->insertNextCell(type,size,tmp);
2191 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li)
2193 int szArr,sw,iTypppArr;
2194 std::vector<int> stdvecTyyppArr;
2195 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2196 self->insertNextCell(type,szArr,tmp);
2199 DataArrayInt *getNodalConnectivity()
2201 DataArrayInt *ret=self->getNodalConnectivity();
2206 DataArrayInt *getNodalConnectivityIndex()
2208 DataArrayInt *ret=self->getNodalConnectivityIndex();
2214 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1)
2216 int szArr,sw,iTypppArr;
2217 std::vector<int> stdvecTyyppArr;
2218 const int *seedPtr=convertIntStarLikePyObjToCppIntStar(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2219 int nbOfDepthPeelingPerformed=0;
2220 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2221 PyObject *res=PyTuple_New(2);
2222 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2223 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2227 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI)
2229 DataArrayInt *v0=0,*v1=0;
2230 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2231 PyObject *res = PyList_New(2);
2232 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2233 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2237 PyObject *distanceToPoint(PyObject *point) const
2241 DataArrayDoubleTuple *aa;
2242 std::vector<double> bb;
2244 int nbOfCompo=self->getSpaceDimension();
2245 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2248 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2249 PyObject *ret=PyTuple_New(2);
2250 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2251 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2255 PyObject *distanceToPoints(const DataArrayDouble *pts) const
2257 DataArrayInt *ret1=0;
2258 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2259 PyObject *ret=PyTuple_New(2);
2260 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2261 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2265 PyObject *tetrahedrize(int policy)
2268 DataArrayInt *ret1(0);
2269 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2270 PyObject *ret=PyTuple_New(3);
2271 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2272 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2273 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2277 PyObject *checkButterflyCells(double eps=1e-12)
2279 std::vector<int> cells;
2280 self->checkButterflyCells(cells,eps);
2281 DataArrayInt *ret=DataArrayInt::New();
2282 ret->alloc((int)cells.size(),1);
2283 std::copy(cells.begin(),cells.end(),ret->getPointer());
2284 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2287 PyObject *splitByType() const
2289 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2291 PyObject *ret = PyList_New(sz);
2292 for(int i=0;i<sz;i++)
2293 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2297 PyObject *partitionBySpreadZone() const
2299 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2300 int sz=retCpp.size();
2301 PyObject *ret=PyList_New(sz);
2302 for(int i=0;i<sz;i++)
2303 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2307 static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn)
2309 std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2310 int sz=retCpp.size();
2311 PyObject *ret=PyList_New(sz);
2312 for(int i=0;i<sz;i++)
2313 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2317 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const
2320 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2321 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2322 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2325 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const
2328 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2329 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2333 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const
2336 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2337 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2341 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
2343 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2344 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2345 PyObject *ret=PyTuple_New(3);
2346 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2347 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2348 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2352 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
2354 DataArrayInt *tmp0=0,*tmp1=0;
2355 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2356 PyObject *ret=PyTuple_New(2);
2357 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2358 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2362 void duplicateNodes(PyObject *li)
2366 std::vector<int> multiVal;
2367 std::pair<int, std::pair<int,int> > slic;
2368 MEDCoupling::DataArrayInt *daIntTyypp=0;
2369 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2373 return self->duplicateNodes(&singleVal,&singleVal+1);
2375 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2377 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2379 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2383 void duplicateNodesInConn(PyObject *li, int offset)
2387 std::vector<int> multiVal;
2388 std::pair<int, std::pair<int,int> > slic;
2389 MEDCoupling::DataArrayInt *daIntTyypp=0;
2390 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2394 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2396 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2398 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2400 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2404 void attractSeg3MidPtsAroundNodes(double ratio, PyObject *nodeIds)
2406 int szArr,sw,iTypppArr;
2407 std::vector<int> stdvecTyyppArr;
2408 const int *nodeIdsPtr(convertIntStarLikePyObjToCppIntStar(nodeIds,sw,szArr,iTypppArr,stdvecTyyppArr));
2409 self->attractSeg3MidPtsAroundNodes(ratio,nodeIdsPtr,nodeIdsPtr+szArr);
2412 PyObject *getLevArrPerCellTypes(PyObject *li) const
2415 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2416 DataArrayInt *tmp0,*tmp1=0;
2417 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2418 PyObject *ret=PyTuple_New(2);
2419 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2420 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2424 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const
2426 DataArrayInt *ret0=0,*ret1=0;
2427 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2428 PyObject *ret=PyTuple_New(2);
2429 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2430 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2434 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms)
2436 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2437 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2438 DataArrayInt *ret1=0,*ret2=0;
2439 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2440 PyObject *ret=PyTuple_New(3);
2441 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2442 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2443 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2447 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms)
2449 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2450 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2451 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2452 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2455 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType)
2458 std::vector<const MEDCouplingUMesh *> meshes;
2459 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2460 std::vector<DataArrayInt *> corr;
2461 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2463 PyObject *ret1=PyList_New(sz);
2464 for(int i=0;i<sz;i++)
2465 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2466 PyObject *ret=PyList_New(2);
2467 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2468 PyList_SetItem(ret,1,ret1);
2472 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms)
2474 std::vector<MEDCouplingUMesh *> meshes;
2475 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2476 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2479 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps)
2481 std::vector<MEDCouplingUMesh *> meshes;
2482 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2483 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2486 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const
2490 DataArrayDoubleTuple *aa;
2491 std::vector<double> bb;
2493 int spaceDim=self->getSpaceDimension();
2494 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2495 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2497 std::vector<int> cells;
2498 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2499 DataArrayInt *ret=DataArrayInt::New();
2500 ret->alloc((int)cells.size(),1);
2501 std::copy(cells.begin(),cells.end(),ret->getPointer());
2502 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2505 void orientCorrectly2DCells(PyObject *vec, bool polyOnly)
2509 DataArrayDoubleTuple *aa;
2510 std::vector<double> bb;
2512 int spaceDim=self->getSpaceDimension();
2513 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2514 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2515 self->orientCorrectly2DCells(v,polyOnly);
2518 PyObject *arePolyhedronsNotCorrectlyOriented() const
2520 std::vector<int> cells;
2521 self->arePolyhedronsNotCorrectlyOriented(cells);
2522 DataArrayInt *ret=DataArrayInt::New();
2523 ret->alloc((int)cells.size(),1);
2524 std::copy(cells.begin(),cells.end(),ret->getPointer());
2525 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2528 PyObject *getFastAveragePlaneOfThis() const
2532 self->getFastAveragePlaneOfThis(vec,pos);
2534 std::copy(vec,vec+3,vals);
2535 std::copy(pos,pos+3,vals+3);
2536 return convertDblArrToPyListOfTuple<double>(vals,3,2);
2539 static MEDCouplingUMesh *MergeUMeshes(PyObject *li)
2541 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2542 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2543 return MEDCouplingUMesh::MergeUMeshes(tmp);
2546 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const
2549 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2550 PyObject *ret=PyTuple_New(2);
2551 PyObject *ret0Py=ret0?Py_True:Py_False;
2553 PyTuple_SetItem(ret,0,ret0Py);
2554 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2558 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const
2561 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2562 PyObject *ret=PyTuple_New(2);
2563 PyObject *ret0Py=ret0?Py_True:Py_False;
2565 PyTuple_SetItem(ret,0,ret0Py);
2566 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2570 PyObject *explode3DMeshTo1D() const
2572 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2573 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2574 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2575 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2576 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2577 PyObject *ret=PyTuple_New(5);
2578 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2579 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2580 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2581 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2582 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2586 PyObject *explodeIntoEdges() const
2588 MCAuto<DataArrayInt> desc,descIndex,revDesc,revDescIndx;
2589 MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2590 PyObject *ret=PyTuple_New(5);
2591 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2592 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2593 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2594 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2595 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2599 PyObject *explodeMeshIntoMicroEdges() const
2601 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2602 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2603 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2604 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2605 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2606 PyObject *ret=PyTuple_New(5);
2607 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2608 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2609 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2610 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2611 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2615 PyObject *buildDescendingConnectivity() const
2617 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2618 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2619 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2620 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2621 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2622 PyObject *ret=PyTuple_New(5);
2623 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2624 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2625 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2626 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2627 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2631 PyObject *buildDescendingConnectivity2() const
2633 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2634 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2635 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2636 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2637 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2638 PyObject *ret=PyTuple_New(5);
2639 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2640 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2641 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2642 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2643 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2647 PyObject *computeNeighborsOfCells() const
2649 DataArrayInt *neighbors=0,*neighborsIdx=0;
2650 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2651 PyObject *ret=PyTuple_New(2);
2652 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2653 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2657 PyObject *computeNeighborsOfNodes() const
2659 DataArrayInt *neighbors=0,*neighborsIdx=0;
2660 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2661 PyObject *ret=PyTuple_New(2);
2662 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2663 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2667 PyObject *computeEnlargedNeighborsOfNodes() const
2669 MCAuto<DataArrayInt> neighbors,neighborsIdx;
2670 self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2671 PyObject *ret=PyTuple_New(2);
2672 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2673 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2677 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const
2679 MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
2680 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2681 PyObject *ret=PyTuple_New(2);
2682 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2683 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2687 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI)
2689 DataArrayInt *neighbors=0,*neighborsIdx=0;
2690 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2691 PyObject *ret=PyTuple_New(2);
2692 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2693 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2697 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2699 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2700 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2701 DataArrayInt *d2,*d3,*d4,*dd5;
2702 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2703 PyObject *ret=PyTuple_New(7);
2704 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2705 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2706 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2707 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2708 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2709 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2710 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2714 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const
2717 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2718 da->checkAllocated();
2719 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2722 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const
2725 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2726 da->checkAllocated();
2727 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2730 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const
2733 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2734 da->checkAllocated();
2735 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2738 PyObject *getTypesOfPart(DataArrayInt *da) const
2741 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2742 da->checkAllocated();
2743 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2744 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2745 PyObject *res = PyList_New(result.size());
2746 for (int i=0;iL!=result.end(); i++, iL++)
2747 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2751 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const
2754 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2755 da->checkAllocated();
2756 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2757 ret->setName(da->getName().c_str());
2761 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps)
2763 DataArrayInt *cellNb1=0,*cellNb2=0;
2764 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2765 PyObject *ret=PyTuple_New(3);
2766 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2767 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2768 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2772 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps)
2774 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2775 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2776 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2777 PyObject *ret(PyTuple_New(4));
2778 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2779 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2780 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2781 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2785 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const
2787 int spaceDim=self->getSpaceDimension();
2789 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2791 DataArrayDouble *a,*a2;
2792 DataArrayDoubleTuple *aa,*aa2;
2793 std::vector<double> bb,bb2;
2795 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st parameter for origin.";
2796 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd parameter for vector.";
2797 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2798 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2800 DataArrayInt *cellIds=0;
2801 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2802 PyObject *ret=PyTuple_New(2);
2803 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2804 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2808 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const
2810 int spaceDim=self->getSpaceDimension();
2812 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2814 DataArrayDouble *a,*a2;
2815 DataArrayDoubleTuple *aa,*aa2;
2816 std::vector<double> bb,bb2;
2818 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st parameter for origin.";
2819 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd parameter for vector.";
2820 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2821 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2823 DataArrayInt *cellIds=0;
2824 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2825 PyObject *ret=PyTuple_New(2);
2826 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2827 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2831 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const
2834 DataArrayDouble *a,*a2;
2835 DataArrayDoubleTuple *aa,*aa2;
2836 std::vector<double> bb,bb2;
2838 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st parameter for origin.";
2839 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd parameter for vector.";
2840 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2841 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2842 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2846 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const
2848 int spaceDim=self->getSpaceDimension();
2850 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2852 DataArrayDouble *a,*a2;
2853 DataArrayDoubleTuple *aa,*aa2;
2854 std::vector<double> bb,bb2;
2856 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st parameter for origin.";
2857 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd parameter for vector.";
2858 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2859 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2860 return self->getCellIdsCrossingPlane(orig,vect,eps);
2863 void convertToPolyTypes(PyObject *li)
2867 std::vector<int> pos2;
2868 DataArrayInt *pos3=0;
2869 DataArrayIntTuple *pos4=0;
2870 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2875 self->convertToPolyTypes(&pos1,&pos1+1);
2882 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2887 self->convertToPolyTypes(pos3->begin(),pos3->end());
2891 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2895 void convertAllToPoly();
2896 void convertExtrudedPolyhedra();
2898 void simplifyPolyhedra(double eps);
2899 MEDCouplingUMesh *buildSpreadZonesWithPoly() const;
2900 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy);
2903 //== MEDCouplingUMesh End
2905 //== MEDCouplingMappedExtrudedMesh
2907 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
2910 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
2911 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D);
2912 MEDCouplingUMesh *build3DUnstructuredMesh() const;
2913 int get2DCellIdForExtrusion() const;
2915 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId)
2917 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2920 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D)
2922 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
2925 MEDCouplingMappedExtrudedMesh()
2927 return MEDCouplingMappedExtrudedMesh::New();
2930 std::string __str__() const
2932 return self->simpleRepr();
2935 std::string __repr__() const
2937 std::ostringstream oss;
2938 self->reprQuickOverview(oss);
2942 PyObject *getMesh2D() const
2944 MEDCouplingUMesh *ret=self->getMesh2D();
2947 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2949 PyObject *getMesh1D() const
2951 MEDCouplingUMesh *ret=self->getMesh1D();
2954 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2956 PyObject *getMesh3DIds() const
2958 DataArrayInt *ret=self->getMesh3DIds();
2961 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2966 //== MEDCouplingMappedExtrudedMesh End
2968 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
2971 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
2972 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m);
2973 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const;
2974 int getNodalConnectivityLength() const;
2975 virtual void allocateCells(int nbOfCells=0);
2976 virtual void checkConsistencyOfConnectivity() const;
2979 virtual void insertNextCell(PyObject *li)
2981 int szArr,sw,iTypppArr;
2982 std::vector<int> stdvecTyyppArr;
2983 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2984 self->insertNextCell(tmp,tmp+szArr);
2987 virtual DataArrayInt *getNodalConnectivity() const
2989 DataArrayInt *ret=self->getNodalConnectivity();
2990 if(ret) ret->incrRef();
2994 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li)
2996 std::vector< const MEDCoupling1GTUMesh *> parts;
2997 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2998 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3003 //== MEDCoupling1SGTUMesh
3005 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3008 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3009 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m);
3010 void setNodalConnectivity(DataArrayInt *nodalConn);
3011 int getNumberOfNodesPerCell() const;
3012 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2);
3013 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
3014 MEDCoupling1GTUMesh *computeDualMesh() const;
3015 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const;
3016 DataArrayInt *sortHexa8EachOther();
3019 MEDCoupling1SGTUMesh()
3021 return MEDCoupling1SGTUMesh::New();
3024 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
3026 return MEDCoupling1SGTUMesh::New(name,type);
3029 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m)
3031 return MEDCoupling1SGTUMesh::New(m);
3034 std::string __str__() const
3036 return self->simpleRepr();
3039 std::string __repr__() const
3041 std::ostringstream oss;
3042 self->reprQuickOverview(oss);
3046 PyObject *structurizeMe(double eps=1e-12) const
3048 DataArrayInt *cellPerm(0),*nodePerm(0);
3049 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3050 PyObject *ret(PyTuple_New(3));
3051 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3052 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3053 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3057 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li)
3059 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3060 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3061 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3064 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li)
3066 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3067 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3068 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3073 //== MEDCoupling1SGTUMesh End
3075 //== MEDCoupling1DGTUMesh
3077 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3080 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3081 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m);
3082 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex);
3083 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
3084 bool isPacked() const;
3087 MEDCoupling1DGTUMesh()
3089 return MEDCoupling1DGTUMesh::New();
3091 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
3093 return MEDCoupling1DGTUMesh::New(name,type);
3096 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m)
3098 return MEDCoupling1DGTUMesh::New(m);
3101 std::string __str__() const
3103 return self->simpleRepr();
3106 std::string __repr__() const
3108 std::ostringstream oss;
3109 self->reprQuickOverview(oss);
3113 DataArrayInt *getNodalConnectivityIndex() const
3115 DataArrayInt *ret=self->getNodalConnectivityIndex();
3116 if(ret) ret->incrRef();
3120 PyObject *retrievePackedNodalConnectivity() const
3122 DataArrayInt *ret1=0,*ret2=0;
3123 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3124 PyObject *ret0Py=ret0?Py_True:Py_False;
3126 PyObject *ret=PyTuple_New(3);
3127 PyTuple_SetItem(ret,0,ret0Py);
3128 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3129 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3133 PyObject *copyWithNodalConnectivityPacked() const
3136 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3137 PyObject *ret=PyTuple_New(2);
3138 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3139 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3140 PyTuple_SetItem(ret,1,ret1Py);
3144 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li)
3146 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3147 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3148 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3151 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li)
3153 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3154 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3155 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3158 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt)
3160 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3161 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3162 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3167 //== MEDCoupling1DGTUMeshEnd
3169 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3172 int getCellIdFromPos(int i, int j, int k) const;
3173 int getNodeIdFromPos(int i, int j, int k) const;
3174 int getNumberOfCellsOfSubLevelMesh() const;
3175 int getSpaceDimensionOnNodeStruct() const;
3176 double computeSquareness() const;
3177 virtual std::vector<int> getNodeGridStructure() const;
3178 std::vector<int> getCellGridStructure() const;
3179 MEDCoupling1SGTUMesh *build1SGTUnstructured() const;
3180 std::vector<int> getLocationFromCellId(int cellId) const;
3181 std::vector<int> getLocationFromNodeId(int cellId) const;
3182 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim);
3183 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const;
3184 static int DeduceNumberOfGivenStructure(const std::vector<int>& st);
3185 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev);
3186 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct);
3189 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const
3191 int tmpp1=-1,tmpp2=-1;
3192 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3193 std::vector< std::pair<int,int> > inp;
3197 for(int i=0;i<tmpp1;i++)
3198 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3203 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3204 inp.resize(tmpp1/2);
3205 for(int i=0;i<tmpp1/2;i++)
3206 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3209 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3210 return self->buildStructuredSubPart(inp);
3213 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part)
3215 std::vector< std::pair<int,int> > inp;
3216 convertPyToVectorPairInt(part,inp);
3218 int szArr,sw,iTypppArr;
3219 std::vector<int> stdvecTyyppArr;
3220 const int *tmp4=convertIntStarLikePyObjToCppIntStar(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3221 std::vector<int> tmp5(tmp4,tmp4+szArr);
3223 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3226 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da)
3228 std::vector< std::pair<int,int> > inp;
3229 convertPyToVectorPairInt(part,inp);
3230 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3233 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da)
3235 std::vector< std::pair<int,int> > inp;
3236 convertPyToVectorPairInt(part,inp);
3237 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3240 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part)
3242 std::vector< std::pair<int,int> > inp;
3243 convertPyToVectorPairInt(part,inp);
3244 std::vector<int> stWithGhost;
3245 std::vector< std::pair<int,int> > partWithGhost;
3246 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3247 PyObject *ret(PyTuple_New(2));
3248 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3249 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3253 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat)
3255 std::vector< std::pair<int,int> > inp;
3256 convertPyToVectorPairInt(partCompactFormat,inp);
3257 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3260 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other)
3262 std::vector< std::pair<int,int> > inp;
3263 convertPyToVectorPairInt(partCompactFormat,inp);
3264 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3267 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part)
3269 std::vector< std::pair<int,int> > inp;
3270 convertPyToVectorPairInt(part,inp);
3271 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3274 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li)
3276 int szArr,sw,iTypppArr;
3277 std::vector<int> stdvecTyyppArr;
3278 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3279 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3282 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li)
3284 int szArr,sw,iTypppArr;
3285 std::vector<int> stdvecTyyppArr;
3286 const int *tmp(convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3287 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3290 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat)
3292 std::vector< std::pair<int,int> > inp;
3293 convertPyToVectorPairInt(partCompactFormat,inp);
3294 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3297 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims)
3299 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3300 PyObject *retPy=PyList_New(ret.size());
3301 for(std::size_t i=0;i<ret.size();i++)
3303 PyObject *tmp=PyTuple_New(2);
3304 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3305 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3306 PyList_SetItem(retPy,i,tmp);
3311 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2)
3313 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3314 convertPyToVectorPairInt(r1,r1Cpp);
3315 convertPyToVectorPairInt(r2,r2Cpp);
3316 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3317 PyObject *retPy=PyList_New(ret.size());
3318 for(std::size_t i=0;i<ret.size();i++)
3320 PyObject *tmp=PyTuple_New(2);
3321 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3322 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3323 PyList_SetItem(retPy,i,tmp);
3328 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3330 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3331 convertPyToVectorPairInt(r1,r1Cpp);
3332 convertPyToVectorPairInt(r2,r2Cpp);
3333 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3336 static PyObject *IsPartStructured(PyObject *li, PyObject *st)
3338 int szArr,sw,iTypppArr;
3339 std::vector<int> stdvecTyyppArr;
3340 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3341 int szArr2,sw2,iTypppArr2;
3342 std::vector<int> stdvecTyyppArr2;
3343 const int *tmp2=convertIntStarLikePyObjToCppIntStar(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3344 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3345 std::vector< std::pair<int,int> > partCompactFormat;
3346 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3347 PyObject *ret=PyTuple_New(2);
3348 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3349 PyTuple_SetItem(ret,0,ret0Py);
3350 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3351 for(std::size_t i=0;i<partCompactFormat.size();i++)
3353 PyObject *tmp4=PyTuple_New(2);
3354 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3355 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3356 PyList_SetItem(ret1Py,i,tmp4);
3358 PyTuple_SetItem(ret,1,ret1Py);
3362 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true)
3364 std::vector< std::pair<int,int> > param0,param1,ret;
3365 convertPyToVectorPairInt(bigInAbs,param0);
3366 convertPyToVectorPairInt(partOfBigInAbs,param1);
3367 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3368 PyObject *retPy(PyList_New(ret.size()));
3369 for(std::size_t i=0;i<ret.size();i++)
3371 PyObject *tmp(PyTuple_New(2));
3372 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3373 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3374 PyList_SetItem(retPy,i,tmp);
3379 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation)
3381 std::vector< std::pair<int,int> > param0;
3382 convertPyToVectorPairInt(part,param0);
3383 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3384 PyObject *retPy(PyList_New(ret.size()));
3385 for(std::size_t i=0;i<ret.size();i++)
3387 PyObject *tmp(PyTuple_New(2));
3388 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3389 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3390 PyList_SetItem(retPy,i,tmp);
3395 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo)
3397 std::vector< std::pair<int,int> > param0,param1;
3398 convertPyToVectorPairInt(startingFrom,param0);
3399 convertPyToVectorPairInt(goingTo,param1);
3400 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3403 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true)
3405 std::vector< std::pair<int,int> > param0,param1,ret;
3406 convertPyToVectorPairInt(bigInAbs,param0);
3407 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3408 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3409 PyObject *retPy(PyList_New(ret.size()));
3410 for(std::size_t i=0;i<ret.size();i++)
3412 PyObject *tmp(PyTuple_New(2));
3413 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3414 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3415 PyList_SetItem(retPy,i,tmp);
3422 class MEDCouplingCurveLinearMesh;
3424 //== MEDCouplingCMesh
3426 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3429 static MEDCouplingCMesh *New();
3430 static MEDCouplingCMesh *New(const std::string& meshName);
3431 void setCoords(const DataArrayDouble *coordsX,
3432 const DataArrayDouble *coordsY=0,
3433 const DataArrayDouble *coordsZ=0);
3434 void setCoordsAt(int i, const DataArrayDouble *arr);
3435 MEDCouplingCurveLinearMesh *buildCurveLinear() const;
3439 return MEDCouplingCMesh::New();
3441 MEDCouplingCMesh(const std::string& meshName)
3443 return MEDCouplingCMesh::New(meshName);
3445 std::string __str__() const
3447 return self->simpleRepr();
3449 std::string __repr__() const
3451 std::ostringstream oss;
3452 self->reprQuickOverview(oss);
3455 DataArrayDouble *getCoordsAt(int i)
3457 DataArrayDouble *ret=self->getCoordsAt(i);
3465 //== MEDCouplingCMesh End
3467 //== MEDCouplingCurveLinearMesh
3469 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3472 static MEDCouplingCurveLinearMesh *New();
3473 static MEDCouplingCurveLinearMesh *New(const std::string& meshName);
3474 void setCoords(const DataArrayDouble *coords);
3476 MEDCouplingCurveLinearMesh()
3478 return MEDCouplingCurveLinearMesh::New();
3480 MEDCouplingCurveLinearMesh(const std::string& meshName)
3482 return MEDCouplingCurveLinearMesh::New(meshName);
3484 std::string __str__() const
3486 return self->simpleRepr();
3488 std::string __repr__() const
3490 std::ostringstream oss;
3491 self->reprQuickOverview(oss);
3494 DataArrayDouble *getCoords()
3496 DataArrayDouble *ret=self->getCoords();
3501 void setNodeGridStructure(PyObject *gridStruct)
3503 int szArr,sw,iTypppArr;
3504 std::vector<int> stdvecTyyppArr;
3505 const int *tmp=convertIntStarLikePyObjToCppIntStar(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3506 self->setNodeGridStructure(tmp,tmp+szArr);
3511 //== MEDCouplingCurveLinearMesh End
3513 //== MEDCouplingIMesh
3515 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3518 static MEDCouplingIMesh *New();
3520 void setSpaceDimension(int spaceDim);
3521 std::vector<int> getNodeStruct() const;
3522 std::vector<double> getOrigin() const;
3523 std::vector<double> getDXYZ() const;
3524 void setAxisUnit(const std::string& unitName);
3525 std::string getAxisUnit() const;
3526 double getMeasureOfAnyCell() const;
3527 MEDCouplingCMesh *convertToCartesian() const;
3528 void refineWithFactor(const std::vector<int>& factors);
3529 MEDCouplingIMesh *asSingleCell() const;
3530 MEDCouplingIMesh *buildWithGhost(int ghostLev) const;
3535 return MEDCouplingIMesh::New();
3537 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
3539 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3540 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3541 const int *nodeStrctPtr(0);
3542 const double *originPtr(0),*dxyzPtr(0);
3544 std::vector<int> bb0;
3545 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
3548 std::vector<double> bb,bb2;
3550 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3551 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3553 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3556 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
3558 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3561 void setNodeStruct(PyObject *nodeStrct)
3564 std::vector<int> bb0;
3565 const int *nodeStrctPtr(convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0));
3566 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3569 void setOrigin(PyObject *origin)
3571 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3574 DataArrayDoubleTuple *aa;
3575 std::vector<double> bb;
3577 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3578 self->setOrigin(originPtr,originPtr+nbTuples);
3581 void setDXYZ(PyObject *dxyz)
3583 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3586 DataArrayDoubleTuple *aa;
3587 std::vector<double> bb;
3589 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3590 self->setDXYZ(originPtr,originPtr+nbTuples);
3593 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA)
3595 std::vector< std::pair<int,int> > inp;
3596 convertPyToVectorPairInt(fineLocInCoarse,inp);
3597 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3600 static void CondenseFineToCoarseGhost(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA, int ghostSize)
3602 std::vector< std::pair<int,int> > inp;
3603 convertPyToVectorPairInt(fineLocInCoarse,inp);
3604 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3607 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts)
3609 std::vector< std::pair<int,int> > inp;
3610 convertPyToVectorPairInt(fineLocInCoarse,inp);
3611 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3614 static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, int ghostSize)
3616 std::vector< std::pair<int,int> > inp;
3617 convertPyToVectorPairInt(fineLocInCoarse,inp);
3618 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3621 static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, int ghostSize)
3623 std::vector< std::pair<int,int> > inp;
3624 convertPyToVectorPairInt(fineLocInCoarse,inp);
3625 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3628 std::string __str__() const
3630 return self->simpleRepr();
3632 std::string __repr__() const
3634 std::ostringstream oss;
3635 self->reprQuickOverview(oss);
3641 //== MEDCouplingIMesh End
3645 namespace MEDCoupling
3647 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3650 virtual void checkConsistencyLight() const;
3651 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const;
3652 virtual void copyTinyStringsFrom(const MEDCouplingField *other);
3653 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh);
3654 void setName(const char *name);
3655 std::string getDescription() const;
3656 void setDescription(const char *desc);
3657 std::string getName() const;
3658 TypeOfField getTypeOfField() const;
3659 NatureOfField getNature() const;
3660 virtual void setNature(NatureOfField nat);
3661 DataArrayDouble *getLocalizationOfDiscr() const;
3662 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const;
3663 int getNumberOfTuplesExpected() const;
3664 int getNumberOfMeshPlacesExpected() const;
3665 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3666 const std::vector<double>& gsCoo, const std::vector<double>& wg);
3667 void clearGaussLocalizations();
3668 MEDCouplingGaussLocalization& getGaussLocalization(int locId);
3669 int getNbOfGaussLocalization() const;
3670 int getGaussLocalizationIdOfOneCell(int cellId) const;
3671 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const;
3672 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const;
3673 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3675 PyObject *getMesh() const
3677 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3680 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3683 PyObject *getDiscretization()
3685 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3688 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3691 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const
3693 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3694 return convertIntArrToPyList3(ret);
3697 PyObject *buildSubMeshData(PyObject *li) const
3699 DataArrayInt *ret1=0;
3700 MEDCouplingMesh *ret0=0;
3702 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3703 if (!SWIG_IsOK(res1))
3706 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3707 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3711 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3713 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3714 da2->checkAllocated();
3715 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3717 PyObject *res = PyList_New(2);
3718 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3719 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3723 PyObject *buildSubMeshDataRange(int begin, int end, int step) const
3725 DataArrayInt *ret1=0;
3727 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3728 PyObject *res=PyTuple_New(2);
3729 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3731 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3734 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3735 PyTuple_SetItem(res,1,res1);
3740 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3743 int v0; std::vector<int> v1;
3744 const int *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
3745 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3748 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3749 const std::vector<double>& gsCoo, const std::vector<double>& wg)
3752 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3753 if (!SWIG_IsOK(res1))
3756 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3757 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3761 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3763 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3764 da2->checkAllocated();
3765 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3769 PyObject *getCellIdsHavingGaussLocalization(int locId) const
3771 std::vector<int> tmp;
3772 self->getCellIdsHavingGaussLocalization(locId,tmp);
3773 DataArrayInt *ret=DataArrayInt::New();
3774 ret->alloc((int)tmp.size(),1);
3775 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3776 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3779 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const
3781 std::vector<int> inp0;
3782 convertPyToNewIntArr4(code,1,3,inp0);
3783 std::vector<const DataArrayInt *> inp1;
3784 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3785 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3790 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3793 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f);
3794 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f);
3795 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f);
3796 static MEDCouplingFieldTemplate *New(TypeOfField type);
3797 std::string simpleRepr() const;
3798 std::string advancedRepr() const;
3799 bool isEqual(const MEDCouplingFieldTemplate *other, double meshPrec) const;
3800 bool isEqualWithoutConsideringStr(const MEDCouplingFieldTemplate *other, double meshPrec) const;
3803 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f)
3805 return MEDCouplingFieldTemplate::New(f);
3808 MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f)
3810 return MEDCouplingFieldTemplate::New(f);
3813 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f)
3815 return MEDCouplingFieldTemplate::New(f);
3818 MEDCouplingFieldTemplate(TypeOfField type)
3820 return MEDCouplingFieldTemplate::New(type);
3823 std::string __str__() const
3825 return self->simpleRepr();
3828 std::string __repr__() const
3830 std::ostringstream oss;
3831 self->reprQuickOverview(oss);
3835 PyObject *isEqualIfNotWhy(const MEDCouplingFieldTemplate *other, double meshPrec) const
3838 bool ret0=self->isEqualIfNotWhy(other,meshPrec,ret1);
3839 PyObject *ret=PyTuple_New(2);
3840 PyObject *ret0Py=ret0?Py_True:Py_False;
3842 PyTuple_SetItem(ret,0,ret0Py);
3843 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3850 class MEDCouplingFieldT : public MEDCoupling::MEDCouplingField
3853 TypeOfTimeDiscretization getTimeDiscretization() const;
3855 MEDCouplingFieldT();
3856 ~MEDCouplingFieldT();
3859 %template(MEDCouplingFieldTdouble) MEDCoupling::MEDCouplingFieldT<double>;
3860 %template(MEDCouplingFieldTfloat) MEDCoupling::MEDCouplingFieldT<float>;
3861 %template(MEDCouplingFieldTint) MEDCoupling::MEDCouplingFieldT<int>;
3863 class MEDCouplingFieldInt;
3864 class MEDCouplingFieldFloat;
3866 class MEDCouplingFieldDouble : public MEDCouplingFieldT<double>
3869 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3870 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3871 bool isEqual(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
3872 bool isEqualWithoutConsideringStr(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
3873 void setTimeUnit(const std::string& unit);
3874 std::string getTimeUnit() const;
3875 void synchronizeTimeWithSupport();
3876 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other);
3877 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other);
3878 std::string simpleRepr() const;
3879 std::string advancedRepr() const;
3880 std::string writeVTK(const std::string& fileName, bool isBinary=true) const;
3881 MEDCouplingFieldInt *convertToIntField() const;
3882 MEDCouplingFieldFloat *convertToFloatField() const;
3883 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3884 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3885 MEDCouplingFieldDouble *deepCopy() const;
3886 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const;
3887 MEDCouplingFieldDouble *nodeToCellDiscretization() const;
3888 MEDCouplingFieldDouble *cellToNodeDiscretization() const;
3889 double getIJ(int tupleId, int compoId) const;
3890 double getIJK(int cellId, int nodeIdInCell, int compoId) const;
3891 void synchronizeTimeWithMesh();
3892 void setArray(DataArrayDouble *array);
3893 void setEndArray(DataArrayDouble *array);
3894 void setTime(double val, int iteration, int order);
3895 void setStartTime(double val, int iteration, int order);
3896 void setEndTime(double val, int iteration, int order);
3897 void applyLin(double a, double b, int compoId);
3898 void applyLin(double a, double b);
3899 int getNumberOfComponents() const;
3900 int getNumberOfTuples() const;
3901 int getNumberOfValues() const;
3902 void setTimeTolerance(double val);
3903 double getTimeTolerance() const;
3904 void setIteration(int it);
3905 void setEndIteration(int it);
3906 void setOrder(int order);
3907 void setEndOrder(int order);
3908 void setTimeValue(double val);
3909 void setEndTimeValue(double val);
3910 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15);
3911 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15);
3912 bool mergeNodes(double eps, double epsOnVals=1e-15);
3913 bool mergeNodesCenter(double eps, double epsOnVals=1e-15);
3914 bool zipCoords(double epsOnVals=1e-15);
3915 bool zipConnectivity(int compType,double epsOnVals=1e-15);
3916 bool simplexize(int policy);
3917 MEDCouplingFieldDouble *doublyContractedProduct() const;
3918 MEDCouplingFieldDouble *determinant() const;
3919 MEDCouplingFieldDouble *eigenValues() const;
3920 MEDCouplingFieldDouble *eigenVectors() const;
3921 MEDCouplingFieldDouble *inverse() const;
3922 MEDCouplingFieldDouble *trace() const;
3923 MEDCouplingFieldDouble *deviator() const;
3924 MEDCouplingFieldDouble *magnitude() const;
3925 MEDCouplingFieldDouble *maxPerTuple() const;
3926 void changeNbOfComponents(int newNbOfComp, double dftValue=0.);
3927 void sortPerTuple(bool asc);
3928 MEDCouplingFieldDouble &operator=(double value);
3929 void fillFromAnalytic(int nbOfComp, const std::string& func);
3930 void fillFromAnalyticCompo(int nbOfComp, const std::string& func);
3931 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
3932 void applyFunc(int nbOfComp, const std::string& func);
3933 void applyFuncCompo(int nbOfComp, const std::string& func);
3934 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
3935 void applyFunc(int nbOfComp, double val);
3936 void applyFunc(const std::string& func);
3937 void applyFuncFast32(const std::string& func);
3938 void applyFuncFast64(const std::string& func);
3939 double accumulate(int compId) const;
3940 double getMaxValue() const;
3941 double getMinValue() const;
3942 double getAverageValue() const;
3943 double norm2() const;
3944 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3945 double getWeightedAverageValue(int compId, bool isWAbs) const;
3946 double integral(int compId, bool isWAbs) const;
3947 double normL1(int compId) const;
3948 double normL2(int compId) const;
3949 double normMax(int compId) const;
3950 DataArrayInt *findIdsInRange(double vmin, double vmax) const;
3951 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const;
3952 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
3953 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
3954 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
3955 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const;
3956 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
3957 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const;
3958 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
3959 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const;
3960 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
3961 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
3962 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
3963 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
3964 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
3965 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const;
3966 MEDCouplingFieldDouble *negate() const;
3968 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3970 return MEDCouplingFieldDouble::New(type,td);
3973 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3975 return MEDCouplingFieldDouble::New(ft,td);
3978 std::string __str__() const
3980 return self->simpleRepr();
3983 std::string __repr__() const
3985 std::ostringstream oss;
3986 self->reprQuickOverview(oss);
3990 PyObject *isEqualIfNotWhy(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const
3993 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3994 PyObject *ret=PyTuple_New(2);
3995 PyObject *ret0Py=ret0?Py_True:Py_False;
3997 PyTuple_SetItem(ret,0,ret0Py);
3998 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4002 MEDCouplingFieldDouble *voronoize(double eps) const
4004 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4008 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const
4010 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4014 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4016 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4018 DataArrayDouble *a,*a2;
4019 DataArrayDoubleTuple *aa,*aa2;
4020 std::vector<double> bb,bb2;
4022 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4023 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4024 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4027 DataArrayDouble *getArray()
4029 DataArrayDouble *ret=self->getArray();
4035 PyObject *getArrays() const
4037 std::vector<DataArrayDouble *> arrs=self->getArrays();
4038 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4042 PyObject *ret=PyTuple_New(sz);
4043 for(int i=0;i<sz;i++)
4046 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4048 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4053 void setArrays(PyObject *ls)
4055 std::vector<const DataArrayDouble *> tmp;
4056 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4058 std::vector<DataArrayDouble *> arrs(sz);
4059 for(int i=0;i<sz;i++)
4060 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4061 self->setArrays(arrs);
4064 DataArrayDouble *getEndArray()
4066 DataArrayDouble *ret=self->getEndArray();
4072 PyObject *getValueOn(PyObject *sl) const
4076 DataArrayDoubleTuple *aa;
4077 std::vector<double> bb;
4079 const MEDCouplingMesh *mesh=self->getMesh();
4081 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4082 int spaceDim=mesh->getSpaceDimension();
4083 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4084 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4086 int sz=self->getNumberOfComponents();
4087 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4088 self->getValueOn(spaceLoc,res);
4089 return convertDblArrToPyList<double>(res,sz);
4092 PyObject *getValueOnPos(int i, int j, int k) const
4094 int sz=self->getNumberOfComponents();
4095 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4096 self->getValueOnPos(i,j,k,res);
4097 return convertDblArrToPyList<double>(res,sz);
4100 DataArrayDouble *getValueOnMulti(PyObject *locs) const
4102 const MEDCouplingMesh *mesh(self->getMesh());
4104 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4107 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4108 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4109 mesh->getSpaceDimension(),true,nbPts);
4110 return self->getValueOnMulti(inp,nbPts);
4113 PyObject *getValueOn(PyObject *sl, double time) const
4117 DataArrayDoubleTuple *aa;
4118 std::vector<double> bb;
4120 const MEDCouplingMesh *mesh=self->getMesh();
4122 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4123 int spaceDim=mesh->getSpaceDimension();
4124 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4125 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4128 int sz=self->getNumberOfComponents();
4129 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4130 self->getValueOn(spaceLoc,time,res);
4131 return convertDblArrToPyList<double>(res,sz);
4134 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
4136 if(self->getArray()!=0)
4137 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4140 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4141 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4142 self->setArray(arr);
4149 double tmp0=self->getTime(tmp1,tmp2);
4150 PyObject *res = PyList_New(3);
4151 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4152 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4153 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4157 PyObject *getStartTime()
4160 double tmp0=self->getStartTime(tmp1,tmp2);
4161 PyObject *res = PyList_New(3);
4162 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4163 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4164 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4168 PyObject *getEndTime()
4171 double tmp0=self->getEndTime(tmp1,tmp2);
4172 PyObject *res = PyList_New(3);
4173 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4174 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4175 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4178 PyObject *accumulate() const
4180 int sz=self->getNumberOfComponents();
4181 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4182 self->accumulate(tmp);
4183 return convertDblArrToPyList<double>(tmp,sz);
4185 PyObject *integral(bool isWAbs) const
4187 int sz=self->getNumberOfComponents();
4188 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4189 self->integral(isWAbs,tmp);
4190 return convertDblArrToPyList<double>(tmp,sz);
4192 PyObject *getWeightedAverageValue(bool isWAbs=true) const
4194 int sz=self->getNumberOfComponents();
4195 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4196 self->getWeightedAverageValue(tmp,isWAbs);
4197 return convertDblArrToPyList<double>(tmp,sz);
4199 PyObject *normL1() const
4201 int sz=self->getNumberOfComponents();
4202 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4204 return convertDblArrToPyList<double>(tmp,sz);
4206 PyObject *normL2() const
4208 int sz=self->getNumberOfComponents();
4209 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4211 return convertDblArrToPyList<double>(tmp,sz);
4213 PyObject *normMax() const
4215 int sz=self->getNumberOfComponents();
4216 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4218 return convertDblArrToPyList<double>(tmp,sz);
4220 void renumberCells(PyObject *li, bool check=true)
4222 int szArr,sw,iTypppArr;
4223 std::vector<int> stdvecTyyppArr;
4224 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4225 self->renumberCells(tmp,check);
4228 void renumberCellsWithoutMesh(PyObject *li, bool check=true)
4230 int szArr,sw,iTypppArr;
4231 std::vector<int> stdvecTyyppArr;
4232 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4233 self->renumberCellsWithoutMesh(tmp,check);
4236 void renumberNodes(PyObject *li, double eps=1e-15)
4238 int szArr,sw,iTypppArr;
4239 std::vector<int> stdvecTyyppArr;
4240 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4241 self->renumberNodes(tmp,eps);
4244 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15)
4246 int szArr,sw,iTypppArr;
4247 std::vector<int> stdvecTyyppArr;
4248 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4249 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4252 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const
4254 return fieldT_buildSubPart(self,li);
4257 MEDCouplingFieldDouble *__getitem__(PyObject *li) const
4259 return fieldT__getitem__(self,li);
4262 PyObject *getMaxValue2() const
4265 double r1=self->getMaxValue2(tmp);
4266 PyObject *ret=PyTuple_New(2);
4267 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4268 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4272 PyObject *getMinValue2() const
4275 double r1=self->getMinValue2(tmp);
4276 PyObject *ret=PyTuple_New(2);
4277 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4278 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4282 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const
4284 std::vector<int> tmp;
4285 convertPyToNewIntArr3(li,tmp);
4286 return self->keepSelectedComponents(tmp);
4289 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li)
4291 std::vector<int> tmp;
4292 convertPyToNewIntArr3(li,tmp);
4293 self->setSelectedComponents(f,tmp);
4296 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const
4299 DataArrayDouble *a,*a2;
4300 DataArrayDoubleTuple *aa,*aa2;
4301 std::vector<double> bb,bb2;
4304 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st parameter for origin.";
4305 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd parameter for vector.";
4306 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4307 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4309 return self->extractSlice3D(orig,vect,eps);
4312 MEDCouplingFieldDouble *__add__(PyObject *obj)
4314 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4317 MEDCouplingFieldDouble *__radd__(PyObject *obj)
4319 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4322 MEDCouplingFieldDouble *__sub__(PyObject *obj)
4324 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.";
4325 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4328 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4330 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4332 return (*self)-(*other);
4334 throw INTERP_KERNEL::Exception(msg);
4339 DataArrayDoubleTuple *aa;
4340 std::vector<double> bb;
4342 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4347 if(!self->getArray())
4348 throw INTERP_KERNEL::Exception(msg2);
4349 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4350 ret->applyLin(1.,-val);
4351 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4352 ret2->setArray(ret);
4357 if(!self->getArray())
4358 throw INTERP_KERNEL::Exception(msg2);
4359 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4360 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4361 ret2->setArray(ret);
4366 if(!self->getArray())
4367 throw INTERP_KERNEL::Exception(msg2);
4368 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4369 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4370 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4371 ret2->setArray(ret);
4376 if(!self->getArray())
4377 throw INTERP_KERNEL::Exception(msg2);
4378 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4379 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4380 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4381 ret2->setArray(ret);
4385 { throw INTERP_KERNEL::Exception(msg); }
4389 MEDCouplingFieldDouble *__rsub__(PyObject *obj)
4391 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4394 MEDCouplingFieldDouble *__mul__(PyObject *obj)
4396 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4399 MEDCouplingFieldDouble *__rmul__(PyObject *obj)
4401 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4404 MEDCouplingFieldDouble *__div__(PyObject *obj)
4406 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.";
4407 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4410 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4412 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4414 return (*self)/(*other);
4416 throw INTERP_KERNEL::Exception(msg);
4421 DataArrayDoubleTuple *aa;
4422 std::vector<double> bb;
4424 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4430 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4431 if(!self->getArray())
4432 throw INTERP_KERNEL::Exception(msg2);
4433 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4434 ret->applyLin(1./val,0);
4435 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4436 ret2->setArray(ret);
4441 if(!self->getArray())
4442 throw INTERP_KERNEL::Exception(msg2);
4443 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4444 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4445 ret2->setArray(ret);
4450 if(!self->getArray())
4451 throw INTERP_KERNEL::Exception(msg2);
4452 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4453 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4454 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4455 ret2->setArray(ret);
4460 if(!self->getArray())
4461 throw INTERP_KERNEL::Exception(msg2);
4462 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4463 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4464 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4465 ret2->setArray(ret);
4469 { throw INTERP_KERNEL::Exception(msg); }
4473 MEDCouplingFieldDouble *__rdiv__(PyObject *obj)
4475 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4478 MEDCouplingFieldDouble *__pow__(PyObject *obj)
4480 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.";
4481 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4484 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4486 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4488 return (*self)^(*other);
4490 throw INTERP_KERNEL::Exception(msg);
4495 DataArrayDoubleTuple *aa;
4496 std::vector<double> bb;
4498 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4503 if(!self->getArray())
4504 throw INTERP_KERNEL::Exception(msg2);
4505 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4507 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4508 ret2->setArray(ret);
4513 if(!self->getArray())
4514 throw INTERP_KERNEL::Exception(msg2);
4515 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4516 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4517 ret2->setArray(ret);
4522 if(!self->getArray())
4523 throw INTERP_KERNEL::Exception(msg2);
4524 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4525 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4526 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4527 ret2->setArray(ret);
4532 if(!self->getArray())
4533 throw INTERP_KERNEL::Exception(msg2);
4534 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4535 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4536 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4537 ret2->setArray(ret);
4541 { throw INTERP_KERNEL::Exception(msg); }
4545 MEDCouplingFieldDouble *__neg__() const
4547 return self->negate();
4550 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
4552 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.";
4553 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4556 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4558 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4562 Py_XINCREF(trueSelf);
4566 throw INTERP_KERNEL::Exception(msg);
4571 DataArrayDoubleTuple *aa;
4572 std::vector<double> bb;
4574 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4579 if(!self->getArray())
4580 throw INTERP_KERNEL::Exception(msg2);
4581 self->getArray()->applyLin(1.,val);
4582 Py_XINCREF(trueSelf);
4587 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4590 Py_XINCREF(trueSelf);
4595 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4596 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4597 ret2->setArray(aaa);
4599 Py_XINCREF(trueSelf);
4604 if(!self->getArray())
4605 throw INTERP_KERNEL::Exception(msg2);
4606 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4607 self->getArray()->addEqual(aaa);
4608 Py_XINCREF(trueSelf);
4612 { throw INTERP_KERNEL::Exception(msg); }
4616 PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
4618 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.";
4619 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4622 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4624 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4628 Py_XINCREF(trueSelf);
4632 throw INTERP_KERNEL::Exception(msg);
4637 DataArrayDoubleTuple *aa;
4638 std::vector<double> bb;
4640 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4645 if(!self->getArray())
4646 throw INTERP_KERNEL::Exception(msg2);
4647 self->getArray()->applyLin(1.,-val);
4648 Py_XINCREF(trueSelf);
4653 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4656 Py_XINCREF(trueSelf);
4661 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4662 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4663 ret2->setArray(aaa);
4665 Py_XINCREF(trueSelf);
4670 if(!self->getArray())
4671 throw INTERP_KERNEL::Exception(msg2);
4672 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4673 self->getArray()->substractEqual(aaa);
4674 Py_XINCREF(trueSelf);
4678 { throw INTERP_KERNEL::Exception(msg); }
4682 PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
4684 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.";
4685 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4688 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4690 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4694 Py_XINCREF(trueSelf);
4698 throw INTERP_KERNEL::Exception(msg);
4703 DataArrayDoubleTuple *aa;
4704 std::vector<double> bb;
4706 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4711 if(!self->getArray())
4712 throw INTERP_KERNEL::Exception(msg2);
4713 self->getArray()->applyLin(val,0);
4714 Py_XINCREF(trueSelf);
4719 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4722 Py_XINCREF(trueSelf);
4727 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4728 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4729 ret2->setArray(aaa);
4731 Py_XINCREF(trueSelf);
4736 if(!self->getArray())
4737 throw INTERP_KERNEL::Exception(msg2);
4738 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4739 self->getArray()->multiplyEqual(aaa);
4740 Py_XINCREF(trueSelf);
4744 { throw INTERP_KERNEL::Exception(msg); }
4748 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
4750 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.";
4751 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4754 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4756 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4760 Py_XINCREF(trueSelf);
4764 throw INTERP_KERNEL::Exception(msg);
4769 DataArrayDoubleTuple *aa;
4770 std::vector<double> bb;
4772 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4778 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4779 if(!self->getArray())
4780 throw INTERP_KERNEL::Exception(msg2);
4781 self->getArray()->applyLin(1./val,0);
4782 Py_XINCREF(trueSelf);
4787 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4790 Py_XINCREF(trueSelf);
4795 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4796 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4797 ret2->setArray(aaa);
4799 Py_XINCREF(trueSelf);
4804 if(!self->getArray())
4805 throw INTERP_KERNEL::Exception(msg2);
4806 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4807 self->getArray()->divideEqual(aaa);
4808 Py_XINCREF(trueSelf);
4812 { throw INTERP_KERNEL::Exception(msg); }
4816 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj)
4818 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.";
4819 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4822 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4824 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4828 Py_XINCREF(trueSelf);
4832 throw INTERP_KERNEL::Exception(msg);
4837 DataArrayDoubleTuple *aa;
4838 std::vector<double> bb;
4840 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4845 if(!self->getArray())
4846 throw INTERP_KERNEL::Exception(msg2);
4847 self->getArray()->applyPow(val);
4848 Py_XINCREF(trueSelf);
4853 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4856 Py_XINCREF(trueSelf);
4861 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4862 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4863 ret2->setArray(aaa);
4865 Py_XINCREF(trueSelf);
4870 if(!self->getArray())
4871 throw INTERP_KERNEL::Exception(msg2);
4872 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4873 self->getArray()->powEqual(aaa);
4874 Py_XINCREF(trueSelf);
4878 { throw INTERP_KERNEL::Exception(msg); }
4882 static MEDCouplingFieldDouble *MergeFields(PyObject *li)
4884 std::vector<const MEDCouplingFieldDouble *> tmp;
4885 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4886 return MEDCouplingFieldDouble::MergeFields(tmp);
4889 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true)
4891 std::vector<const MEDCouplingFieldDouble *> tmp;
4892 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4893 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4896 PyObject *getTinySerializationInformation() const
4898 return field_getTinySerializationInformation<MEDCouplingFieldDouble>(self);
4901 PyObject *serialize() const
4903 return field_serialize<double>(self);
4906 PyObject *__getstate__() const
4908 return field__getstate__<MEDCouplingFieldDouble>(self,MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldDouble_serialize);
4911 void __setstate__(PyObject *inp)
4913 field__setstate__<double>(self,inp);
4918 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4921 int getNumberOfFields() const;
4922 MEDCouplingMultiFields *deepCopy() const;
4923 virtual std::string simpleRepr() const;
4924 virtual std::string advancedRepr() const;
4925 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4926 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4927 virtual void checkConsistencyLight() const;
4930 std::string __str__() const
4932 return self->simpleRepr();
4934 static MEDCouplingMultiFields *New(PyObject *li)
4936 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
4937 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4939 std::vector<MEDCouplingFieldDouble *> fs(sz);
4940 for(int i=0;i<sz;i++)
4941 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4942 return MEDCouplingMultiFields::New(fs);
4944 MEDCouplingMultiFields(PyObject *li)
4946 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
4947 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4949 std::vector<MEDCouplingFieldDouble *> fs(sz);
4950 for(int i=0;i<sz;i++)
4951 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4952 return MEDCouplingMultiFields::New(fs);
4954 PyObject *getFields() const
4956 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4957 int sz=fields.size();
4958 PyObject *res = PyList_New(sz);
4959 for(int i=0;i<sz;i++)
4963 fields[i]->incrRef();
4964 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4968 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
4973 PyObject *getFieldAtPos(int id) const
4975 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4979 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4982 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
4984 PyObject *getMeshes() const
4986 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4988 PyObject *res = PyList_New(sz);
4989 for(int i=0;i<sz;i++)
4994 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4998 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5003 PyObject *getDifferentMeshes() const
5005 std::vector<int> refs;
5006 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5008 PyObject *res = PyList_New(sz);
5009 for(int i=0;i<sz;i++)
5014 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5018 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5022 PyObject *ret=PyTuple_New(2);
5023 PyTuple_SetItem(ret,0,res);
5024 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5027 PyObject *getArrays() const
5029 std::vector<DataArrayDouble *> ms=self->getArrays();
5031 PyObject *res = PyList_New(sz);
5032 for(int i=0;i<sz;i++)
5037 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5041 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5046 PyObject *getDifferentArrays() const
5048 std::vector< std::vector<int> > refs;
5049 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5051 PyObject *res = PyList_New(sz);
5052 PyObject *res2 = PyList_New(sz);
5053 for(int i=0;i<sz;i++)
5058 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5062 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5064 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5067 PyObject *ret=PyTuple_New(2);
5068 PyTuple_SetItem(ret,0,res);
5069 PyTuple_SetItem(ret,1,res2);
5075 class MEDCouplingFieldInt : public MEDCouplingFieldT<int>
5078 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5079 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5080 bool isEqual(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const;
5081 bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const;
5082 void setTimeUnit(const std::string& unit);
5083 std::string getTimeUnit() const;
5084 void setTime(double val, int iteration, int order);
5085 void setArray(DataArrayInt *array);
5086 MEDCouplingFieldInt *deepCopy() const;
5087 MEDCouplingFieldInt *clone(bool recDeepCpy) const;
5088 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const;
5089 MEDCouplingFieldDouble *convertToDblField() const;
5090 MEDCouplingFieldInt *buildSubPartRange(int begin, int end, int step) const;
5092 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5094 return MEDCouplingFieldInt::New(type,td);
5097 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5099 return MEDCouplingFieldInt::New(ft,td);
5102 PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const
5105 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5106 PyObject *ret=PyTuple_New(2);
5107 PyObject *ret0Py=ret0?Py_True:Py_False;
5109 PyTuple_SetItem(ret,0,ret0Py);
5110 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5114 std::string __str__() const
5116 return self->simpleRepr();
5119 std::string __repr__() const
5121 std::ostringstream oss;
5122 self->reprQuickOverview(oss);
5126 MEDCouplingFieldInt *buildSubPart(PyObject *li) const
5128 return fieldT_buildSubPart(self,li);
5131 MEDCouplingFieldInt *__getitem__(PyObject *li) const
5133 return fieldT__getitem__(self,li);
5136 DataArrayInt *getArray()
5138 DataArrayInt *ret=self->getArray();
5147 double tmp0=self->getTime(tmp1,tmp2);
5148 PyObject *res = PyList_New(3);
5149 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5150 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5151 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5155 PyObject *getTinySerializationInformation() const
5157 return field_getTinySerializationInformation<MEDCouplingFieldInt>(self);
5160 PyObject *serialize() const
5162 return field_serialize<int>(self);
5165 PyObject *__getstate__() const
5167 return field__getstate__<MEDCouplingFieldInt>(self,MEDCoupling_MEDCouplingFieldInt_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt_serialize);
5170 void __setstate__(PyObject *inp)
5172 field__setstate__<int>(self,inp);
5177 class MEDCouplingFieldFloat : public MEDCouplingFieldT<float>
5180 static MEDCouplingFieldFloat *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5181 static MEDCouplingFieldFloat *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5182 bool isEqual(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
5183 bool isEqualWithoutConsideringStr(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
5184 void setTimeUnit(const std::string& unit);
5185 std::string getTimeUnit() const;
5186 void setTime(double val, int iteration, int order);
5187 void setArray(DataArrayFloat *array);
5188 MEDCouplingFieldFloat *deepCopy() const;
5189 MEDCouplingFieldFloat *clone(bool recDeepCpy) const;
5190 MEDCouplingFieldFloat *cloneWithMesh(bool recDeepCpy) const;
5191 MEDCouplingFieldDouble *convertToDblField() const;
5192 MEDCouplingFieldFloat *buildSubPartRange(int begin, int end, int step) const;
5194 MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5196 return MEDCouplingFieldFloat::New(type,td);
5199 MEDCouplingFieldFloat(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5201 return MEDCouplingFieldFloat::New(ft,td);
5204 PyObject *isEqualIfNotWhy(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const
5207 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5208 PyObject *ret=PyTuple_New(2);
5209 PyObject *ret0Py=ret0?Py_True:Py_False;
5211 PyTuple_SetItem(ret,0,ret0Py);
5212 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5216 std::string __str__() const
5218 return self->simpleRepr();
5221 std::string __repr__() const
5223 std::ostringstream oss;
5224 self->reprQuickOverview(oss);
5228 MEDCouplingFieldFloat *buildSubPart(PyObject *li) const
5230 return fieldT_buildSubPart(self,li);
5233 MEDCouplingFieldFloat *__getitem__(PyObject *li) const
5235 return fieldT__getitem__(self,li);
5238 DataArrayFloat *getArray()
5240 DataArrayFloat *ret=self->getArray();
5249 double tmp0=self->getTime(tmp1,tmp2);
5250 PyObject *res = PyList_New(3);
5251 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5252 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5253 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5257 PyObject *getTinySerializationInformation() const
5259 return field_getTinySerializationInformation<MEDCouplingFieldFloat>(self);
5262 PyObject *serialize() const
5264 return field_serialize<float>(self);
5267 PyObject *__getstate__() const
5269 return field__getstate__<MEDCouplingFieldFloat>(self,MEDCoupling_MEDCouplingFieldFloat_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldFloat_serialize);
5272 void __setstate__(PyObject *inp)
5274 field__setstate__<float>(self,inp);
5279 class MEDCouplingDefinitionTime
5282 MEDCouplingDefinitionTime();
5283 void assign(const MEDCouplingDefinitionTime& other);
5284 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5285 double getTimeResolution() const;
5286 std::vector<double> getHotSpotsTime() const;
5289 std::string __str__() const
5291 std::ostringstream oss;
5292 self->appendRepr(oss);
5296 PyObject *getIdsOnTimeRight(double tm) const
5298 int meshId,arrId,arrIdInField,fieldId;
5299 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5300 PyObject *res=PyList_New(4);
5301 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5302 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5303 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5304 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5308 PyObject *getIdsOnTimeLeft(double tm) const
5310 int meshId,arrId,arrIdInField,fieldId;
5311 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5312 PyObject *res=PyList_New(4);
5313 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5314 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5315 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5316 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5322 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5325 double getTimeTolerance() const;
5326 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5330 MEDCouplingFieldOverTime(PyObject *li)
5332 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5333 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5335 std::vector<MEDCouplingFieldDouble *> fs(sz);
5336 for(int i=0;i<sz;i++)
5337 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5338 return MEDCouplingFieldOverTime::New(fs);
5340 std::string __str__() const
5342 return self->simpleRepr();
5344 static MEDCouplingFieldOverTime *New(PyObject *li)
5346 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5347 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5349 std::vector<MEDCouplingFieldDouble *> fs(sz);
5350 for(int i=0;i<sz;i++)
5351 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5352 return MEDCouplingFieldOverTime::New(fs);
5357 class MEDCouplingCartesianAMRMesh;
5359 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5362 int getNumberOfCellsRecursiveWithOverlap() const;
5363 int getNumberOfCellsRecursiveWithoutOverlap() const;
5364 int getMaxNumberOfLevelsRelativeToThis() const;
5367 MEDCouplingCartesianAMRMeshGen *getMesh() const
5369 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5377 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5380 int getNumberOfOverlapedCellsForFather() const;
5381 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const;
5382 std::vector<int> computeCellGridSt() const;
5385 PyObject *getBLTRRange() const
5387 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5388 return convertFromVectorPairInt(ret);
5391 PyObject *getBLTRRangeRelativeToGF() const
5393 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5394 return convertFromVectorPairInt(ret);
5397 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors)
5399 std::vector< std::pair<int,int> > inp;
5400 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5401 self->addPatch(inp,factors);
5404 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const
5406 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5408 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5409 if(patchId==mesh->getNumberOfPatches())
5411 std::ostringstream oss;
5412 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5413 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5416 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5422 void __delitem__(int patchId)
5424 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5426 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5427 mesh->removePatch(patchId);
5432 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5434 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5435 return mesh->getNumberOfPatches();
5440 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5444 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5447 int getAbsoluteLevel() const;
5448 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
5449 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
5450 int getSpaceDimension() const;
5451 const std::vector<int>& getFactors() const;
5452 void setFactors(const std::vector<int>& newFactors);
5453 int getMaxNumberOfLevelsRelativeToThis() const;
5454 int getNumberOfCellsAtCurrentLevel() const;
5455 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const;
5456 int getNumberOfCellsRecursiveWithOverlap() const;
5457 int getNumberOfCellsRecursiveWithoutOverlap() const;
5458 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const;
5459 virtual void detachFromFather();
5461 int getNumberOfPatches() const;
5462 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const;
5463 MEDCouplingUMesh *buildUnstructured() const;
5464 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const;
5465 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const;
5466 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const;
5467 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const;
5468 void removeAllPatches();
5469 void removePatch(int patchId);
5470 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors);
5471 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps);
5472 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const;
5473 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const;
5474 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const;
5475 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const;
5476 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5477 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const;
5478 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const;
5479 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const;
5480 std::string buildPythonDumpOfThis() const;
5483 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors)
5485 std::vector< std::pair<int,int> > inp;
5486 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5487 self->addPatch(inp,factors);
5490 PyObject *getPatches() const
5492 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5494 PyObject *ret = PyList_New(sz);
5495 for(int i=0;i<sz;i++)
5497 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5500 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5505 // agy : don't know why typemap fails here ??? let it in the extend section
5506 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const
5508 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5511 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const
5513 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5514 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5520 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const
5522 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5523 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5529 virtual PyObject *positionRelativeToGodFather() const
5531 std::vector<int> out1;
5532 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5533 PyObject *ret(PyTuple_New(2));
5534 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5535 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5539 virtual PyObject *retrieveGridsAt(int absoluteLev) const
5541 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5543 PyObject *ret = PyList_New(sz);
5544 for(int i=0;i<sz;i++)
5545 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5549 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5551 std::vector<const DataArrayDouble *> inp;
5552 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5553 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5556 virtual MEDCouplingCartesianAMRMeshGen *getFather() const
5558 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5564 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const
5566 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5572 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const
5574 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5580 MEDCouplingIMesh *getImageMesh() const
5582 const MEDCouplingIMesh *ret(self->getImageMesh());
5585 return const_cast<MEDCouplingIMesh *>(ret);
5588 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const
5590 if(patchId==self->getNumberOfPatches())
5592 std::ostringstream oss;
5593 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5594 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5597 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5603 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const
5605 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5606 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5607 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5610 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5612 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5613 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5614 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5617 void __delitem__(int patchId)
5619 self->removePatch(patchId);
5624 return self->getNumberOfPatches();
5629 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5633 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5636 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh);
5639 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
5641 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5642 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5643 const int *nodeStrctPtr(0);
5644 const double *originPtr(0),*dxyzPtr(0);
5646 std::vector<int> bb0;
5647 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
5650 std::vector<double> bb,bb2;
5652 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5653 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5655 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5658 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps)
5660 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5661 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5662 std::vector< std::vector<int> > inp2;
5663 convertPyToVectorOfVectorOfInt(factors,inp2);
5664 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5667 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
5669 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5672 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh)
5674 return MEDCouplingCartesianAMRMesh::New(mesh);
5679 class MEDCouplingDataForGodFather : public RefCountObject
5682 virtual void synchronizeFineToCoarse();
5683 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev);
5684 virtual void synchronizeCoarseToFine();
5685 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev);
5686 virtual void synchronizeAllGhostZones();
5687 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh);
5688 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level);
5689 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level);
5690 virtual void alloc();
5691 virtual void dealloc();
5694 MEDCouplingCartesianAMRMesh *getMyGodFather()
5696 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5704 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5707 int getNumberOfLevels() const;
5708 MEDCouplingAMRAttribute *deepCopy() const;
5709 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const;
5710 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5711 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5712 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5713 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf);
5714 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const;
5715 std::string writeVTHB(const std::string& fileName) const;
5718 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev)
5720 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5721 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5722 MEDCouplingAMRAttribute *ret(0);
5725 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5726 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5728 catch(INTERP_KERNEL::Exception&)
5730 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5731 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5736 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev)
5738 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5741 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const
5743 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5744 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5750 void spillInfoOnComponents(PyObject *compNames)
5752 std::vector< std::vector<std::string> > compNamesCpp;
5753 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5754 self->spillInfoOnComponents(compNamesCpp);
5757 void spillNatures(PyObject *nfs)
5759 std::vector<int> inp0;
5760 if(!fillIntVector(nfs,inp0))
5761 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5762 std::size_t sz(inp0.size());
5763 std::vector<NatureOfField> inp00(sz);
5764 for(std::size_t i=0;i<sz;i++)
5765 inp00[i]=(NatureOfField)inp0[i];
5766 self->spillNatures(inp00);
5769 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const
5771 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5772 int sz((int)ret.size());
5773 PyObject *retPy(PyList_New(sz));
5774 for(int i=0;i<sz;i++)
5775 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5781 class DenseMatrix : public RefCountObject, public TimeLabel
5784 static DenseMatrix *New(int nbRows, int nbCols);
5785 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols);
5786 DenseMatrix *deepCopy() const;
5787 DenseMatrix *shallowCpy() const;
5789 int getNumberOfRows() const;
5790 int getNumberOfCols() const;
5791 int getNbOfElems() const;
5792 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1);
5793 void reShape(int nbRows, int nbCols);
5796 bool isEqual(const DenseMatrix& other, double eps) const;
5797 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const;
5798 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec);
5801 DenseMatrix(int nbRows, int nbCols)
5803 return DenseMatrix::New(nbRows,nbCols);
5806 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols)
5808 return DenseMatrix::New(array,nbRows,nbCols);
5811 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const
5814 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5815 PyObject *ret=PyTuple_New(2);
5816 PyObject *ret0Py=ret0?Py_True:Py_False;
5818 PyTuple_SetItem(ret,0,ret0Py);
5819 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5823 DataArrayDouble *getData()
5825 DataArrayDouble *ret(self->getData());
5831 DenseMatrix *__add__(const DenseMatrix *other)
5833 return MEDCoupling::DenseMatrix::Add(self,other);
5836 DenseMatrix *__sub__(const DenseMatrix *other)
5838 return MEDCoupling::DenseMatrix::Substract(self,other);
5841 DenseMatrix *__mul__(const DenseMatrix *other)
5843 return MEDCoupling::DenseMatrix::Multiply(self,other);
5846 DenseMatrix *__mul__(const DataArrayDouble *other)
5848 return MEDCoupling::DenseMatrix::Multiply(self,other);
5851 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other)
5853 self->addEqual(other);
5854 Py_XINCREF(trueSelf);
5858 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other)
5860 self->substractEqual(other);
5861 Py_XINCREF(trueSelf);
5865 PyObject *toNumPyMatrix() // not const. It is not a bug !
5867 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5876 def MEDCouplingUMeshReduce(self):
5877 return MEDCouplingStdReduceFunct,(MEDCouplingUMesh,((),(self.__getstate__()),))
5878 def MEDCouplingCMeshReduce(self):
5879 return MEDCouplingStdReduceFunct,(MEDCouplingCMesh,((),(self.__getstate__()),))
5880 def MEDCouplingIMeshReduce(self):
5881 return MEDCouplingStdReduceFunct,(MEDCouplingIMesh,((),(self.__getstate__()),))
5882 def MEDCouplingMappedExtrudedMeshReduce(self):
5883 return MEDCouplingStdReduceFunct,(MEDCouplingMappedExtrudedMesh,((),(self.__getstate__()),))
5884 def MEDCouplingCurveLinearMeshReduce(self):
5885 return MEDCouplingStdReduceFunct,(MEDCouplingCurveLinearMesh,((),(self.__getstate__()),))
5886 def MEDCoupling1SGTUMeshReduce(self):
5887 return MEDCouplingStdReduceFunct,(MEDCoupling1SGTUMesh,((),(self.__getstate__()),))
5888 def MEDCoupling1DGTUMeshReduce(self):
5889 return MEDCouplingStdReduceFunct,(MEDCoupling1DGTUMesh,((),(self.__getstate__()),))
5890 def MEDCouplingFieldDoubleReduce(self):
5891 self.checkConsistencyLight()
5892 d=(self.getTypeOfField(),self.getTimeDiscretization())
5893 return MEDCouplingStdReduceFunct,(MEDCouplingFieldDouble,(d,(self.__getstate__()),))
5894 def MEDCouplingFieldIntReduce(self):
5895 self.checkConsistencyLight()
5896 d=(self.getTypeOfField(),self.getTimeDiscretization())
5897 return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt,(d,(self.__getstate__()),))
5898 def MEDCouplingFieldFloatReduce(self):
5899 self.checkConsistencyLight()
5900 d=(self.getTypeOfField(),self.getTimeDiscretization())
5901 return MEDCouplingStdReduceFunct,(MEDCouplingFieldFloat,(d,(self.__getstate__()),))
5904 # Forwarding DataArrayInt functions to MEDCouplingUMesh:
5906 MEDCouplingUMesh.ExtractFromIndexedArrays = DataArrayInt.ExtractFromIndexedArrays
5907 MEDCouplingUMesh.ExtractFromIndexedArraysSlice = DataArrayInt.ExtractFromIndexedArraysSlice
5908 MEDCouplingUMesh.SetPartOfIndexedArrays = DataArrayInt.SetPartOfIndexedArrays
5909 ##MEDCouplingUMesh.SetPartOfIndexedArraysSlice = DataArrayInt.SetPartOfIndexedArraysSlice
5910 MEDCouplingUMesh.SetPartOfIndexedArraysSameIdx = DataArrayInt.SetPartOfIndexedArraysSameIdx
5911 MEDCouplingUMesh.RemoveIdsFromIndexedArrays = DataArrayInt.RemoveIdsFromIndexedArrays
5912 ##MEDCouplingUMesh.SetPartOfIndexedArraysSameIdxSlice = DataArrayInt.SetPartOfIndexedArraysSameIdxSlice
5918 __filename=os.environ.get('PYTHONSTARTUP')
5919 if __filename and os.path.isfile(__filename):
5920 exec(open(__filename).read())