1 // Copyright (C) 2017-2021 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 "MEDCouplingMemArray.txx"
31 #include "MEDCouplingUMesh.hxx"
32 #include "MEDCouplingMappedExtrudedMesh.hxx"
33 #include "MEDCouplingCMesh.hxx"
34 #include "MEDCouplingIMesh.hxx"
35 #include "MEDCouplingMap.txx"
36 #include "MEDCouplingCurveLinearMesh.hxx"
37 #include "MEDCoupling1GTUMesh.hxx"
38 #include "MEDCouplingField.hxx"
39 #include "MEDCouplingFieldDouble.hxx"
40 #include "MEDCouplingFieldInt32.hxx"
41 #include "MEDCouplingFieldInt64.hxx"
42 #include "MEDCouplingFieldFloat.hxx"
43 #include "MEDCouplingFieldTemplate.hxx"
44 #include "MEDCouplingGaussLocalization.hxx"
46 #include "MEDCouplingMultiFields.hxx"
47 #include "MEDCouplingFieldOverTime.hxx"
48 #include "MEDCouplingDefinitionTime.hxx"
49 #include "MEDCouplingFieldDiscretization.hxx"
50 #include "MEDCouplingCartesianAMRMesh.hxx"
51 #include "MEDCouplingAMRAttribute.hxx"
52 #include "MEDCouplingMatrix.hxx"
53 #include "MEDCouplingPartDefinition.hxx"
54 #include "MEDCouplingSkyLineArray.hxx"
55 #include "MEDCouplingTypemaps.i"
57 #include "InterpKernelAutoPtr.hxx"
58 #include "BoxSplittingOptions.hxx"
60 using namespace MEDCoupling;
61 using namespace INTERP_KERNEL;
65 %template(dvec) std::vector<double>;
66 %template(svec) std::vector<std::string>;
70 #ifndef MEDCOUPLING_USE_64BIT_IDS
71 //typedef std::int32_t mcIdType;
73 typedef DataArrayInt32 DataArrayIdType;
74 %template(ivec) std::vector<int>;
75 %template(i64vec) std::vector<long>;
77 //typedef std::int64_t mcIdType;
78 typedef DataArrayInt64 DataArrayIdType;
80 %template(ivec) std::vector<long long>;
81 typedef long long mcIdType;
83 %template(ivec) std::vector<long>;
84 typedef long int mcIdType;
86 %template(i32vec) std::vector<int>;
91 %typemap(out) MEDCoupling::MEDCouplingMesh*
93 $result=convertMesh($1,$owner);
96 %typemap(out) MEDCouplingMesh*
98 $result=convertMesh($1,$owner);
103 %typemap(out) MEDCoupling::MEDCouplingPointSet*
105 $result=convertMesh($1,$owner);
108 %typemap(out) MEDCouplingPointSet*
110 $result=convertMesh($1,$owner);
115 %typemap(out) MEDCouplingCartesianAMRPatchGen*
117 $result=convertCartesianAMRPatch($1,$owner);
122 %typemap(out) MEDCouplingCartesianAMRMeshGen*
124 $result=convertCartesianAMRMesh($1,$owner);
129 %typemap(out) MEDCouplingDataForGodFather*
131 $result=convertDataForGodFather($1,$owner);
136 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
138 $result=convertMesh($1,$owner);
141 %typemap(out) MEDCoupling1GTUMesh*
143 $result=convertMesh($1,$owner);
148 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
150 $result=convertMesh($1,$owner);
153 %typemap(out) MEDCouplingStructuredMesh*
155 $result=convertMesh($1,$owner);
160 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
162 $result=convertFieldDiscretization($1,$owner);
165 %typemap(out) MEDCouplingFieldDiscretization*
167 $result=convertFieldDiscretization($1,$owner);
172 %typemap(out) MEDCoupling::MEDCouplingField*
174 $result=convertField($1,$owner);
177 %typemap(out) MEDCouplingField*
179 $result=convertField($1,$owner);
184 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
186 $result=convertMultiFields($1,$owner);
189 %typemap(out) MEDCouplingMultiFields*
191 $result=convertMultiFields($1,$owner);
196 %typemap(out) MEDCoupling::PartDefinition*
198 $result=convertPartDefinition($1,$owner);
201 %typemap(out) PartDefinition*
203 $result=convertPartDefinition($1,$owner);
208 %init %{ import_array(); %}
211 %init %{ initializeMe(); %}
213 %feature("autodoc", "1");
214 %feature("docstring");
216 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
217 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
218 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToFloatField;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
235 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
236 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
237 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
238 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
239 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
240 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
241 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
242 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
243 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
244 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
245 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
246 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
247 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
248 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
249 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
250 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
251 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
252 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
253 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
254 %newobject MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear;
255 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
256 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
257 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
258 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
259 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
260 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
261 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
262 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
263 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
264 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
265 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
266 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
267 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
268 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
269 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
270 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
271 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
272 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
273 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
274 %newobject MEDCoupling::MEDCouplingFieldInt32::New;
275 %newobject MEDCoupling::MEDCouplingFieldInt32::convertToDblField;
276 %newobject MEDCoupling::MEDCouplingFieldInt32::getArray;
277 %newobject MEDCoupling::MEDCouplingFieldInt32::deepCopy;
278 %newobject MEDCoupling::MEDCouplingFieldInt32::clone;
279 %newobject MEDCoupling::MEDCouplingFieldInt32::cloneWithMesh;
280 %newobject MEDCoupling::MEDCouplingFieldInt32::buildSubPart;
281 %newobject MEDCoupling::MEDCouplingFieldInt32::buildSubPartRange;
282 %newobject MEDCoupling::MEDCouplingFieldInt32::__getitem__;
283 %newobject MEDCoupling::MEDCouplingFieldInt64::New;
284 %newobject MEDCoupling::MEDCouplingFieldInt64::convertToDblField;
285 %newobject MEDCoupling::MEDCouplingFieldInt64::getArray;
286 %newobject MEDCoupling::MEDCouplingFieldInt64::deepCopy;
287 %newobject MEDCoupling::MEDCouplingFieldInt64::clone;
288 %newobject MEDCoupling::MEDCouplingFieldInt64::cloneWithMesh;
289 %newobject MEDCoupling::MEDCouplingFieldInt64::buildSubPart;
290 %newobject MEDCoupling::MEDCouplingFieldInt64::buildSubPartRange;
291 %newobject MEDCoupling::MEDCouplingFieldInt64::__getitem__;
292 %newobject MEDCoupling::MEDCouplingFieldFloat::New;
293 %newobject MEDCoupling::MEDCouplingFieldFloat::convertToDblField;
294 %newobject MEDCoupling::MEDCouplingFieldFloat::getArray;
295 %newobject MEDCoupling::MEDCouplingFieldFloat::deepCopy;
296 %newobject MEDCoupling::MEDCouplingFieldFloat::clone;
297 %newobject MEDCoupling::MEDCouplingFieldFloat::cloneWithMesh;
298 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPart;
299 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPartRange;
300 %newobject MEDCoupling::MEDCouplingFieldFloat::__getitem__;
301 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
302 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
303 %newobject MEDCoupling::MEDCouplingMesh::clone;
304 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
305 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
306 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
307 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
308 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
309 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
310 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
311 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
312 %newobject MEDCoupling::MEDCouplingMesh::computeMeshCenterOfMass;
313 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
314 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
315 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
316 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
317 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
318 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
319 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
320 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
321 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
322 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
323 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
324 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
325 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
326 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
327 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
328 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
329 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
330 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
331 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
332 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
333 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
334 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
335 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
336 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
337 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
338 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
339 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
340 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
341 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
342 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
343 %newobject MEDCoupling::MEDCouplingUMesh::New;
344 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
345 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
346 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
347 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
348 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
349 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
350 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
351 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
352 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
353 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
354 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
355 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
356 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
357 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
358 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
359 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
360 %newobject MEDCoupling::MEDCouplingUMesh::conformize3D;
361 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
362 %newobject MEDCoupling::MEDCouplingUMesh::colinearizeKeepingConform2D;
363 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
364 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
365 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
366 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
367 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
368 %newobject MEDCoupling::MEDCouplingUMesh::findNodesToDuplicate;
369 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
370 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
371 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
372 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
373 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
374 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
375 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
376 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
377 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
378 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
379 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
380 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
381 %newobject MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords;
382 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
383 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
384 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
385 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
386 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
387 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
388 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
389 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
390 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
391 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
392 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
393 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
394 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
395 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
396 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
397 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
398 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
399 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
400 %newobject MEDCoupling::MEDCouplingUMesh::convertDegeneratedCellsAndRemoveFlatOnes;
401 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
402 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
403 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
404 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
405 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
406 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
407 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
408 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
409 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
410 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
411 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
412 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
413 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
414 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
415 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
416 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
417 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
418 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
419 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
420 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
421 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
422 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
423 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
424 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
425 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
426 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
427 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
428 %newobject MEDCoupling::MEDCouplingCMesh::New;
429 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
430 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
431 %newobject MEDCoupling::MEDCouplingIMesh::New;
432 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
433 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
434 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
435 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
436 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
437 %newobject MEDCoupling::MEDCouplingMultiFields::New;
438 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
439 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
440 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
441 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
442 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
443 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
444 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
445 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
446 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
447 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
448 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
449 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
450 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
451 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
452 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
453 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
454 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
455 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
456 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
457 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
458 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
459 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
460 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
461 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
462 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
463 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
464 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
465 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
466 %newobject MEDCoupling::DenseMatrix::New;
467 %newobject MEDCoupling::DenseMatrix::deepCopy;
468 %newobject MEDCoupling::DenseMatrix::shallowCpy;
469 %newobject MEDCoupling::DenseMatrix::getData;
470 %newobject MEDCoupling::DenseMatrix::matVecMult;
471 %newobject MEDCoupling::DenseMatrix::MatVecMult;
472 %newobject MEDCoupling::DenseMatrix::__add__;
473 %newobject MEDCoupling::DenseMatrix::__sub__;
474 %newobject MEDCoupling::DenseMatrix::__mul__;
475 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
476 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
477 %newobject MEDCoupling::MEDCouplingSkyLineArray::BuildFromPolyhedronConn;
478 %newobject MEDCoupling::MEDCouplingSkyLineArray::getSuperIndexArray;
479 %newobject MEDCoupling::MEDCouplingSkyLineArray::getIndexArray;
480 %newobject MEDCoupling::MEDCouplingSkyLineArray::getValuesArray;
481 %newobject MEDCoupling::MEDCouplingSkyLineArray::groupPacks;
482 %newobject MEDCoupling::MEDCouplingSkyLineArray::uniqueNotSortedByPack;
483 %newobject MEDCoupling::MEDCouplingSkyLineArray::AggregatePacks;
484 %newobject MEDCoupling::MEDCouplingSkyLineArray::deepCopy;
486 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
487 %feature("unref") MEDCouplingMesh "$this->decrRef();"
488 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
489 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
490 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
491 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
492 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
493 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
494 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
495 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
496 %feature("unref") MEDCouplingField "$this->decrRef();"
497 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
498 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
499 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
500 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
501 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
502 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
503 %feature("unref") MEDCouplingFieldFloat "$this->decrRef();"
504 %feature("unref") MEDCouplingFieldInt32 "$this->decrRef();"
505 %feature("unref") MEDCouplingFieldInt64 "$this->decrRef();"
506 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
507 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
508 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
509 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
510 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
511 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
512 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
513 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
514 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
515 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
516 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
517 %feature("unref") DenseMatrix "$this->decrRef();"
518 %feature("unref") MEDCouplingSkyLineArray "$this->decrRef();"
520 %rename(assign) *::operator=;
521 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
522 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
523 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
524 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
528 // ABN: Instruct SWIG that INTERP_KERNEL::Exception is an exception class and that it should inherit Exception
529 // on the Python side. Must be put BEFORE the %rename clause:
530 %exceptionclass INTERP_KERNEL::Exception;
531 %rename (InterpKernelException) INTERP_KERNEL::Exception;
533 %include "MEDCouplingRefCountObject.i"
534 %include "MEDCouplingMemArray.i"
538 {// AGY : here initialization of C++ traits in MEDCouplingDataArrayTypemaps.i for code factorization. Awful, I know, but no other solutions.
539 SWIGTITraits<double>::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble;
540 SWIGTITraits<float>::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat;
541 SWIGTITraits<Int32>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt32;
542 SWIGTITraits<Int64>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt64;
543 SWIGTITraits<double>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple;
544 SWIGTITraits<float>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayFloatTuple;
545 SWIGTITraits<Int32>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayInt32Tuple;
546 SWIGTITraits<Int64>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayInt64Tuple;
552 PyObject *med2vtk_cell_types()
554 Py_ssize_t sz(sizeof(MEDCOUPLING2VTKTYPETRADUCER)/sizeof(decltype(MEDCOUPLING2VTKTYPETRADUCER[0])));
555 PyObject *ret(PyList_New(sz));
556 for(Py_ssize_t i=0;i<sz;i++)
558 mcIdType elt = MEDCOUPLING2VTKTYPETRADUCER[i]!=MEDCOUPLING2VTKTYPETRADUCER_NONE ? MEDCOUPLING2VTKTYPETRADUCER[i] : -1;
559 PyList_SetItem(ret,i,PyInt_FromLong(elt));
564 PyObject *vtk2med_cell_types()
566 Py_ssize_t sz(sizeof(MEDCOUPLING2VTKTYPETRADUCER)/sizeof(decltype(MEDCOUPLING2VTKTYPETRADUCER[0])));
567 auto maxElt(*std::max_element(MEDCOUPLING2VTKTYPETRADUCER,MEDCOUPLING2VTKTYPETRADUCER+sz,[](unsigned char a, unsigned char b) { if(b==MEDCOUPLING2VTKTYPETRADUCER_NONE) return false; else return a<b; } ));
568 auto szOut(maxElt+1);
569 std::vector< mcIdType > retCpp(szOut,-1);
571 for(const unsigned char *it=MEDCOUPLING2VTKTYPETRADUCER;it!=MEDCOUPLING2VTKTYPETRADUCER+sz;it++,id++)
573 if(*it!=MEDCOUPLING2VTKTYPETRADUCER_NONE)
577 PyObject *ret(PyList_New(szOut));
579 for(auto it=retCpp.begin();it!=retCpp.end();it++,id++)
580 PyList_SetItem(ret,id,PyInt_FromLong(*it));
584 PyObject *AllGeometricTypes()
586 Py_ssize_t sz(MEDCouplingUMesh::N_MEDMEM_ORDER);
587 PyObject *ret(PyList_New(sz));
588 for(Py_ssize_t i=0;i<sz;i++)
589 PyList_SetItem(ret,i,PyInt_FromLong(MEDCouplingUMesh::MEDMEM_ORDER[i]));
594 namespace INTERP_KERNEL
597 * \class BoxSplittingOptions
598 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
600 class BoxSplittingOptions
603 BoxSplittingOptions();
605 double getEfficiencyGoal() const;
606 void setEfficiencyGoal(double efficiency);
607 double getEfficiencyThreshold() const;
608 void setEfficiencyThreshold(double efficiencyThreshold);
609 int getMinimumPatchLength() const;
610 void setMinimumPatchLength(int minPatchLength);
611 int getMaximumPatchLength() const;
612 void setMaximumPatchLength(int maxPatchLength);
613 int getMaximumNbOfCellsInPatch() const;
614 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch);
615 void copyOptions(const BoxSplittingOptions & other);
616 std::string printOptions() const;
619 std::string __str__() const
621 return self->printOptions();
627 namespace MEDCoupling
643 CONST_ON_TIME_INTERVAL = 7
644 } TypeOfTimeDiscretization;
652 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
653 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
655 } MEDCouplingMeshType;
657 class DataArrayInt32;
658 class DataArrayInt64;
659 class DataArrayDouble;
660 class MEDCouplingUMesh;
661 class MEDCouplingCMesh;
662 class MEDCouplingFieldDouble;
664 %extend RefCountObject
666 std::string getHiddenCppPointer() const
668 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
673 %extend MEDCouplingGaussLocalization
675 std::string __str__() const
677 return self->getStringRepr();
680 std::string __repr__() const
682 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
683 oss << self->getStringRepr();
690 class MEDCouplingMesh : public RefCountObject, public TimeLabel
693 void setName(const std::string& name);
694 std::string getName() const;
695 void setDescription(const std::string& descr);
696 std::string getDescription() const;
697 void setTime(double val, int iteration, int order);
698 void setTimeUnit(const std::string& unit);
699 std::string getTimeUnit() const;
700 virtual MEDCouplingMeshType getType() const;
701 bool isStructured() const;
702 virtual MEDCouplingMesh *deepCopy() const;
703 virtual MEDCouplingMesh *clone(bool recDeepCpy) const;
704 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const;
705 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
706 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const;
707 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other);
708 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other);
709 virtual void checkConsistencyLight() const;
710 virtual void checkConsistency(double eps=1e-12) const;
711 virtual int getNumberOfCells() const;
712 virtual int getNumberOfNodes() const;
713 virtual int getSpaceDimension() const;
714 virtual int getMeshDimension() const;
715 virtual DataArrayDouble *getCoordinatesAndOwner() const;
716 virtual DataArrayDouble *computeCellCenterOfMass() const;
717 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
718 virtual DataArrayIdType *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
719 virtual DataArrayIdType *computeNbOfNodesPerCell() const;
720 virtual DataArrayIdType *computeNbOfFacesPerCell() const;
721 virtual DataArrayIdType *computeEffectiveNbOfNodesPerCell() const;
722 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const;
723 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
724 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
725 virtual std::string simpleRepr() const;
726 virtual std::string advancedRepr() const;
727 std::string writeVTK(const std::string& fileName, bool isBinary=true) const;
728 virtual std::string getVTKFileExtension() const;
729 std::string getVTKFileNameOf(const std::string& fileName) const;
731 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const;
732 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const;
733 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const;
734 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const;
735 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const;
736 virtual MEDCouplingFieldDouble *buildOrthogonalField() const;
737 virtual MEDCouplingUMesh *buildUnstructured() const;
738 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
739 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const;
740 virtual DataArrayIdType *simplexize(int policy);
741 virtual void unserialization(const std::vector<double>& tinyInfoD, const std::vector<mcIdType>& tinyInfo, const DataArrayIdType *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings);
742 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2);
743 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type);
744 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type);
745 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type);
746 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
747 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
748 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
751 std::string __str__() const
753 return self->simpleRepr();
756 DataArrayDouble *computeMeshCenterOfMass() const
758 MCAuto<DataArrayDouble> ret(self->computeMeshCenterOfMass());
765 double tmp0=self->getTime(tmp1,tmp2);
766 PyObject *res = PyList_New(3);
767 PyList_SetItem(res,0,SWIG_From_double(tmp0));
768 PyList_SetItem(res,1,SWIG_From_int(tmp1));
769 PyList_SetItem(res,2,SWIG_From_int(tmp2));
773 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const
775 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
776 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
782 mcIdType getCellContainingPoint(PyObject *p, double eps) const
786 DataArrayDoubleTuple *aa;
787 std::vector<double> bb;
789 int spaceDim=self->getSpaceDimension();
790 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
791 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
792 return self->getCellContainingPoint(pos,eps);
795 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const
799 DataArrayDoubleTuple *aa;
800 std::vector<double> bb;
802 int spaceDim=self->getSpaceDimension();
803 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
804 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
805 MCAuto<DataArrayIdType> elts,eltsIndex;
806 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
807 PyObject *ret=PyTuple_New(2);
808 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
809 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
813 PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, int nbOfPoints, double eps) const
817 DataArrayDoubleTuple *aa;
818 std::vector<double> bb;
820 int spaceDim=self->getSpaceDimension();
821 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPointsLinearPartOnlyOnNonDynType : ";
822 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
823 MCAuto<DataArrayIdType> elts,eltsIndex;
824 self->getCellsContainingPointsLinearPartOnlyOnNonDynType(pos,nbOfPoints,eps,elts,eltsIndex);
825 PyObject *ret=PyTuple_New(2);
826 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
827 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
831 PyObject *getCellsContainingPoints(PyObject *p, double eps) const
833 auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayIdType>& d, MCAuto<DataArrayIdType>& e) { self->getCellsContainingPoints(a,b,c,d,e); };
834 return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
837 PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, double eps) const
839 auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayIdType>& d, MCAuto<DataArrayIdType>& e) { self->getCellsContainingPointsLinearPartOnlyOnNonDynType(a,b,c,d,e); };
840 return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
843 PyObject *getCellsContainingPoint(PyObject *p, double eps) const
847 DataArrayDoubleTuple *aa;
848 std::vector<double> bb;
850 int spaceDim=self->getSpaceDimension();
851 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
852 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
853 std::vector<mcIdType> elts;
854 self->getCellsContainingPoint(pos,eps,elts);
855 DataArrayIdType *ret=DataArrayIdType::New();
856 ret->alloc((int)elts.size(),1);
857 std::copy(elts.begin(),elts.end(),ret->getPointer());
858 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
861 virtual PyObject *getReverseNodalConnectivity() const
863 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
864 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
865 self->getReverseNodalConnectivity(d0,d1);
866 PyObject *ret=PyTuple_New(2);
867 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
868 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
872 void renumberCells(PyObject *li, bool check=true)
875 mcIdType v0; std::vector<mcIdType> v1;
876 const mcIdType *ids(convertIntStarLikePyObjToCppIntStar(li,sw,sz,v0,v1));
877 self->renumberCells(ids,check);
880 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const
882 DataArrayIdType *cellCor, *nodeCor;
883 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
884 PyObject *res = PyList_New(2);
885 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTITraits<mcIdType>::TI, cellCor?SWIG_POINTER_OWN | 0:0 ));
886 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTITraits<mcIdType>::TI, nodeCor?SWIG_POINTER_OWN | 0:0 ));
890 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const
892 DataArrayIdType *cellCor=0,*nodeCor=0;
893 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
894 PyObject *res = PyList_New(2);
895 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTITraits<mcIdType>::TI, cellCor?SWIG_POINTER_OWN | 0:0 ));
896 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTITraits<mcIdType>::TI, nodeCor?SWIG_POINTER_OWN | 0:0 ));
900 DataArrayIdType *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const
902 DataArrayIdType *cellCor=0;
903 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
907 DataArrayIdType *getCellIdsFullyIncludedInNodeIds(PyObject *li) const
910 int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
911 if (!SWIG_IsOK(res1))
914 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
915 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const mcIdType *)tmp)+size);
919 DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
921 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
922 da2->checkAllocated();
923 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
926 PyObject *getNodeIdsOfCell(int cellId) const
928 std::vector<mcIdType> conn;
929 self->getNodeIdsOfCell(cellId,conn);
930 return convertIntArrToPyList2(conn);
933 PyObject *getCoordinatesOfNode(mcIdType nodeId) const
935 std::vector<double> coo;
936 self->getCoordinatesOfNode(nodeId,coo);
937 return convertDblArrToPyList2(coo);
940 void scale(PyObject *point, double factor)
944 DataArrayDoubleTuple *aa;
945 std::vector<double> bb;
947 int spaceDim=self->getSpaceDimension();
948 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
949 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
950 self->scale(pointPtr,factor);
953 PyObject *getBoundingBox() const
955 int spaceDim=self->getSpaceDimension();
956 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
957 self->getBoundingBox(tmp);
958 PyObject *ret=convertDblArrToPyListOfTuple<double>(tmp,2,spaceDim);
962 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const
965 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
966 PyObject *ret=PyTuple_New(2);
967 PyObject *ret0Py=ret0?Py_True:Py_False;
969 PyTuple_SetItem(ret,0,ret0Py);
970 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
974 PyObject *buildPart(PyObject *li) const
976 mcIdType szArr,sw,iTypppArr;
977 std::vector<mcIdType> stdvecTyyppArr;
978 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
979 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
980 if(sw==3)//DataArrayIdType
982 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
983 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
984 std::string name=argpt->getName();
986 ret->setName(name.c_str());
988 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
991 PyObject *buildPartAndReduceNodes(PyObject *li) const
993 mcIdType szArr,sw,iTypppArr;
994 std::vector<mcIdType> stdvecTyyppArr;
995 DataArrayIdType *arr=0;
996 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
997 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
998 if(sw==3)//DataArrayIdType
1000 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1001 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1002 std::string name=argpt->getName();
1004 ret->setName(name.c_str());
1007 PyObject *res = PyList_New(2);
1008 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
1009 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1010 PyList_SetItem(res,0,obj0);
1011 PyList_SetItem(res,1,obj1);
1015 PyObject *buildPartRangeAndReduceNodes(mcIdType beginCellIds, mcIdType endCellIds, mcIdType stepCellIds) const
1018 DataArrayIdType *arr=0;
1019 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
1020 PyObject *res = PyTuple_New(2);
1021 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
1024 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1026 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
1027 PyTuple_SetItem(res,0,obj0);
1028 PyTuple_SetItem(res,1,obj1);
1032 PyObject *getDistributionOfTypes() const
1034 std::vector<mcIdType> vals=self->getDistributionOfTypes();
1035 if(vals.size()%3!=0)
1036 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
1037 PyObject *ret=PyList_New((mcIdType)vals.size()/3);
1038 for(std::size_t j=0;j<vals.size()/3;j++)
1040 PyObject *ret1=PyList_New(3);
1041 PyList_SetItem(ret1,0,PyInt_FromLong(vals[3*j]));
1042 PyList_SetItem(ret1,1,PyInt_FromLong(vals[3*j+1]));
1043 PyList_SetItem(ret1,2,PyInt_FromLong(vals[3*j+2]));
1044 PyList_SetItem(ret,j,ret1);
1049 DataArrayIdType *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const
1051 std::vector<mcIdType> code;
1052 std::vector<const DataArrayIdType *> idsPerType;
1053 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li2,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",idsPerType);
1054 convertPyToNewIntArr4(li,1,3,code);
1055 return self->checkTypeConsistencyAndContig(code,idsPerType);
1058 PyObject *splitProfilePerType(const DataArrayIdType *profile, bool smartPflKiller=true) const
1060 std::vector<mcIdType> code;
1061 std::vector<DataArrayIdType *> idsInPflPerType;
1062 std::vector<DataArrayIdType *> idsPerType;
1063 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType,smartPflKiller);
1064 PyObject *ret=PyTuple_New(3);
1066 if(code.size()%3!=0)
1067 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
1068 PyObject *ret0=PyList_New((mcIdType)code.size()/3);
1069 for(std::size_t j=0;j<code.size()/3;j++)
1071 PyObject *ret00=PyList_New(3);
1072 PyList_SetItem(ret00,0,PyInt_FromLong(code[3*j]));
1073 PyList_SetItem(ret00,1,PyInt_FromLong(code[3*j+1]));
1074 PyList_SetItem(ret00,2,PyInt_FromLong(code[3*j+2]));
1075 PyList_SetItem(ret0,j,ret00);
1077 PyTuple_SetItem(ret,0,ret0);
1079 PyObject *ret1=PyList_New(idsInPflPerType.size());
1080 for(std::size_t j=0;j<idsInPflPerType.size();j++)
1081 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1082 PyTuple_SetItem(ret,1,ret1);
1083 std::size_t n=idsPerType.size();
1084 PyObject *ret2=PyList_New(n);
1085 for(std::size_t i=0;i<n;i++)
1086 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1087 PyTuple_SetItem(ret,2,ret2);
1091 void translate(PyObject *vector)
1095 DataArrayDoubleTuple *aa;
1096 std::vector<double> bb;
1098 int spaceDim=self->getSpaceDimension();
1099 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1100 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1101 self->translate(vectorPtr);
1104 void rotate(PyObject *center, double alpha)
1106 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1109 DataArrayDoubleTuple *aa;
1110 std::vector<double> bb;
1112 int spaceDim=self->getSpaceDimension();
1113 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1114 self->rotate(centerPtr,0,alpha);
1117 void rotate(PyObject *center, PyObject *vector, double alpha)
1119 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1121 DataArrayDouble *a,*a2;
1122 DataArrayDoubleTuple *aa,*aa2;
1123 std::vector<double> bb,bb2;
1125 int spaceDim=self->getSpaceDimension();
1126 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1127 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
1128 self->rotate(centerPtr,vectorPtr,alpha);
1131 PyObject *getAllGeoTypes() const
1133 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1134 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1135 PyObject *res=PyList_New(result.size());
1136 for(int i=0;iL!=result.end(); i++, iL++)
1137 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1141 virtual PyObject *getTinySerializationInformation() const
1143 std::vector<double> a0;
1144 std::vector<mcIdType> a1;
1145 std::vector<std::string> a2;
1146 self->getTinySerializationInformation(a0,a1,a2);
1147 PyObject *ret(PyTuple_New(3));
1148 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1149 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1150 std::size_t sz(a2.size());
1151 PyObject *ret2(PyList_New(sz));
1153 for(std::size_t i=0;i<sz;i++)
1154 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1156 PyTuple_SetItem(ret,2,ret2);
1160 virtual PyObject *serialize() const
1162 DataArrayIdType *a0Tmp(0);
1163 DataArrayDouble *a1Tmp(0);
1164 self->serialize(a0Tmp,a1Tmp);
1165 PyObject *ret(PyTuple_New(2));
1166 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1167 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1171 void resizeForUnserialization(const std::vector<mcIdType>& tinyInfo, DataArrayIdType *a1, DataArrayDouble *a2) const
1173 std::vector<std::string> littleStrings;
1174 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1177 PyObject *__getstate__() const
1179 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1180 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1181 PyObject *ret(PyTuple_New(2));
1182 PyTuple_SetItem(ret,0,ret0);
1183 PyTuple_SetItem(ret,1,ret1);
1187 void __setstate__(PyObject *inp)
1189 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1190 if(!PyTuple_Check(inp))
1191 throw INTERP_KERNEL::Exception(MSG);
1192 std::size_t sz(PyTuple_Size(inp));
1194 throw INTERP_KERNEL::Exception(MSG);
1195 PyObject *elt0(PyTuple_GetItem(inp,0));
1196 PyObject *elt1(PyTuple_GetItem(inp,1));
1197 std::vector<double> a0;
1198 std::vector<mcIdType> a1;
1199 std::vector<std::string> a2;
1200 DataArrayIdType *b0(0);
1201 DataArrayDouble *b1(0);
1203 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1204 throw INTERP_KERNEL::Exception(MSG);
1205 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1207 fillArrayWithPyListDbl3(a0py,tmp,a0);
1208 convertPyToNewIntArr3(a1py,a1);
1209 fillStringVector(a2py,a2);
1212 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1213 throw INTERP_KERNEL::Exception(MSG);
1214 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1216 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTITraits<mcIdType>::TI,0|0));
1217 if(!SWIG_IsOK(status))
1218 throw INTERP_KERNEL::Exception(MSG);
1219 b0=reinterpret_cast<DataArrayIdType *>(argp);
1220 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1221 if(!SWIG_IsOK(status))
1222 throw INTERP_KERNEL::Exception(MSG);
1223 b1=reinterpret_cast<DataArrayDouble *>(argp);
1225 // useless here to call resizeForUnserialization because arrays are well resized.
1226 self->unserialization(a0,a1,b0,b1,a2);
1229 static MEDCouplingMesh *MergeMeshes(PyObject *li)
1231 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1232 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1233 return MEDCouplingMesh::MergeMeshes(tmp);
1239 //== MEDCouplingMesh End
1241 %include "NormalizedGeometricTypes"
1242 %include "MEDCouplingNatureOfFieldEnum"
1244 namespace MEDCoupling
1246 class MEDCouplingNatureOfField
1249 static const char *GetRepr(NatureOfField nat);
1250 static std::string GetReprNoThrow(NatureOfField nat);
1251 static std::string GetAllPossibilitiesStr();
1255 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1256 // include "MEDCouplingTimeDiscretization.i"
1258 namespace MEDCoupling
1260 class MEDCouplingGaussLocalization
1263 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1264 const std::vector<double>& gsCoo, const std::vector<double>& w);
1265 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ);
1266 INTERP_KERNEL::NormalizedCellType getType() const;
1267 void setType(INTERP_KERNEL::NormalizedCellType typ);
1268 int getNumberOfGaussPt() const;
1269 int getDimension() const;
1270 int getNumberOfPtsInRefCell() const;
1271 std::string getStringRepr() const;
1272 void checkConsistencyLight() const;
1273 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const;
1275 const std::vector<double>& getRefCoords() const;
1276 double getRefCoord(int ptIdInCell, int comp) const;
1277 const std::vector<double>& getGaussCoords() const;
1278 double getGaussCoord(int gaussPtIdInCell, int comp) const;
1279 const std::vector<double>& getWeights() const;
1280 double getWeight(int gaussPtIdInCell, double newVal) const;
1281 void setRefCoord(int ptIdInCell, int comp, double newVal);
1282 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal);
1283 void setWeight(int gaussPtIdInCell, double newVal);
1284 void setRefCoords(const std::vector<double>& refCoo);
1285 void setGaussCoords(const std::vector<double>& gsCoo);
1286 void setWeights(const std::vector<double>& w);
1288 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1292 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const
1294 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1298 MEDCouplingUMesh *buildRefCell() const
1300 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1306 class MEDCouplingSkyLineArray
1309 static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayIdType* c, const DataArrayIdType* cI );
1311 void set( DataArrayIdType* index, DataArrayIdType* value );
1312 void set3( DataArrayIdType* superIndex, DataArrayIdType* index, DataArrayIdType* value );
1314 int getSuperNumberOf() const;
1315 int getNumberOf() const;
1316 int getLength() const;
1318 void deletePack(const int i, const int j);
1320 void deleteSimplePack(const int i);
1321 void deleteSimplePacks(const DataArrayIdType* idx);
1323 MEDCouplingSkyLineArray *groupPacks(const DataArrayIdType *indexedPacks) const;
1324 MEDCouplingSkyLineArray *uniqueNotSortedByPack() const;
1326 MEDCouplingSkyLineArray *deepCopy() const;
1330 MEDCouplingSkyLineArray()
1332 return MEDCouplingSkyLineArray::New();
1335 MEDCouplingSkyLineArray( const std::vector<mcIdType>& index, const std::vector<mcIdType>& value)
1337 return MEDCouplingSkyLineArray::New(index, value);
1340 MEDCouplingSkyLineArray( DataArrayIdType* index, DataArrayIdType* value )
1342 return MEDCouplingSkyLineArray::New(index, value);
1345 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other )
1347 return MEDCouplingSkyLineArray::New(other);
1350 std::string __str__() const
1352 return self->simpleRepr();
1355 DataArrayIdType *getSuperIndexArray() const
1357 DataArrayIdType *ret(self->getSuperIndexArray());
1363 DataArrayIdType *getIndexArray() const
1365 DataArrayIdType *ret(self->getIndexArray());
1371 DataArrayIdType *getValuesArray() const
1373 DataArrayIdType *ret(self->getValuesArray());
1379 PyObject *getSimplePackSafe(mcIdType absolutePackId) const
1381 std::vector<mcIdType> ret;
1382 self->getSimplePackSafe(absolutePackId,ret);
1383 return convertIntArrToPyList2(ret);
1386 PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const
1388 std::vector<mcIdType> vpack, vspIdx, out;
1390 convertPyToNewIntArr3(superPackIndices,vspIdx);
1391 convertPyToNewIntArr3(pack,vpack);
1393 self->findPackIds(vspIdx, vpack.data(), vpack.data()+vpack.size(), out);
1394 return convertIntArrToPyList2(out);
1397 void pushBackPack(const mcIdType i, PyObject *pack)
1399 std::vector<mcIdType> vpack;
1400 convertPyToNewIntArr3(pack,vpack);
1401 self->pushBackPack(i,vpack.data(), vpack.data()+vpack.size());
1404 void replaceSimplePack(const mcIdType idx, PyObject *pack)
1406 std::vector<mcIdType> vpack;
1407 convertPyToNewIntArr3(pack,vpack);
1408 self->replaceSimplePack(idx, vpack.data(), vpack.data()+vpack.size());
1411 void replaceSimplePacks(const DataArrayIdType* idx, PyObject *listePacks)
1413 std::vector<const DataArrayIdType*> packs;
1414 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType*>(listePacks,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",packs);
1415 self->replaceSimplePacks(idx, packs);
1418 static MEDCouplingSkyLineArray *AggregatePacks(PyObject *sks)
1420 std::vector<const MEDCouplingSkyLineArray *> sksCpp;
1421 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingSkyLineArray*>(sks,SWIGTYPE_p_MEDCoupling__MEDCouplingSkyLineArray,"MEDCouplingSkyLineArray",sksCpp);
1422 return MEDCoupling::MEDCouplingSkyLineArray::AggregatePacks(sksCpp);
1425 void replacePack(const mcIdType superIdx, const mcIdType idx, PyObject *pack)
1427 std::vector<mcIdType> vpack;
1428 convertPyToNewIntArr3(pack,vpack);
1429 self->replacePack(superIdx, idx, vpack.data(), vpack.data()+vpack.size());
1432 PyObject *convertToPolyhedronConn() const
1434 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
1435 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
1436 self->convertToPolyhedronConn(d0,d1);
1437 PyObject *ret=PyTuple_New(2);
1438 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1439 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1443 PyObject *thresholdPerPack(mcIdType threshold) const
1445 MCAuto<MEDCouplingSkyLineArray> left, right;
1446 self->thresholdPerPack(threshold,left,right);
1447 PyObject *ret=PyTuple_New(2);
1448 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(left.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingSkyLineArray, SWIG_POINTER_OWN | 0 ));
1449 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(right.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingSkyLineArray, SWIG_POINTER_OWN | 0 ));
1456 %include "MEDCouplingFieldDiscretization.i"
1458 //== MEDCouplingPointSet
1460 namespace MEDCoupling
1462 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1465 void setCoords(const DataArrayDouble *coords);
1466 DataArrayDouble *getCoordinatesAndOwner() const;
1467 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const;
1469 double getCaracteristicDimension() const;
1470 void recenterForMaxPrecision(double eps);
1471 void changeSpaceDimension(int newSpaceDim, double dftVal=0.);
1472 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon);
1473 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other);
1474 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const;
1475 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon);
1476 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2);
1477 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type);
1478 static DataArrayIdType *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps);
1479 virtual DataArrayIdType *computeFetchedNodeIds() const;
1480 virtual int getNumberOfNodesInCell(int cellId) const;
1481 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const;
1482 virtual DataArrayIdType *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps);
1483 virtual DataArrayIdType *zipCoordsTraducer();
1484 virtual DataArrayIdType *findBoundaryNodes() const;
1485 virtual DataArrayIdType *zipConnectivityTraducer(int compType, int startCellId=0);
1486 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const;
1487 virtual void checkFullyDefined() const;
1488 virtual bool isEmptyMesh(const std::vector<mcIdType>& tinyInfo) const;
1489 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const;
1490 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const;
1491 virtual void renumberNodesWithOffsetInConn(int offset);
1492 virtual bool areAllNodesFetched() const;
1493 virtual MEDCouplingFieldDouble *computeDiameterField() const;
1494 virtual void invertOrientationOfAllCells();
1497 std::string __str__() const
1499 return self->simpleRepr();
1502 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayIdType *comm, const DataArrayIdType *commIndex) const
1504 mcIdType newNbOfNodes;
1505 DataArrayIdType *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1506 PyObject *res = PyList_New(2);
1507 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1508 PyList_SetItem(res,1,PyInt_FromLong(newNbOfNodes));
1512 PyObject *findCommonNodes(double prec, mcIdType limitTupleId=-1) const
1514 DataArrayIdType *comm, *commIndex;
1515 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1516 PyObject *res = PyList_New(2);
1517 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1518 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1522 PyObject *getCoords()
1524 DataArrayDouble *ret1=self->getCoords();
1527 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1530 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const
1532 mcIdType szArr,sw,iTypppArr;
1533 std::vector<mcIdType> stdvecTyyppArr;
1534 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1535 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1536 if(sw==3)//DataArrayIdType
1538 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1539 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1540 std::string name=argpt->getName();
1542 ret->setName(name.c_str());
1544 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1547 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const
1549 mcIdType szArr,sw,iTypppArr;
1550 std::vector<mcIdType> stdvecTyyppArr;
1551 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1552 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1553 if(sw==3)//DataArrayIdType
1555 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1556 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1557 std::string name=argpt->getName();
1559 ret->setName(name.c_str());
1561 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1564 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const
1566 mcIdType szArr,sw,iTypppArr;
1567 std::vector<mcIdType> stdvecTyyppArr;
1568 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1569 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1570 if(sw==3)//DataArrayIdType
1572 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1573 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1574 std::string name=argpt->getName();
1576 ret->setName(name.c_str());
1578 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1581 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(mcIdType start, mcIdType end, mcIdType step) const
1583 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1584 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1587 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const
1589 mcIdType szArr,sw,iTypppArr;
1590 std::vector<mcIdType> stdvecTyyppArr;
1591 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1592 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1593 if(sw==3)//DataArrayIdType
1595 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1596 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1597 std::string name=argpt->getName();
1599 ret->setName(name.c_str());
1601 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1604 void renumberNodes(PyObject *li, mcIdType newNbOfNodes)
1606 mcIdType szArr,sw,iTypppArr;
1607 std::vector<mcIdType> stdvecTyyppArr;
1608 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1609 self->renumberNodes(tmp,newNbOfNodes);
1612 void renumberNodesCenter(PyObject *li, mcIdType newNbOfNodes)
1614 mcIdType szArr,sw,iTypppArr;
1615 std::vector<mcIdType> stdvecTyyppArr;
1616 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1617 self->renumberNodesCenter(tmp,newNbOfNodes);
1620 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const
1622 int spaceDim=self->getSpaceDimension();
1624 DataArrayDouble *a,*a2;
1625 DataArrayDoubleTuple *aa,*aa2;
1626 std::vector<double> bb,bb2;
1628 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st parameter for point.";
1629 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd parameter for vector.";
1630 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1631 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1632 std::vector<mcIdType> nodes;
1633 self->findNodesOnLine(p,v,eps,nodes);
1634 DataArrayIdType *ret=DataArrayIdType::New();
1635 ret->alloc(nodes.size(),1);
1636 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1637 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1639 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const
1641 int spaceDim=self->getSpaceDimension();
1643 DataArrayDouble *a,*a2;
1644 DataArrayDoubleTuple *aa,*aa2;
1645 std::vector<double> bb,bb2;
1647 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st parameter for point.";
1648 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd parameter for vector.";
1649 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1650 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1651 std::vector<mcIdType> nodes;
1652 self->findNodesOnPlane(p,v,eps,nodes);
1653 DataArrayIdType *ret=DataArrayIdType::New();
1654 ret->alloc(nodes.size(),1);
1655 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1656 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1659 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const
1663 DataArrayDoubleTuple *aa;
1664 std::vector<double> bb;
1666 int spaceDim=self->getSpaceDimension();
1667 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1668 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1669 DataArrayIdType *ret=self->getNodeIdsNearPoint(pos,eps);
1670 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1673 PyObject *getNodeIdsNearPoints(PyObject *pt, mcIdType nbOfPoints, double eps) const
1675 DataArrayIdType *c=0,*cI=0;
1679 DataArrayDoubleTuple *aa;
1680 std::vector<double> bb;
1682 int spaceDim=self->getSpaceDimension();
1683 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1684 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1685 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1686 PyObject *ret=PyTuple_New(2);
1687 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1688 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1692 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const
1694 DataArrayIdType *c=0,*cI=0;
1695 int spaceDim=self->getSpaceDimension();
1698 DataArrayDoubleTuple *aa;
1699 std::vector<double> bb;
1701 mcIdType nbOfTuples=-1;
1702 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1703 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1705 PyObject *ret=PyTuple_New(2);
1706 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1707 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1711 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const
1715 DataArrayDoubleTuple *aa;
1716 std::vector<double> bb;
1718 int spaceDim=self->getSpaceDimension();
1719 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1720 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1722 DataArrayIdType *elems=self->getCellsInBoundingBox(tmp,eps);
1723 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1726 void duplicateNodesInCoords(PyObject *li)
1730 std::vector<mcIdType> multiVal;
1731 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
1732 MEDCoupling::DataArrayIdType *daIntTyypp=0;
1733 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1737 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1739 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1741 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1743 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
1747 virtual PyObject *findCommonCells(int compType, mcIdType startCellId=0) const
1749 DataArrayIdType *v0(nullptr),*v1(nullptr);
1750 self->findCommonCells(compType,startCellId,v0,v1);
1751 PyObject *res = PyList_New(2);
1752 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1753 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1758 virtual void renumberNodesInConn(PyObject *li)
1762 int res1(SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__MapII, 0 | 0 ));
1765 MapII *da2(reinterpret_cast<MapII *>(da));
1766 self->renumberNodesInConn(da2->data());
1770 int res1(SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 ));
1771 if (!SWIG_IsOK(res1))
1774 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
1775 self->renumberNodesInConn(tmp);
1779 DataArrayIdType *da2(reinterpret_cast< DataArrayIdType * >(da));
1781 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
1782 da2->checkAllocated();
1783 self->renumberNodesInConn(da2->getConstPointer());
1787 virtual PyObject *getNodeIdsInUse() const
1790 DataArrayIdType *ret0=self->getNodeIdsInUse(ret1);
1791 PyObject *ret=PyTuple_New(2);
1792 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1793 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1797 virtual DataArrayIdType *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1799 DataArrayIdType *ret(nullptr);
1801 mcIdType szArr,sw,iTypppArr;
1802 std::vector<mcIdType> stdvecTyyppArr;
1803 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1804 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1808 virtual PyObject *mergeNodes(double precision)
1812 DataArrayIdType *ret0=self->mergeNodes(precision,ret1,ret2);
1813 PyObject *res = PyList_New(3);
1814 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1815 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1816 PyList_SetItem(res,2,PyInt_FromLong(ret2));
1820 virtual PyObject *mergeNodesCenter(double precision)
1824 DataArrayIdType *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1825 PyObject *res = PyList_New(3);
1826 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1827 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1828 PyList_SetItem(res,2,PyInt_FromLong(ret2));
1832 DataArrayIdType *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const
1835 int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
1836 if (!SWIG_IsOK(res1))
1839 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
1840 return self->getCellIdsLyingOnNodes(tmp,((const mcIdType *)tmp)+size,fullyIn);
1844 DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
1846 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
1847 da2->checkAllocated();
1848 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1852 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI)
1856 std::vector<mcIdType> multiVal;
1857 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
1858 MEDCoupling::DataArrayIdType *daIntTyypp=0;
1859 mcIdType nbc=self->getNumberOfCells();
1860 convertIntStarOrSliceLikePyObjToCpp(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1867 std::ostringstream oss;
1868 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1869 throw INTERP_KERNEL::Exception(oss.str().c_str());
1872 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1877 mcIdType tmp=nbc+singleVal;
1878 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1882 std::ostringstream oss;
1883 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1884 throw INTERP_KERNEL::Exception(oss.str().c_str());
1890 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1894 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1899 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1900 daIntTyypp->checkAllocated();
1901 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1904 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayIdType instance !");
1908 static void Rotate2DAlg(PyObject *center, double angle, mcIdType nbNodes, PyObject *coords)
1911 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1912 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1913 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1914 for(mcIdType i=0;i<sz;i++)
1915 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1918 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords)
1921 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1922 mcIdType sw,nbNodes=0;
1923 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1924 std::vector<double> val3;
1925 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1926 "Rotate2DAlg",2,true,nbNodes);
1928 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1929 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1932 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, mcIdType nbNodes, PyObject *coords)
1935 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1936 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1937 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1938 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1939 for(mcIdType i=0;i<sz;i++)
1940 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1943 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords)
1946 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1947 mcIdType sw,nbNodes=0;
1948 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1949 std::vector<double> val3;
1950 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1951 "Rotate3DAlg",3,true,nbNodes);
1953 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1954 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1955 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1960 //== MEDCouplingPointSet End
1962 class MEDCouplingUMeshCell
1965 INTERP_KERNEL::NormalizedCellType getType() const;
1968 std::string __str__() const
1970 return self->repr();
1973 PyObject *getAllConn() const
1976 const mcIdType *r=self->getAllConn(ret2);
1977 PyObject *ret=PyTuple_New(ret2);
1978 for(mcIdType i=0;i<ret2;i++)
1979 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1985 class MEDCouplingUMeshCellIterator
1992 MEDCouplingUMeshCell *ret=self->nextt();
1994 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1997 PyErr_SetString(PyExc_StopIteration,"No more data.");
2004 class MEDCouplingUMeshCellByTypeIterator
2007 ~MEDCouplingUMeshCellByTypeIterator();
2012 MEDCouplingUMeshCellEntry *ret=self->nextt();
2014 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
2017 PyErr_SetString(PyExc_StopIteration,"No more data.");
2024 class MEDCouplingUMeshCellByTypeEntry
2027 ~MEDCouplingUMeshCellByTypeEntry();
2030 MEDCouplingUMeshCellByTypeIterator *__iter__()
2032 return self->iterator();
2037 class MEDCouplingUMeshCellEntry
2040 INTERP_KERNEL::NormalizedCellType getType() const;
2041 int getNumberOfElems() const;
2044 MEDCouplingUMeshCellIterator *__iter__()
2046 return self->iterator();
2051 //== MEDCouplingUMesh
2053 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
2056 static MEDCouplingUMesh *New();
2057 static MEDCouplingUMesh *New(const char *meshName, int meshDim);
2058 void checkConsistencyLight() const;
2059 void checkGeomConsistency(double eps=1e-12) const;
2060 void setMeshDimension(int meshDim);
2061 void allocateCells(int nbOfCells=0);
2062 void finishInsertingCells();
2063 MEDCouplingUMeshCellByTypeEntry *cellsByType();
2064 void setConnectivity(DataArrayIdType *conn, DataArrayIdType *connIndex, bool isComputingTypes=true);
2065 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
2066 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis);
2067 int getNodalConnectivityArrayLen() const;
2068 void computeTypes();
2069 std::string reprConnectivityOfThis() const;
2070 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const;
2072 DataArrayIdType *conformize2D(double eps);
2073 DataArrayIdType *conformize3D(double eps);
2074 DataArrayIdType *colinearize2D(double eps);
2075 DataArrayIdType *colinearizeKeepingConform2D(double eps);
2076 void shiftNodeNumbersInConn(int delta);
2077 std::vector<bool> getQuadraticStatus() const;
2078 DataArrayIdType *findCellIdsOnBoundary() const;
2079 MEDCouplingUMesh *computeSkin() const;
2080 bool checkConsecutiveCellTypes() const;
2081 bool checkConsecutiveCellTypesForMEDFileFrmt() const;
2082 DataArrayIdType *rearrange2ConsecutiveCellTypes();
2083 DataArrayIdType *sortCellsInMEDFileFrmt();
2084 DataArrayIdType *getRenumArrForMEDFileFrmt() const;
2085 DataArrayIdType *convertCellArrayPerGeoType(const DataArrayIdType *da) const;
2086 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2087 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2088 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2089 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2090 void orientCorrectlyPolyhedrons();
2091 bool isPresenceOfQuadratic() const;
2092 bool isFullyQuadratic() const;
2093 MEDCouplingFieldDouble *buildDirectionVectorField() const;
2094 bool isContiguous1D() const;
2095 void tessellate2D(double eps);
2096 void convertQuadraticCellsToLinear();
2097 DataArrayIdType *convertLinearCellsToQuadratic(int conversionType=0);
2098 void convertDegeneratedCells();
2099 DataArrayIdType *convertDegeneratedCellsAndRemoveFlatOnes();
2100 bool removeDegenerated1DCells();
2101 bool areOnlySimplexCells() const;
2102 MEDCouplingFieldDouble *getEdgeRatioField() const;
2103 MEDCouplingFieldDouble *getAspectRatioField() const;
2104 MEDCouplingFieldDouble *getWarpField() const;
2105 MEDCouplingFieldDouble *getSkewField() const;
2106 DataArrayDouble *computePlaneEquationOf3DFaces() const;
2107 DataArrayIdType *convexEnvelop2D();
2108 std::string cppRepr() const;
2109 DataArrayIdType *findAndCorrectBadOriented3DExtrudedCells();
2110 DataArrayIdType *findAndCorrectBadOriented3DCells();
2111 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const;
2112 MEDCouplingSkyLineArray *generateGraph() const;
2113 DataArrayIdType *convertNodalConnectivityToStaticGeoTypeMesh() const;
2114 DataArrayIdType *buildUnionOf2DMesh() const;
2115 DataArrayIdType *buildUnionOf3DMesh() const;
2116 DataArrayIdType *orderConsecutiveCells1D() const;
2117 DataArrayDouble *getBoundingBoxForBBTreeFast() const;
2118 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const;
2119 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const;
2120 void changeOrientationOfCells();
2121 void orientCorrectly2DCells(const MEDCouplingUMesh *refFaces);
2122 DataArrayDouble *computeCellCenterOfMassWithPrecision(double eps);
2123 int split2DCells(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *subNodesInSeg, const DataArrayIdType *subNodesInSegI, const DataArrayIdType *midOpt=0, const DataArrayIdType *midOptI=0);
2124 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da);
2125 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
2126 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
2127 static DataArrayIdType *ComputeSpreadZoneGradually(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn);
2128 static DataArrayIdType *ComputeRangesFromTypeDistribution(const std::vector<mcIdType>& code);
2132 return MEDCouplingUMesh::New();
2135 MEDCouplingUMesh(const char *meshName, int meshDim)
2137 return MEDCouplingUMesh::New(meshName,meshDim);
2140 std::string __str__() const
2142 return self->simpleRepr();
2145 std::string __repr__() const
2147 std::ostringstream oss;
2148 self->reprQuickOverview(oss);
2152 MEDCouplingUMeshCellIterator *__iter__()
2154 return self->cellIterator();
2157 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da)
2159 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
2163 PyObject *getAllGeoTypesSorted() const
2165 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
2166 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2167 PyObject *res=PyList_New(result.size());
2168 for(int i=0;iL!=result.end(); i++, iL++)
2169 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2173 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
2177 std::vector<mcIdType> multiVal;
2178 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2179 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2180 mcIdType nbc=self->getNumberOfCells();
2181 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2188 std::ostringstream oss;
2189 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2190 throw INTERP_KERNEL::Exception(oss.str().c_str());
2194 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2201 mcIdType tmp=nbc+singleVal;
2202 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2207 std::ostringstream oss;
2208 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2209 throw INTERP_KERNEL::Exception(oss.str().c_str());
2215 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2221 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2222 daIntTyypp->checkAllocated();
2223 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2227 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayIdType instance !");
2231 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
2235 std::vector<mcIdType> multiVal;
2236 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2237 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2238 mcIdType nbc=self->getNumberOfCells();
2239 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2246 std::ostringstream oss;
2247 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2248 throw INTERP_KERNEL::Exception(oss.str().c_str());
2252 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2259 mcIdType tmp=nbc+singleVal;
2260 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2265 std::ostringstream oss;
2266 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2267 throw INTERP_KERNEL::Exception(oss.str().c_str());
2273 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2278 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2284 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2285 daIntTyypp->checkAllocated();
2286 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2290 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayIdType instance !");
2294 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, mcIdType size, PyObject *li)
2296 mcIdType szArr,sw,iTypppArr;
2297 std::vector<mcIdType> stdvecTyyppArr;
2298 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2301 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2302 throw INTERP_KERNEL::Exception(oss.str().c_str());
2304 self->insertNextCell(type,size,tmp);
2307 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li)
2309 mcIdType szArr,sw,iTypppArr;
2310 std::vector<mcIdType> stdvecTyyppArr;
2311 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2312 self->insertNextCell(type,szArr,tmp);
2315 DataArrayIdType *getNodalConnectivity()
2317 DataArrayIdType *ret=self->getNodalConnectivity();
2322 DataArrayIdType *getNodalConnectivityIndex()
2324 DataArrayIdType *ret=self->getNodalConnectivityIndex();
2330 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn, mcIdType nbOfDepthPeeling=-1)
2332 mcIdType szArr,sw,iTypppArr;
2333 std::vector<mcIdType> stdvecTyyppArr;
2334 const mcIdType *seedPtr=convertIntStarLikePyObjToCppIntStar(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2335 mcIdType nbOfDepthPeelingPerformed=0;
2336 DataArrayIdType *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2337 PyObject *res=PyTuple_New(2);
2338 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2339 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2343 static PyObject *FindCommonCellsAlg(int compType, mcIdType startCellId, const DataArrayIdType *nodal, const DataArrayIdType *nodalI, const DataArrayIdType *revNodal, const DataArrayIdType *revNodalI)
2345 DataArrayIdType *v0=0,*v1=0;
2346 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2347 PyObject *res = PyList_New(2);
2348 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2349 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2353 PyObject *distanceToPoint(PyObject *point) const
2357 DataArrayDoubleTuple *aa;
2358 std::vector<double> bb;
2360 int nbOfCompo=self->getSpaceDimension();
2361 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2364 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2365 PyObject *ret=PyTuple_New(2);
2366 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2367 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2371 PyObject *distanceToPoints(const DataArrayDouble *pts) const
2373 DataArrayIdType *ret1=0;
2374 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2375 PyObject *ret=PyTuple_New(2);
2376 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2377 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2381 PyObject *tetrahedrize(int policy)
2384 DataArrayIdType *ret1(0);
2385 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2386 PyObject *ret=PyTuple_New(3);
2387 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2388 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2389 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2393 PyObject *checkButterflyCells(double eps=1e-12)
2395 std::vector<mcIdType> cells;
2396 self->checkButterflyCells(cells,eps);
2397 DataArrayIdType *ret=DataArrayIdType::New();
2398 ret->alloc(cells.size(),1);
2399 std::copy(cells.begin(),cells.end(),ret->getPointer());
2400 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2403 PyObject *splitByType() const
2405 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2406 std::size_t sz=ms.size();
2407 PyObject *ret = PyList_New(sz);
2408 for(std::size_t i=0;i<sz;i++)
2409 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2413 PyObject *partitionBySpreadZone() const
2415 std::vector<DataArrayIdType *> retCpp=self->partitionBySpreadZone();
2416 std::size_t sz=retCpp.size();
2417 PyObject *ret=PyList_New(sz);
2418 for(std::size_t i=0;i<sz;i++)
2419 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2423 static PyObject *PartitionBySpreadZone(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn)
2425 std::vector<DataArrayIdType *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2426 std::size_t sz=retCpp.size();
2427 PyObject *ret=PyList_New(sz);
2428 for(std::size_t i=0;i<sz;i++)
2429 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2433 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const
2436 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(ids,&size);
2437 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2438 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2441 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const
2444 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2445 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2449 DataArrayIdType *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const
2452 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2453 DataArrayIdType *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2457 DataArrayIdType *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
2459 DataArrayIdType *ret=self->findNodesToDuplicate(otherDimM1OnSameCoords);
2463 PyObject *findCellsToRenumber(const MEDCouplingUMesh& otherDimM1OnSameCoords, const DataArrayIdType *dupNodes) const
2465 DataArrayIdType *tmp0=0,*tmp1=0;
2466 self->findCellsToRenumber(otherDimM1OnSameCoords,dupNodes->begin(), dupNodes->end(), tmp0,tmp1);
2467 PyObject *ret=PyTuple_New(2);
2468 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2469 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2473 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
2475 DataArrayIdType *tmp0=0,*tmp1=0;
2476 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2477 PyObject *ret=PyTuple_New(2);
2478 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2479 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2483 void duplicateNodes(PyObject *li)
2487 std::vector<mcIdType> multiVal;
2488 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2489 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2490 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2494 return self->duplicateNodes(&singleVal,&singleVal+1);
2496 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2498 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2500 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
2504 void duplicateNodesInConn(PyObject *li, mcIdType offset)
2508 std::vector<mcIdType> multiVal;
2509 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2510 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2511 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2515 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2517 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2519 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2521 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
2525 void attractSeg3MidPtsAroundNodes(double ratio, PyObject *nodeIds)
2527 mcIdType szArr,sw,iTypppArr;
2528 std::vector<mcIdType> stdvecTyyppArr;
2529 const mcIdType *nodeIdsPtr(convertIntStarLikePyObjToCppIntStar(nodeIds,sw,szArr,iTypppArr,stdvecTyyppArr));
2530 self->attractSeg3MidPtsAroundNodes(ratio,nodeIdsPtr,nodeIdsPtr+szArr);
2533 PyObject *getLevArrPerCellTypes(PyObject *li) const
2536 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2537 DataArrayIdType *tmp0,*tmp1=0;
2538 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2539 PyObject *ret=PyTuple_New(2);
2540 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2541 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2545 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const
2547 DataArrayIdType *ret0=0,*ret1=0;
2548 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2549 PyObject *ret=PyTuple_New(2);
2550 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2551 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2555 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms)
2557 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2558 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2559 DataArrayIdType *ret1=0,*ret2=0;
2560 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2561 PyObject *ret=PyTuple_New(3);
2562 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2563 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2564 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2568 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms)
2570 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2571 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2572 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2573 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2576 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType)
2579 std::vector<const MEDCouplingUMesh *> meshes;
2580 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2581 std::vector<DataArrayIdType *> corr;
2582 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2584 PyObject *ret1=PyList_New(sz);
2585 for(std::size_t i=0;i<sz;i++)
2586 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2587 PyObject *ret=PyList_New(2);
2588 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2589 PyList_SetItem(ret,1,ret1);
2593 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms)
2595 std::vector<MEDCouplingUMesh *> meshes;
2596 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2597 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2600 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps)
2602 std::vector<MEDCouplingUMesh *> meshes;
2603 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2604 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2607 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const
2611 DataArrayDoubleTuple *aa;
2612 std::vector<double> bb;
2614 int spaceDim=self->getSpaceDimension();
2615 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2616 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2618 std::vector<mcIdType> cells;
2619 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2620 DataArrayIdType *ret=DataArrayIdType::New();
2621 ret->alloc(cells.size(),1);
2622 std::copy(cells.begin(),cells.end(),ret->getPointer());
2623 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2626 void orientCorrectly2DCells(PyObject *vec, bool polyOnly)
2630 DataArrayDoubleTuple *aa;
2631 std::vector<double> bb;
2633 int spaceDim=self->getSpaceDimension();
2634 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2635 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2636 self->orientCorrectly2DCells(v,polyOnly);
2639 PyObject *arePolyhedronsNotCorrectlyOriented() const
2641 std::vector<mcIdType> cells;
2642 self->arePolyhedronsNotCorrectlyOriented(cells);
2643 DataArrayIdType *ret=DataArrayIdType::New();
2644 ret->alloc(cells.size(),1);
2645 std::copy(cells.begin(),cells.end(),ret->getPointer());
2646 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2649 PyObject *getFastAveragePlaneOfThis() const
2653 self->getFastAveragePlaneOfThis(vec,pos);
2655 std::copy(vec,vec+3,vals);
2656 std::copy(pos,pos+3,vals+3);
2657 return convertDblArrToPyListOfTuple<double>(vals,3,2);
2660 static MEDCouplingUMesh *MergeUMeshes(PyObject *li)
2662 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2663 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2664 return MEDCouplingUMesh::MergeUMeshes(tmp);
2667 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const
2669 DataArrayIdType *ret1;
2670 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2671 PyObject *ret=PyTuple_New(2);
2672 PyObject *ret0Py=ret0?Py_True:Py_False;
2674 PyTuple_SetItem(ret,0,ret0Py);
2675 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2679 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const
2681 DataArrayIdType *ret1;
2682 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2683 PyObject *ret=PyTuple_New(2);
2684 PyObject *ret0Py=ret0?Py_True:Py_False;
2686 PyTuple_SetItem(ret,0,ret0Py);
2687 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2691 PyObject *explode3DMeshTo1D() const
2693 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2694 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2695 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2696 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2697 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2698 PyObject *ret=PyTuple_New(5);
2699 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2700 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2701 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2702 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2703 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2707 PyObject *explodeIntoEdges() const
2709 MCAuto<DataArrayIdType> desc,descIndex,revDesc,revDescIndx;
2710 MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2711 PyObject *ret=PyTuple_New(5);
2712 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2713 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2714 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2715 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2716 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2720 PyObject *explodeMeshIntoMicroEdges() const
2722 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2723 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2724 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2725 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2726 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2727 PyObject *ret=PyTuple_New(5);
2728 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2729 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2730 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2731 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2732 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2736 PyObject *buildDescendingConnectivity() const
2738 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2739 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2740 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2741 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2742 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2743 PyObject *ret=PyTuple_New(5);
2744 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2745 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2746 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2747 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2748 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2752 PyObject *buildDescendingConnectivity2() const
2754 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2755 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2756 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2757 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2758 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2759 PyObject *ret=PyTuple_New(5);
2760 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2761 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2762 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2763 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2764 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2768 PyObject *computeNeighborsOfCells() const
2770 DataArrayIdType *neighbors=0,*neighborsIdx=0;
2771 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2772 PyObject *ret=PyTuple_New(2);
2773 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2774 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2778 PyObject *computeNeighborsOfNodes() const
2780 DataArrayIdType *neighbors=0,*neighborsIdx=0;
2781 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2782 PyObject *ret=PyTuple_New(2);
2783 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2784 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2788 PyObject *computeEnlargedNeighborsOfNodes() const
2790 MCAuto<DataArrayIdType> neighbors,neighborsIdx;
2791 self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2792 PyObject *ret=PyTuple_New(2);
2793 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2794 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2798 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayIdType *nodeNeigh, const DataArrayIdType *nodeNeighI) const
2800 MCAuto<DataArrayIdType> cellNeigh,cellNeighIndex;
2801 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2802 PyObject *ret=PyTuple_New(2);
2803 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2804 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2808 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *revDesc, const DataArrayIdType *revDescI)
2810 DataArrayIdType *neighbors=0,*neighborsIdx=0;
2811 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2812 PyObject *ret=PyTuple_New(2);
2813 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2814 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2818 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2820 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2821 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2822 DataArrayIdType *d2,*d3,*d4,*dd5;
2823 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2824 PyObject *ret=PyTuple_New(7);
2825 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2826 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2827 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2828 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2829 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2830 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2831 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2835 DataArrayDouble *getPartBarycenterAndOwner(DataArrayIdType *da) const
2838 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2839 da->checkAllocated();
2840 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2843 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayIdType *da) const
2846 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2847 da->checkAllocated();
2848 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2851 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayIdType *da) const
2854 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2855 da->checkAllocated();
2856 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2859 PyObject *getTypesOfPart(DataArrayIdType *da) const
2862 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2863 da->checkAllocated();
2864 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2865 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2866 PyObject *res = PyList_New(result.size());
2867 for (int i=0;iL!=result.end(); i++, iL++)
2868 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2872 DataArrayIdType *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayIdType *da) const
2875 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2876 da->checkAllocated();
2877 DataArrayIdType *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2878 ret->setName(da->getName().c_str());
2882 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps)
2884 DataArrayIdType *cellNb1=0,*cellNb2=0;
2885 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2886 PyObject *ret=PyTuple_New(3);
2887 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2888 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2889 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2893 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps)
2895 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2896 DataArrayIdType *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2897 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2898 PyObject *ret(PyTuple_New(4));
2899 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2900 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2901 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2902 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2906 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const
2908 int spaceDim=self->getSpaceDimension();
2910 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2912 DataArrayDouble *a,*a2;
2913 DataArrayDoubleTuple *aa,*aa2;
2914 std::vector<double> bb,bb2;
2916 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st parameter for origin.";
2917 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd parameter for vector.";
2918 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2919 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2921 DataArrayIdType *cellIds=0;
2922 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2923 PyObject *ret=PyTuple_New(2);
2924 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2925 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2929 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const
2931 int spaceDim=self->getSpaceDimension();
2933 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2935 DataArrayDouble *a,*a2;
2936 DataArrayDoubleTuple *aa,*aa2;
2937 std::vector<double> bb,bb2;
2939 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st parameter for origin.";
2940 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd parameter for vector.";
2941 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2942 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2944 DataArrayIdType *cellIds=0;
2945 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2946 PyObject *ret=PyTuple_New(2);
2947 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2948 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2952 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const
2955 DataArrayDouble *a,*a2;
2956 DataArrayDoubleTuple *aa,*aa2;
2957 std::vector<double> bb,bb2;
2959 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st parameter for origin.";
2960 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd parameter for vector.";
2961 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2962 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2963 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2967 DataArrayIdType *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const
2969 int spaceDim=self->getSpaceDimension();
2971 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2973 DataArrayDouble *a,*a2;
2974 DataArrayDoubleTuple *aa,*aa2;
2975 std::vector<double> bb,bb2;
2977 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st parameter for origin.";
2978 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd parameter for vector.";
2979 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2980 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2981 return self->getCellIdsCrossingPlane(orig,vect,eps);
2984 void convertToPolyTypes(PyObject *li)
2988 std::vector<mcIdType> pos2;
2989 DataArrayIdType *pos3=0;
2990 DataArrayIdTypeTuple *pos4=0;
2991 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2996 self->convertToPolyTypes(&pos1,&pos1+1);
3003 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
3008 self->convertToPolyTypes(pos3->begin(),pos3->end());
3012 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
3016 void convertAllToPoly();
3017 void convertExtrudedPolyhedra();
3019 void simplifyPolyhedra(double eps);
3020 MEDCouplingUMesh *buildSpreadZonesWithPoly() const;
3021 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy);
3024 //== MEDCouplingUMesh End
3026 //== MEDCouplingMappedExtrudedMesh
3028 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
3031 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
3032 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D);
3033 MEDCouplingUMesh *build3DUnstructuredMesh() const;
3034 int get2DCellIdForExtrusion() const;
3036 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, mcIdType cell2DId)
3038 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3041 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D)
3043 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3046 MEDCouplingMappedExtrudedMesh()
3048 return MEDCouplingMappedExtrudedMesh::New();
3051 std::string __str__() const
3053 return self->simpleRepr();
3056 std::string __repr__() const
3058 std::ostringstream oss;
3059 self->reprQuickOverview(oss);
3063 PyObject *getMesh2D() const
3065 MEDCouplingUMesh *ret=self->getMesh2D();
3068 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3070 PyObject *getMesh1D() const
3072 MEDCouplingUMesh *ret=self->getMesh1D();
3075 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3077 PyObject *getMesh3DIds() const
3079 DataArrayIdType *ret=self->getMesh3DIds();
3082 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
3087 //== MEDCouplingMappedExtrudedMesh End
3089 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3092 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3093 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m);
3094 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const;
3095 int getNodalConnectivityLength() const;
3096 virtual void allocateCells(int nbOfCells=0);
3097 virtual void checkConsistencyOfConnectivity() const;
3100 virtual void insertNextCell(PyObject *li)
3102 mcIdType szArr,sw,iTypppArr;
3103 std::vector<mcIdType> stdvecTyyppArr;
3104 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3105 self->insertNextCell(tmp,tmp+szArr);
3108 virtual DataArrayIdType *getNodalConnectivity() const
3110 DataArrayIdType *ret=self->getNodalConnectivity();
3111 if(ret) ret->incrRef();
3115 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li)
3117 std::vector< const MEDCoupling1GTUMesh *> parts;
3118 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3119 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3124 //== MEDCoupling1SGTUMesh
3126 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3129 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3130 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m);
3131 void setNodalConnectivity(DataArrayIdType *nodalConn);
3132 int getNumberOfNodesPerCell() const;
3133 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2);
3134 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
3135 MEDCoupling1GTUMesh *computeDualMesh() const;
3136 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const;
3137 DataArrayIdType *sortHexa8EachOther();
3140 MEDCoupling1SGTUMesh()
3142 return MEDCoupling1SGTUMesh::New();
3145 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
3147 return MEDCoupling1SGTUMesh::New(name,type);
3150 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m)
3152 return MEDCoupling1SGTUMesh::New(m);
3155 std::string __str__() const
3157 return self->simpleRepr();
3160 std::string __repr__() const
3162 std::ostringstream oss;
3163 self->reprQuickOverview(oss);
3167 PyObject *structurizeMe(double eps=1e-12) const
3169 DataArrayIdType *cellPerm(0),*nodePerm(0);
3170 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3171 PyObject *ret(PyTuple_New(3));
3172 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3173 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3174 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3178 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li)
3180 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3181 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3182 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3185 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li)
3187 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3188 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3189 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3194 //== MEDCoupling1SGTUMesh End
3196 //== MEDCoupling1DGTUMesh
3198 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3201 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3202 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m);
3203 void setNodalConnectivity(DataArrayIdType *nodalConn, DataArrayIdType *nodalConnIndex);
3204 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
3205 bool isPacked() const;
3208 MEDCoupling1DGTUMesh()
3210 return MEDCoupling1DGTUMesh::New();
3212 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
3214 return MEDCoupling1DGTUMesh::New(name,type);
3217 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m)
3219 return MEDCoupling1DGTUMesh::New(m);
3222 std::string __str__() const
3224 return self->simpleRepr();
3227 std::string __repr__() const
3229 std::ostringstream oss;
3230 self->reprQuickOverview(oss);
3234 DataArrayIdType *getNodalConnectivityIndex() const
3236 DataArrayIdType *ret=self->getNodalConnectivityIndex();
3237 if(ret) ret->incrRef();
3241 PyObject *retrievePackedNodalConnectivity() const
3243 DataArrayIdType *ret1=0,*ret2=0;
3244 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3245 PyObject *ret0Py=ret0?Py_True:Py_False;
3247 PyObject *ret=PyTuple_New(3);
3248 PyTuple_SetItem(ret,0,ret0Py);
3249 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3250 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3254 PyObject *copyWithNodalConnectivityPacked() const
3257 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3258 PyObject *ret=PyTuple_New(2);
3259 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3260 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3261 PyTuple_SetItem(ret,1,ret1Py);
3265 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li)
3267 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3268 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3269 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3272 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li)
3274 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3275 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3276 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3279 static DataArrayIdType *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<mcIdType>& offsetInNodeIdsPerElt)
3281 std::vector<const MEDCoupling::DataArrayIdType *> tmp;
3282 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",tmp);
3283 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3288 //== MEDCoupling1DGTUMeshEnd
3290 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3293 mcIdType getCellIdFromPos(mcIdType i, mcIdType j, mcIdType k) const;
3294 mcIdType getNodeIdFromPos(mcIdType i, mcIdType j, mcIdType k) const;
3295 mcIdType getNumberOfCellsOfSubLevelMesh() const;
3296 int getSpaceDimensionOnNodeStruct() const;
3297 double computeSquareness() const;
3298 virtual std::vector<mcIdType> getNodeGridStructure() const;
3299 std::vector<mcIdType> getCellGridStructure() const;
3300 MEDCoupling1SGTUMesh *build1SGTUnstructured() const;
3301 std::vector<mcIdType> getLocationFromCellId(mcIdType cellId) const;
3302 std::vector<mcIdType> getLocationFromNodeId(mcIdType cellId) const;
3303 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim);
3304 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const;
3305 static mcIdType DeduceNumberOfGivenStructure(const std::vector<mcIdType>& st);
3306 static DataArrayIdType *ComputeCornersGhost(const std::vector<mcIdType>& st, mcIdType ghostLev);
3307 static std::vector<mcIdType> GetSplitVectFromStruct(const std::vector<mcIdType>& strct);
3310 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const
3312 mcIdType tmpp1=-1,tmpp2=-1;
3313 std::vector<mcIdType> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3314 std::vector< std::pair<mcIdType,mcIdType> > inp;
3318 for(mcIdType i=0;i<tmpp1;i++)
3319 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3324 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3325 inp.resize(tmpp1/2);
3326 for(mcIdType i=0;i<tmpp1/2;i++)
3327 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3330 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3331 return self->buildStructuredSubPart(inp);
3334 static DataArrayIdType *BuildExplicitIdsFrom(PyObject *st, PyObject *part)
3336 std::vector< std::pair<mcIdType,mcIdType> > inp;
3337 convertPyToVectorPairInt(part,inp);
3339 mcIdType szArr,sw,iTypppArr;
3340 std::vector<mcIdType> stdvecTyyppArr;
3341 const mcIdType *tmp4=convertIntStarLikePyObjToCppIntStar(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3342 std::vector<mcIdType> tmp5(tmp4,tmp4+szArr);
3344 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3347 static void MultiplyPartOf(const std::vector<mcIdType>& st, PyObject *part, double factor, DataArrayDouble *da)
3349 std::vector< std::pair<mcIdType,mcIdType> > inp;
3350 convertPyToVectorPairInt(part,inp);
3351 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3354 static void MultiplyPartOfByGhost(const std::vector<mcIdType>& st, PyObject *part, mcIdType ghostSize, double factor, DataArrayDouble *da)
3356 std::vector< std::pair<mcIdType,mcIdType> > inp;
3357 convertPyToVectorPairInt(part,inp);
3358 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3361 static PyObject *PutInGhostFormat(mcIdType ghostSize, const std::vector<mcIdType>& st, PyObject *part)
3363 std::vector< std::pair<mcIdType,mcIdType> > inp;
3364 convertPyToVectorPairInt(part,inp);
3365 std::vector<mcIdType> stWithGhost;
3366 std::vector< std::pair<mcIdType,mcIdType> > partWithGhost;
3367 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3368 PyObject *ret(PyTuple_New(2));
3369 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3370 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3374 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<mcIdType>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat)
3376 std::vector< std::pair<mcIdType,mcIdType> > inp;
3377 convertPyToVectorPairInt(partCompactFormat,inp);
3378 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3381 static void AssignPartOfFieldOfDoubleUsing(const std::vector<mcIdType>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other)
3383 std::vector< std::pair<mcIdType,mcIdType> > inp;
3384 convertPyToVectorPairInt(partCompactFormat,inp);
3385 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3388 static mcIdType DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part)
3390 std::vector< std::pair<mcIdType,mcIdType> > inp;
3391 convertPyToVectorPairInt(part,inp);
3392 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3395 static DataArrayIdType *Build1GTNodalConnectivity(PyObject *li)
3397 mcIdType szArr,sw,iTypppArr;
3398 std::vector<mcIdType> stdvecTyyppArr;
3399 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3400 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3403 static DataArrayIdType *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li)
3405 mcIdType szArr,sw,iTypppArr;
3406 std::vector<mcIdType> stdvecTyyppArr;
3407 const mcIdType *tmp(convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3408 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3411 static std::vector<mcIdType> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat)
3413 std::vector< std::pair<mcIdType,mcIdType> > inp;
3414 convertPyToVectorPairInt(partCompactFormat,inp);
3415 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3418 static PyObject *GetCompactFrmtFromDimensions(const std::vector<mcIdType>& dims)
3420 std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3421 PyObject *retPy=PyList_New(ret.size());
3422 for(std::size_t i=0;i<ret.size();i++)
3424 PyObject *tmp=PyTuple_New(2);
3425 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3426 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3427 PyList_SetItem(retPy,i,tmp);
3432 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2)
3434 std::vector< std::pair<mcIdType,mcIdType> > r1Cpp,r2Cpp;
3435 convertPyToVectorPairInt(r1,r1Cpp);
3436 convertPyToVectorPairInt(r2,r2Cpp);
3437 std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3438 PyObject *retPy=PyList_New(ret.size());
3439 for(std::size_t i=0;i<ret.size();i++)
3441 PyObject *tmp=PyTuple_New(2);
3442 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3443 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3444 PyList_SetItem(retPy,i,tmp);
3449 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3451 std::vector< std::pair<mcIdType,mcIdType> > r1Cpp,r2Cpp;
3452 convertPyToVectorPairInt(r1,r1Cpp);
3453 convertPyToVectorPairInt(r2,r2Cpp);
3454 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3457 static PyObject *IsPartStructured(PyObject *li, PyObject *st)
3459 mcIdType szArr,sw,iTypppArr;
3460 std::vector<mcIdType> stdvecTyyppArr;
3461 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3462 mcIdType szArr2,sw2,iTypppArr2;
3463 std::vector<mcIdType> stdvecTyyppArr2;
3464 const mcIdType *tmp2=convertIntStarLikePyObjToCppIntStar(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3465 std::vector<mcIdType> tmp3(tmp2,tmp2+szArr2);
3466 std::vector< std::pair<mcIdType,mcIdType> > partCompactFormat;
3467 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3468 PyObject *ret=PyTuple_New(2);
3469 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3470 PyTuple_SetItem(ret,0,ret0Py);
3471 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3472 for(std::size_t i=0;i<partCompactFormat.size();i++)
3474 PyObject *tmp4=PyTuple_New(2);
3475 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3476 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3477 PyList_SetItem(ret1Py,i,tmp4);
3479 PyTuple_SetItem(ret,1,ret1Py);
3483 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true)
3485 std::vector< std::pair<mcIdType,mcIdType> > param0,param1,ret;
3486 convertPyToVectorPairInt(bigInAbs,param0);
3487 convertPyToVectorPairInt(partOfBigInAbs,param1);
3488 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3489 PyObject *retPy(PyList_New(ret.size()));
3490 for(std::size_t i=0;i<ret.size();i++)
3492 PyObject *tmp(PyTuple_New(2));
3493 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3494 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3495 PyList_SetItem(retPy,i,tmp);
3500 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<mcIdType>& translation)
3502 std::vector< std::pair<mcIdType,mcIdType> > param0;
3503 convertPyToVectorPairInt(part,param0);
3504 std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3505 PyObject *retPy(PyList_New(ret.size()));
3506 for(std::size_t i=0;i<ret.size();i++)
3508 PyObject *tmp(PyTuple_New(2));
3509 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3510 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3511 PyList_SetItem(retPy,i,tmp);
3516 static std::vector<mcIdType> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo)
3518 std::vector< std::pair<mcIdType,mcIdType> > param0,param1;
3519 convertPyToVectorPairInt(startingFrom,param0);
3520 convertPyToVectorPairInt(goingTo,param1);
3521 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3524 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true)
3526 std::vector< std::pair<mcIdType,mcIdType> > param0,param1,ret;
3527 convertPyToVectorPairInt(bigInAbs,param0);
3528 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3529 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3530 PyObject *retPy(PyList_New(ret.size()));
3531 for(std::size_t i=0;i<ret.size();i++)
3533 PyObject *tmp(PyTuple_New(2));
3534 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3535 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3536 PyList_SetItem(retPy,i,tmp);
3543 class MEDCouplingCurveLinearMesh;
3545 //== MEDCouplingCMesh
3547 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3550 static MEDCouplingCMesh *New();
3551 static MEDCouplingCMesh *New(const std::string& meshName);
3552 void setCoords(const DataArrayDouble *coordsX,
3553 const DataArrayDouble *coordsY=0,
3554 const DataArrayDouble *coordsZ=0);
3555 void setCoordsAt(int i, const DataArrayDouble *arr);
3556 MEDCouplingCurveLinearMesh *buildCurveLinear() const;
3560 return MEDCouplingCMesh::New();
3562 MEDCouplingCMesh(const std::string& meshName)
3564 return MEDCouplingCMesh::New(meshName);
3566 std::string __str__() const
3568 return self->simpleRepr();
3570 std::string __repr__() const
3572 std::ostringstream oss;
3573 self->reprQuickOverview(oss);
3576 DataArrayDouble *getCoordsAt(int i)
3578 DataArrayDouble *ret=self->getCoordsAt(i);
3586 //== MEDCouplingCMesh End
3588 //== MEDCouplingCurveLinearMesh
3590 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3593 static MEDCouplingCurveLinearMesh *New();
3594 static MEDCouplingCurveLinearMesh *New(const std::string& meshName);
3595 void setCoords(const DataArrayDouble *coords);
3597 MEDCouplingCurveLinearMesh()
3599 return MEDCouplingCurveLinearMesh::New();
3601 MEDCouplingCurveLinearMesh(const std::string& meshName)
3603 return MEDCouplingCurveLinearMesh::New(meshName);
3605 std::string __str__() const
3607 return self->simpleRepr();
3609 std::string __repr__() const
3611 std::ostringstream oss;
3612 self->reprQuickOverview(oss);
3615 DataArrayDouble *getCoords()
3617 DataArrayDouble *ret=self->getCoords();
3622 void setNodeGridStructure(PyObject *gridStruct)
3624 mcIdType szArr,sw,iTypppArr;
3625 std::vector<mcIdType> stdvecTyyppArr;
3626 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3627 self->setNodeGridStructure(tmp,tmp+szArr);
3632 //== MEDCouplingCurveLinearMesh End
3634 //== MEDCouplingIMesh
3636 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3639 static MEDCouplingIMesh *New();
3641 void setSpaceDimension(int spaceDim);
3642 std::vector<mcIdType> getNodeStruct() const;
3643 std::vector<double> getOrigin() const;
3644 std::vector<double> getDXYZ() const;
3645 void setAxisUnit(const std::string& unitName);
3646 std::string getAxisUnit() const;
3647 double getMeasureOfAnyCell() const;
3648 MEDCouplingCMesh *convertToCartesian() const;
3649 void refineWithFactor(const std::vector<mcIdType>& factors);
3650 MEDCouplingIMesh *asSingleCell() const;
3651 MEDCouplingIMesh *buildWithGhost(mcIdType ghostLev) const;
3656 return MEDCouplingIMesh::New();
3658 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
3660 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3661 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3662 const mcIdType *nodeStrctPtr(0);
3663 const double *originPtr(0),*dxyzPtr(0);
3664 mcIdType sw,sz,val0;
3665 std::vector<mcIdType> bb0;
3666 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
3669 std::vector<double> bb,bb2;
3671 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3672 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3674 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3677 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
3679 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3682 void setNodeStruct(PyObject *nodeStrct)
3684 mcIdType sw,sz,val0;
3685 std::vector<mcIdType> bb0;
3686 const mcIdType *nodeStrctPtr(convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0));
3687 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3690 void setOrigin(PyObject *origin)
3692 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3694 std::vector<double> bb;
3695 mcIdType sw,nbTuples;
3696 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3697 self->setOrigin(originPtr,originPtr+nbTuples);
3700 void setDXYZ(PyObject *dxyz)
3702 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3704 std::vector<double> bb;
3705 mcIdType sw,nbTuples;
3706 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3707 self->setDXYZ(originPtr,originPtr+nbTuples);
3710 static void CondenseFineToCoarse(const std::vector<mcIdType>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, DataArrayDouble *coarseDA)
3712 std::vector< std::pair<mcIdType,mcIdType> > inp;
3713 convertPyToVectorPairInt(fineLocInCoarse,inp);
3714 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3717 static void CondenseFineToCoarseGhost(const std::vector<mcIdType>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, DataArrayDouble *coarseDA, mcIdType ghostSize)
3719 std::vector< std::pair<mcIdType,mcIdType> > inp;
3720 convertPyToVectorPairInt(fineLocInCoarse,inp);
3721 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3724 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts)
3726 std::vector< std::pair<mcIdType,mcIdType> > inp;
3727 convertPyToVectorPairInt(fineLocInCoarse,inp);
3728 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3731 static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, mcIdType ghostSize)
3733 std::vector< std::pair<mcIdType,mcIdType> > inp;
3734 convertPyToVectorPairInt(fineLocInCoarse,inp);
3735 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3738 static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, mcIdType ghostSize)
3740 std::vector< std::pair<mcIdType,mcIdType> > inp;
3741 convertPyToVectorPairInt(fineLocInCoarse,inp);
3742 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3745 std::string __str__() const
3747 return self->simpleRepr();
3749 std::string __repr__() const
3751 std::ostringstream oss;
3752 self->reprQuickOverview(oss);
3758 //== MEDCouplingIMesh End
3762 namespace MEDCoupling
3764 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3767 virtual void checkConsistencyLight() const;
3768 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const;
3769 bool areStrictlyCompatible(const MEDCouplingField *other) const;
3770 bool areStrictlyCompatibleForMulDiv(const MEDCouplingField *other) const;
3771 virtual void copyTinyStringsFrom(const MEDCouplingField *other);
3772 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh);
3773 void setName(const char *name);
3774 std::string getDescription() const;
3775 void setDescription(const char *desc);
3776 std::string getName() const;
3777 TypeOfField getTypeOfField() const;
3778 NatureOfField getNature() const;
3779 virtual void setNature(NatureOfField nat);
3780 DataArrayDouble *getLocalizationOfDiscr() const;
3781 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const;
3782 mcIdType getNumberOfTuplesExpected() const;
3783 mcIdType getNumberOfMeshPlacesExpected() const;
3784 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3785 const std::vector<double>& gsCoo, const std::vector<double>& wg);
3786 void clearGaussLocalizations();
3787 MEDCouplingGaussLocalization& getGaussLocalization(int locId);
3788 mcIdType getNbOfGaussLocalization() const;
3789 mcIdType getGaussLocalizationIdOfOneCell(mcIdType cellId) const;
3790 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const;
3791 mcIdType getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const;
3792 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3794 PyObject *getMesh() const
3796 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3799 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3802 PyObject *getDiscretization()
3804 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3807 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3810 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const
3812 std::set<mcIdType> ret=self->getGaussLocalizationIdsOfOneType(type);
3813 return convertIntArrToPyList3(ret);
3816 PyObject *buildSubMeshData(PyObject *li) const
3818 DataArrayIdType *ret1=0;
3819 MEDCouplingMesh *ret0=0;
3821 int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
3822 if (!SWIG_IsOK(res1))
3825 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
3826 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3830 DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
3832 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
3833 da2->checkAllocated();
3834 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3836 PyObject *res = PyList_New(2);
3837 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3838 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
3842 PyObject *buildSubMeshDataRange(mcIdType begin, mcIdType end, mcIdType step) const
3844 DataArrayIdType *ret1=0;
3846 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3847 PyObject *res=PyTuple_New(2);
3848 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3850 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
3853 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3854 PyTuple_SetItem(res,1,res1);
3859 DataArrayIdType *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3862 mcIdType v0; std::vector<mcIdType> v1;
3863 const mcIdType *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
3864 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3867 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3868 const std::vector<double>& gsCoo, const std::vector<double>& wg)
3871 int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
3872 if (!SWIG_IsOK(res1))
3875 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
3876 self->setGaussLocalizationOnCells(tmp,((mcIdType *)tmp)+size,refCoo,gsCoo,wg);
3880 DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
3882 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
3883 da2->checkAllocated();
3884 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3888 PyObject *getCellIdsHavingGaussLocalization(int locId) const
3890 std::vector<mcIdType> tmp;
3891 self->getCellIdsHavingGaussLocalization(locId,tmp);
3892 DataArrayIdType *ret=DataArrayIdType::New();
3893 ret->alloc((mcIdType)tmp.size(),1);
3894 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3895 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
3898 mcIdType getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const
3900 std::vector<mcIdType> inp0;
3901 convertPyToNewIntArr4(code,1,3,inp0);
3902 std::vector<const DataArrayIdType *> inp1;
3903 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(idsPerType,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",inp1);
3904 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3909 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3912 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f);
3913 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f);
3914 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt32& f);
3915 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt64& f);
3916 static MEDCouplingFieldTemplate *New(TypeOfField type);
3917 std::string simpleRepr() const;
3918 std::string advancedRepr() const;
3919 bool isEqual(const MEDCouplingFieldTemplate *other, double meshPrec) const;
3920 bool isEqualWithoutConsideringStr(const MEDCouplingFieldTemplate *other, double meshPrec) const;
3923 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f)
3925 return MEDCouplingFieldTemplate::New(f);
3928 MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f)
3930 return MEDCouplingFieldTemplate::New(f);
3933 MEDCouplingFieldTemplate(const MEDCouplingFieldInt32& f)
3935 return MEDCouplingFieldTemplate::New(f);
3938 MEDCouplingFieldTemplate(const MEDCouplingFieldInt64& f)
3940 return MEDCouplingFieldTemplate::New(f);
3943 MEDCouplingFieldTemplate(TypeOfField type)
3945 return MEDCouplingFieldTemplate::New(type);
3948 std::string __str__() const
3950 return self->simpleRepr();
3953 std::string __repr__() const
3955 std::ostringstream oss;
3956 self->reprQuickOverview(oss);
3960 PyObject *isEqualIfNotWhy(const MEDCouplingFieldTemplate *other, double meshPrec) const
3963 bool ret0=self->isEqualIfNotWhy(other,meshPrec,ret1);
3964 PyObject *ret=PyTuple_New(2);
3965 PyObject *ret0Py=ret0?Py_True:Py_False;
3967 PyTuple_SetItem(ret,0,ret0Py);
3968 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3975 class MEDCouplingFieldT : public MEDCoupling::MEDCouplingField
3978 TypeOfTimeDiscretization getTimeDiscretization() const;
3980 MEDCouplingFieldT();
3981 ~MEDCouplingFieldT();
3984 %template(MEDCouplingFieldTdouble) MEDCoupling::MEDCouplingFieldT<double>;
3985 %template(MEDCouplingFieldTfloat) MEDCoupling::MEDCouplingFieldT<float>;
3986 %template(MEDCouplingFieldTint) MEDCoupling::MEDCouplingFieldT<int>;
3988 class MEDCouplingFieldInt32;
3989 class MEDCouplingFieldInt64;
3990 class MEDCouplingFieldFloat;
3992 class MEDCouplingFieldDouble : public MEDCouplingFieldT<double>
3995 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3996 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3997 bool isEqual(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
3998 bool isEqualWithoutConsideringStr(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
3999 void setTimeUnit(const std::string& unit);
4000 std::string getTimeUnit() const;
4001 void synchronizeTimeWithSupport();
4002 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other);
4003 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other);
4004 std::string simpleRepr() const;
4005 std::string advancedRepr() const;
4006 std::string writeVTK(const std::string& fileName, bool isBinary=true) const;
4007 MEDCouplingFieldInt32 *convertToIntField() const;
4008 MEDCouplingFieldFloat *convertToFloatField() const;
4009 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
4010 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
4011 MEDCouplingFieldDouble *deepCopy() const;
4012 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const;
4013 MEDCouplingFieldDouble *nodeToCellDiscretization() const;
4014 MEDCouplingFieldDouble *cellToNodeDiscretization() const;
4015 double getIJ(int tupleId, int compoId) const;
4016 double getIJK(int cellId, int nodeIdInCell, int compoId) const;
4017 void synchronizeTimeWithMesh();
4018 void setArray(DataArrayDouble *array);
4019 void setEndArray(DataArrayDouble *array);
4020 void setTime(double val, int iteration, int order);
4021 void setStartTime(double val, int iteration, int order);
4022 void setEndTime(double val, int iteration, int order);
4023 void applyLin(double a, double b, int compoId);
4024 void applyLin(double a, double b);
4025 int getNumberOfComponents() const;
4026 int getNumberOfTuples() const;
4027 int getNumberOfValues() const;
4028 void setTimeTolerance(double val);
4029 double getTimeTolerance() const;
4030 void setIteration(int it);
4031 void setEndIteration(int it);
4032 void setOrder(int order);
4033 void setEndOrder(int order);
4034 void setTimeValue(double val);
4035 void setEndTimeValue(double val);
4036 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15);
4037 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15);
4038 bool mergeNodes(double eps, double epsOnVals=1e-15);
4039 bool mergeNodesCenter(double eps, double epsOnVals=1e-15);
4040 bool zipCoords(double epsOnVals=1e-15);
4041 bool zipConnectivity(int compType,double epsOnVals=1e-15);
4042 bool simplexize(int policy);
4043 MEDCouplingFieldDouble *doublyContractedProduct() const;
4044 MEDCouplingFieldDouble *determinant() const;
4045 MEDCouplingFieldDouble *eigenValues() const;
4046 MEDCouplingFieldDouble *eigenVectors() const;
4047 MEDCouplingFieldDouble *inverse() const;
4048 MEDCouplingFieldDouble *trace() const;
4049 MEDCouplingFieldDouble *deviator() const;
4050 MEDCouplingFieldDouble *magnitude() const;
4051 MEDCouplingFieldDouble *maxPerTuple() const;
4052 void changeNbOfComponents(std::size_t newNbOfComp, double dftValue=0.);
4053 void sortPerTuple(bool asc);
4054 MEDCouplingFieldDouble &operator=(double value);
4055 void fillFromAnalytic(int nbOfComp, const std::string& func);
4056 void fillFromAnalyticCompo(int nbOfComp, const std::string& func);
4057 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
4058 void applyFunc(int nbOfComp, const std::string& func);
4059 void applyFuncCompo(int nbOfComp, const std::string& func);
4060 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
4061 void applyFunc(int nbOfComp, double val);
4062 void applyFunc(const std::string& func);
4063 void applyFuncFast32(const std::string& func);
4064 void applyFuncFast64(const std::string& func);
4065 double accumulate(int compId) const;
4066 double getMaxValue() const;
4067 double getMinValue() const;
4068 double getAverageValue() const;
4069 double norm2() const;
4070 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4071 double getWeightedAverageValue(int compId, bool isWAbs) const;
4072 double integral(int compId, bool isWAbs) const;
4073 double normL1(int compId) const;
4074 double normL2(int compId) const;
4075 double normMax(int compId) const;
4076 DataArrayIdType *findIdsInRange(double vmin, double vmax) const;
4077 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const;
4078 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4079 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4080 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4081 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const;
4082 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4083 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const;
4084 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4085 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const;
4086 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4087 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4088 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4089 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4090 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4091 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const;
4092 MEDCouplingFieldDouble *negate() const;
4094 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4096 return MEDCouplingFieldDouble::New(type,td);
4099 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4101 return MEDCouplingFieldDouble::New(ft,td);
4104 std::string __str__() const
4106 return self->simpleRepr();
4109 std::string __repr__() const
4111 std::ostringstream oss;
4112 self->reprQuickOverview(oss);
4116 PyObject *isEqualIfNotWhy(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const
4119 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
4120 PyObject *ret=PyTuple_New(2);
4121 PyObject *ret0Py=ret0?Py_True:Py_False;
4123 PyTuple_SetItem(ret,0,ret0Py);
4124 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4128 MEDCouplingFieldDouble *voronoize(double eps) const
4130 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4134 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const
4136 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4140 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4142 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4144 DataArrayDouble *a,*a2;
4145 DataArrayDoubleTuple *aa,*aa2;
4146 std::vector<double> bb,bb2;
4148 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4149 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4150 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4153 DataArrayDouble *getArray()
4155 DataArrayDouble *ret=self->getArray();
4161 PyObject *getArrays() const
4163 std::vector<DataArrayDouble *> arrs=self->getArrays();
4164 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4167 std::size_t sz=arrs.size();
4168 PyObject *ret=PyTuple_New(sz);
4169 for(std::size_t i=0;i<sz;i++)
4172 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4174 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4179 void setArrays(PyObject *ls)
4181 std::vector<const DataArrayDouble *> tmp;
4182 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4183 std::size_t sz=tmp.size();
4184 std::vector<DataArrayDouble *> arrs(sz);
4185 for(std::size_t i=0;i<sz;i++)
4186 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4187 self->setArrays(arrs);
4190 DataArrayDouble *getEndArray()
4192 DataArrayDouble *ret=self->getEndArray();
4198 PyObject *getValueOn(PyObject *sl) const
4202 DataArrayDoubleTuple *aa;
4203 std::vector<double> bb;
4205 const MEDCouplingMesh *mesh=self->getMesh();
4207 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4208 int spaceDim=mesh->getSpaceDimension();
4209 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4210 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4212 mcIdType sz=ToIdType(self->getNumberOfComponents());
4213 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4214 self->getValueOn(spaceLoc,res);
4215 return convertDblArrToPyList<double>(res,sz);
4218 PyObject *getValueOnPos(mcIdType i, mcIdType j, mcIdType k) const
4220 mcIdType sz=ToIdType(self->getNumberOfComponents());
4221 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4222 self->getValueOnPos(i,j,k,res);
4223 return convertDblArrToPyList<double>(res,sz);
4226 DataArrayDouble *getValueOnMulti(PyObject *locs) const
4228 const MEDCouplingMesh *mesh(self->getMesh());
4230 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4233 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4234 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4235 mesh->getSpaceDimension(),true,nbPts);
4236 return self->getValueOnMulti(inp,(int)nbPts);
4239 PyObject *getValueOn(PyObject *sl, double time) const
4243 DataArrayDoubleTuple *aa;
4244 std::vector<double> bb;
4246 const MEDCouplingMesh *mesh=self->getMesh();
4248 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4249 int spaceDim=mesh->getSpaceDimension();
4250 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4251 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4254 mcIdType sz=ToIdType(self->getNumberOfComponents());
4255 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4256 self->getValueOn(spaceLoc,time,res);
4257 return convertDblArrToPyList<double>(res,sz);
4260 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
4262 if(self->getArray()!=0)
4263 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4266 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4267 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4268 self->setArray(arr);
4275 double tmp0=self->getTime(tmp1,tmp2);
4276 PyObject *res = PyList_New(3);
4277 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4278 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4279 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4283 PyObject *getStartTime()
4286 double tmp0=self->getStartTime(tmp1,tmp2);
4287 PyObject *res = PyList_New(3);
4288 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4289 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4290 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4294 PyObject *getEndTime()
4297 double tmp0=self->getEndTime(tmp1,tmp2);
4298 PyObject *res = PyList_New(3);
4299 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4300 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4301 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4304 PyObject *accumulate() const
4306 mcIdType sz=ToIdType(self->getNumberOfComponents());
4307 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4308 self->accumulate(tmp);
4309 return convertDblArrToPyList<double>(tmp,sz);
4311 PyObject *integral(bool isWAbs) const
4313 mcIdType sz=ToIdType(self->getNumberOfComponents());
4314 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4315 self->integral(isWAbs,tmp);
4316 return convertDblArrToPyList<double>(tmp,sz);
4318 PyObject *getWeightedAverageValue(bool isWAbs=true) const
4320 mcIdType sz=ToIdType(self->getNumberOfComponents());
4321 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4322 self->getWeightedAverageValue(tmp,isWAbs);
4323 return convertDblArrToPyList<double>(tmp,sz);
4325 PyObject *normL1() const
4327 mcIdType sz=ToIdType(self->getNumberOfComponents());
4328 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4330 return convertDblArrToPyList<double>(tmp,sz);
4332 PyObject *normL2() const
4334 mcIdType sz=ToIdType(self->getNumberOfComponents());
4335 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4337 return convertDblArrToPyList<double>(tmp,sz);
4339 PyObject *normMax() const
4341 mcIdType sz=ToIdType(self->getNumberOfComponents());
4342 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4344 return convertDblArrToPyList<double>(tmp,sz);
4346 void renumberCells(PyObject *li, bool check=true)
4348 mcIdType szArr,sw,iTypppArr;
4349 std::vector<mcIdType> stdvecTyyppArr;
4350 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4351 self->renumberCells(tmp,check);
4354 void renumberCellsWithoutMesh(PyObject *li, bool check=true)
4356 mcIdType szArr,sw,iTypppArr;
4357 std::vector<mcIdType> stdvecTyyppArr;
4358 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4359 self->renumberCellsWithoutMesh(tmp,check);
4362 void renumberNodes(PyObject *li, double eps=1e-15)
4364 mcIdType szArr,sw,iTypppArr;
4365 std::vector<mcIdType> stdvecTyyppArr;
4366 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4367 self->renumberNodes(tmp,eps);
4370 void renumberNodesWithoutMesh(PyObject *li, mcIdType newNbOfNodes, double eps=1e-15)
4372 mcIdType szArr,sw,iTypppArr;
4373 std::vector<mcIdType> stdvecTyyppArr;
4374 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4375 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4378 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const
4380 return fieldT_buildSubPart(self,li);
4383 MEDCouplingFieldDouble *__getitem__(PyObject *li) const
4385 return fieldT__getitem__(self,li);
4388 PyObject *getMaxValue2() const
4390 DataArrayIdType *tmp;
4391 double r1=self->getMaxValue2(tmp);
4392 PyObject *ret=PyTuple_New(2);
4393 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4394 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4398 PyObject *getMinValue2() const
4400 DataArrayIdType *tmp;
4401 double r1=self->getMinValue2(tmp);
4402 PyObject *ret=PyTuple_New(2);
4403 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4404 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4408 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const
4410 std::vector<std::size_t> tmp;
4411 convertPyToNewIntArr3(li,tmp);
4412 return self->keepSelectedComponents(tmp);
4415 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li)
4417 std::vector<std::size_t> tmp;
4418 convertPyToNewIntArr3(li,tmp);
4419 self->setSelectedComponents(f,tmp);
4422 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const
4425 DataArrayDouble *a,*a2;
4426 DataArrayDoubleTuple *aa,*aa2;
4427 std::vector<double> bb,bb2;
4430 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st parameter for origin.";
4431 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd parameter for vector.";
4432 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4433 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4435 return self->extractSlice3D(orig,vect,eps);
4438 MEDCouplingFieldDouble *__add__(PyObject *obj)
4440 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4443 MEDCouplingFieldDouble *__radd__(PyObject *obj)
4445 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4448 MEDCouplingFieldDouble *__sub__(PyObject *obj)
4450 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.";
4451 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4454 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4456 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4458 return (*self)-(*other);
4460 throw INTERP_KERNEL::Exception(msg);
4465 DataArrayDoubleTuple *aa;
4466 std::vector<double> bb;
4468 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4473 if(!self->getArray())
4474 throw INTERP_KERNEL::Exception(msg2);
4475 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4476 ret->applyLin(1.,-val);
4477 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4478 ret2->setArray(ret);
4483 if(!self->getArray())
4484 throw INTERP_KERNEL::Exception(msg2);
4485 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4486 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4487 ret2->setArray(ret);
4492 if(!self->getArray())
4493 throw INTERP_KERNEL::Exception(msg2);
4494 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4495 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4496 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4497 ret2->setArray(ret);
4502 if(!self->getArray())
4503 throw INTERP_KERNEL::Exception(msg2);
4504 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4505 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4506 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4507 ret2->setArray(ret);
4511 { throw INTERP_KERNEL::Exception(msg); }
4515 MEDCouplingFieldDouble *__rsub__(PyObject *obj)
4517 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4520 MEDCouplingFieldDouble *__mul__(PyObject *obj)
4522 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4525 MEDCouplingFieldDouble *__rmul__(PyObject *obj)
4527 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4530 MEDCouplingFieldDouble *__div__(PyObject *obj)
4532 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.";
4533 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4536 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4538 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4540 return (*self)/(*other);
4542 throw INTERP_KERNEL::Exception(msg);
4547 DataArrayDoubleTuple *aa;
4548 std::vector<double> bb;
4550 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4556 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4557 if(!self->getArray())
4558 throw INTERP_KERNEL::Exception(msg2);
4559 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4560 ret->applyLin(1./val,0);
4561 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4562 ret2->setArray(ret);
4567 if(!self->getArray())
4568 throw INTERP_KERNEL::Exception(msg2);
4569 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4570 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4571 ret2->setArray(ret);
4576 if(!self->getArray())
4577 throw INTERP_KERNEL::Exception(msg2);
4578 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4579 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4580 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4581 ret2->setArray(ret);
4586 if(!self->getArray())
4587 throw INTERP_KERNEL::Exception(msg2);
4588 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4589 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4590 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4591 ret2->setArray(ret);
4595 { throw INTERP_KERNEL::Exception(msg); }
4599 MEDCouplingFieldDouble *__rdiv__(PyObject *obj)
4601 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4604 MEDCouplingFieldDouble *__pow__(PyObject *obj)
4606 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.";
4607 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4610 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4612 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4614 return (*self)^(*other);
4616 throw INTERP_KERNEL::Exception(msg);
4621 DataArrayDoubleTuple *aa;
4622 std::vector<double> bb;
4624 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4629 if(!self->getArray())
4630 throw INTERP_KERNEL::Exception(msg2);
4631 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4633 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4634 ret2->setArray(ret);
4639 if(!self->getArray())
4640 throw INTERP_KERNEL::Exception(msg2);
4641 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4642 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4643 ret2->setArray(ret);
4648 if(!self->getArray())
4649 throw INTERP_KERNEL::Exception(msg2);
4650 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4651 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4652 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4653 ret2->setArray(ret);
4658 if(!self->getArray())
4659 throw INTERP_KERNEL::Exception(msg2);
4660 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4661 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4662 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4663 ret2->setArray(ret);
4667 { throw INTERP_KERNEL::Exception(msg); }
4671 MEDCouplingFieldDouble *__neg__() const
4673 return self->negate();
4676 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
4678 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.";
4679 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4682 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4684 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4688 Py_XINCREF(trueSelf);
4692 throw INTERP_KERNEL::Exception(msg);
4697 DataArrayDoubleTuple *aa;
4698 std::vector<double> bb;
4700 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4705 if(!self->getArray())
4706 throw INTERP_KERNEL::Exception(msg2);
4707 self->getArray()->applyLin(1.,val);
4708 Py_XINCREF(trueSelf);
4713 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4716 Py_XINCREF(trueSelf);
4721 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4722 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4723 ret2->setArray(aaa);
4725 Py_XINCREF(trueSelf);
4730 if(!self->getArray())
4731 throw INTERP_KERNEL::Exception(msg2);
4732 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4733 self->getArray()->addEqual(aaa);
4734 Py_XINCREF(trueSelf);
4738 { throw INTERP_KERNEL::Exception(msg); }
4742 PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
4744 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.";
4745 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4748 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4750 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4754 Py_XINCREF(trueSelf);
4758 throw INTERP_KERNEL::Exception(msg);
4763 DataArrayDoubleTuple *aa;
4764 std::vector<double> bb;
4766 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4771 if(!self->getArray())
4772 throw INTERP_KERNEL::Exception(msg2);
4773 self->getArray()->applyLin(1.,-val);
4774 Py_XINCREF(trueSelf);
4779 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4782 Py_XINCREF(trueSelf);
4787 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4788 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4789 ret2->setArray(aaa);
4791 Py_XINCREF(trueSelf);
4796 if(!self->getArray())
4797 throw INTERP_KERNEL::Exception(msg2);
4798 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4799 self->getArray()->substractEqual(aaa);
4800 Py_XINCREF(trueSelf);
4804 { throw INTERP_KERNEL::Exception(msg); }
4808 PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
4810 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.";
4811 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4814 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4816 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4820 Py_XINCREF(trueSelf);
4824 throw INTERP_KERNEL::Exception(msg);
4829 DataArrayDoubleTuple *aa;
4830 std::vector<double> bb;
4832 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4837 if(!self->getArray())
4838 throw INTERP_KERNEL::Exception(msg2);
4839 self->getArray()->applyLin(val,0);
4840 Py_XINCREF(trueSelf);
4845 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4848 Py_XINCREF(trueSelf);
4853 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4854 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4855 ret2->setArray(aaa);
4857 Py_XINCREF(trueSelf);
4862 if(!self->getArray())
4863 throw INTERP_KERNEL::Exception(msg2);
4864 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4865 self->getArray()->multiplyEqual(aaa);
4866 Py_XINCREF(trueSelf);
4870 { throw INTERP_KERNEL::Exception(msg); }
4874 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
4876 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.";
4877 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4880 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4882 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4886 Py_XINCREF(trueSelf);
4890 throw INTERP_KERNEL::Exception(msg);
4895 DataArrayDoubleTuple *aa;
4896 std::vector<double> bb;
4898 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4904 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4905 if(!self->getArray())
4906 throw INTERP_KERNEL::Exception(msg2);
4907 self->getArray()->applyLin(1./val,0);
4908 Py_XINCREF(trueSelf);
4913 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4916 Py_XINCREF(trueSelf);
4921 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4922 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4923 ret2->setArray(aaa);
4925 Py_XINCREF(trueSelf);
4930 if(!self->getArray())
4931 throw INTERP_KERNEL::Exception(msg2);
4932 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4933 self->getArray()->divideEqual(aaa);
4934 Py_XINCREF(trueSelf);
4938 { throw INTERP_KERNEL::Exception(msg); }
4942 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj)
4944 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.";
4945 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4948 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4950 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4954 Py_XINCREF(trueSelf);
4958 throw INTERP_KERNEL::Exception(msg);
4963 DataArrayDoubleTuple *aa;
4964 std::vector<double> bb;
4966 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4971 if(!self->getArray())
4972 throw INTERP_KERNEL::Exception(msg2);
4973 self->getArray()->applyPow(val);
4974 Py_XINCREF(trueSelf);
4979 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4982 Py_XINCREF(trueSelf);
4987 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4988 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4989 ret2->setArray(aaa);
4991 Py_XINCREF(trueSelf);
4996 if(!self->getArray())
4997 throw INTERP_KERNEL::Exception(msg2);
4998 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4999 self->getArray()->powEqual(aaa);
5000 Py_XINCREF(trueSelf);
5004 { throw INTERP_KERNEL::Exception(msg); }
5008 static MEDCouplingFieldDouble *MergeFields(PyObject *li)
5010 std::vector<const MEDCouplingFieldDouble *> tmp;
5011 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5012 return MEDCouplingFieldDouble::MergeFields(tmp);
5015 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true)
5017 std::vector<const MEDCouplingFieldDouble *> tmp;
5018 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5019 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
5022 PyObject *getTinySerializationInformation() const
5024 return field_getTinySerializationInformation<MEDCouplingFieldDouble>(self);
5027 PyObject *serialize() const
5029 return field_serialize<double>(self);
5032 PyObject *__getstate__() const
5034 return field__getstate__<MEDCouplingFieldDouble>(self,MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldDouble_serialize);
5037 void __setstate__(PyObject *inp)
5039 field__setstate__<double>(self,inp);
5044 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5047 int getNumberOfFields() const;
5048 MEDCouplingMultiFields *deepCopy() const;
5049 virtual std::string simpleRepr() const;
5050 virtual std::string advancedRepr() const;
5051 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5052 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5053 virtual void checkConsistencyLight() const;
5056 std::string __str__() const
5058 return self->simpleRepr();
5060 static MEDCouplingMultiFields *New(PyObject *li)
5062 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5063 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5064 std::size_t sz=tmp.size();
5065 std::vector<MEDCouplingFieldDouble *> fs(sz);
5066 for(std::size_t i=0;i<sz;i++)
5067 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5068 return MEDCouplingMultiFields::New(fs);
5070 MEDCouplingMultiFields(PyObject *li)
5072 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5073 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5074 std::size_t sz=tmp.size();
5075 std::vector<MEDCouplingFieldDouble *> fs(sz);
5076 for(std::size_t i=0;i<sz;i++)
5077 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5078 return MEDCouplingMultiFields::New(fs);
5080 PyObject *getFields() const
5082 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5083 std::size_t sz=fields.size();
5084 PyObject *res = PyList_New(sz);
5085 for(std::size_t i=0;i<sz;i++)
5089 fields[i]->incrRef();
5090 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5094 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5099 PyObject *getFieldAtPos(int id) const
5101 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5105 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5108 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5110 PyObject *getMeshes() const
5112 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5113 std::size_t sz=ms.size();
5114 PyObject *res = PyList_New(sz);
5115 for(std::size_t i=0;i<sz;i++)
5120 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5124 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5129 PyObject *getDifferentMeshes() const
5131 std::vector<int> refs;
5132 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5133 std::size_t sz=ms.size();
5134 PyObject *res = PyList_New(sz);
5135 for(std::size_t i=0;i<sz;i++)
5140 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5144 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5148 PyObject *ret=PyTuple_New(2);
5149 PyTuple_SetItem(ret,0,res);
5150 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5153 PyObject *getArrays() const
5155 std::vector<DataArrayDouble *> ms=self->getArrays();
5156 std::size_t sz=ms.size();
5157 PyObject *res = PyList_New(sz);
5158 for(std::size_t i=0;i<sz;i++)
5163 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5167 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5172 PyObject *getDifferentArrays() const
5174 std::vector< std::vector<int> > refs;
5175 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5176 std::size_t sz=ms.size();
5177 PyObject *res = PyList_New(sz);
5178 PyObject *res2 = PyList_New(sz);
5179 for(std::size_t i=0;i<sz;i++)
5184 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5188 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5190 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5193 PyObject *ret=PyTuple_New(2);
5194 PyTuple_SetItem(ret,0,res);
5195 PyTuple_SetItem(ret,1,res2);
5201 class MEDCouplingFieldInt32 : public MEDCouplingFieldT<int>
5204 static MEDCouplingFieldInt32 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5205 static MEDCouplingFieldInt32 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5206 bool isEqual(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const;
5207 bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const;
5208 void setTimeUnit(const std::string& unit);
5209 std::string getTimeUnit() const;
5210 void setTime(double val, int iteration, int order);
5211 void setArray(DataArrayInt32 *array);
5212 MEDCouplingFieldInt32 *deepCopy() const;
5213 MEDCouplingFieldInt32 *clone(bool recDeepCpy) const;
5214 MEDCouplingFieldInt32 *cloneWithMesh(bool recDeepCpy) const;
5215 MEDCouplingFieldDouble *convertToDblField() const;
5216 MEDCouplingFieldInt32 *buildSubPartRange(int begin, int end, int step) const;
5218 MEDCouplingFieldInt32(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5220 return MEDCouplingFieldInt32::New(type,td);
5223 MEDCouplingFieldInt32(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5225 return MEDCouplingFieldInt32::New(ft,td);
5228 PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const
5231 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5232 PyObject *ret=PyTuple_New(2);
5233 PyObject *ret0Py=ret0?Py_True:Py_False;
5235 PyTuple_SetItem(ret,0,ret0Py);
5236 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5240 std::string __str__() const
5242 return self->simpleRepr();
5245 std::string __repr__() const
5247 std::ostringstream oss;
5248 self->reprQuickOverview(oss);
5252 MEDCouplingFieldInt32 *buildSubPart(PyObject *li) const
5254 return fieldT_buildSubPart(self,li);
5257 MEDCouplingFieldInt32 *__getitem__(PyObject *li) const
5259 return fieldT__getitem__(self,li);
5262 DataArrayInt32 *getArray()
5264 DataArrayInt32 *ret=self->getArray();
5273 double tmp0=self->getTime(tmp1,tmp2);
5274 PyObject *res = PyList_New(3);
5275 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5276 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5277 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5281 PyObject *getTinySerializationInformation() const
5283 return field_getTinySerializationInformation<MEDCouplingFieldInt32>(self);
5286 PyObject *serialize() const
5288 return field_serialize<int>(self);
5291 PyObject *__getstate__() const
5293 return field__getstate__<MEDCouplingFieldInt32>(self,MEDCoupling_MEDCouplingFieldInt32_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt32_serialize);
5296 void __setstate__(PyObject *inp)
5298 field__setstate__<int>(self,inp);
5303 class MEDCouplingFieldInt64 : public MEDCouplingFieldT<int>
5306 static MEDCouplingFieldInt64 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5307 static MEDCouplingFieldInt64 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5308 bool isEqual(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
5309 bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
5310 void setTimeUnit(const std::string& unit);
5311 std::string getTimeUnit() const;
5312 void setTime(double val, int iteration, int order);
5313 void setArray(DataArrayInt64 *array);
5314 MEDCouplingFieldInt64 *deepCopy() const;
5315 MEDCouplingFieldInt64 *clone(bool recDeepCpy) const;
5316 MEDCouplingFieldInt64 *cloneWithMesh(bool recDeepCpy) const;
5317 MEDCouplingFieldDouble *convertToDblField() const;
5318 MEDCouplingFieldInt64 *buildSubPartRange(int begin, int end, int step) const;
5320 MEDCouplingFieldInt64(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5322 return MEDCouplingFieldInt64::New(type,td);
5325 MEDCouplingFieldInt64(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5327 return MEDCouplingFieldInt64::New(ft,td);
5330 PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const
5333 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5334 PyObject *ret=PyTuple_New(2);
5335 PyObject *ret0Py=ret0?Py_True:Py_False;
5337 PyTuple_SetItem(ret,0,ret0Py);
5338 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5342 std::string __str__() const
5344 return self->simpleRepr();
5347 std::string __repr__() const
5349 std::ostringstream oss;
5350 self->reprQuickOverview(oss);
5354 MEDCouplingFieldInt64 *buildSubPart(PyObject *li) const
5356 return fieldT_buildSubPart(self,li);
5359 MEDCouplingFieldInt64 *__getitem__(PyObject *li) const
5361 return fieldT__getitem__(self,li);
5364 DataArrayInt64 *getArray()
5366 DataArrayInt64 *ret=self->getArray();
5375 double tmp0=self->getTime(tmp1,tmp2);
5376 PyObject *res = PyList_New(3);
5377 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5378 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5379 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5383 PyObject *getTinySerializationInformation() const
5385 return field_getTinySerializationInformation<MEDCouplingFieldInt64>(self);
5388 PyObject *serialize() const
5390 return field_serialize<Int64>(self);
5393 PyObject *__getstate__() const
5395 return field__getstate__<MEDCouplingFieldInt64>(self,MEDCoupling_MEDCouplingFieldInt64_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt64_serialize);
5398 void __setstate__(PyObject *inp)
5400 field__setstate__<Int64>(self,inp);
5405 class MEDCouplingFieldFloat : public MEDCouplingFieldT<float>
5408 static MEDCouplingFieldFloat *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5409 static MEDCouplingFieldFloat *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5410 bool isEqual(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
5411 bool isEqualWithoutConsideringStr(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
5412 void setTimeUnit(const std::string& unit);
5413 std::string getTimeUnit() const;
5414 void setTime(double val, int iteration, int order);
5415 void setArray(DataArrayFloat *array);
5416 MEDCouplingFieldFloat *deepCopy() const;
5417 MEDCouplingFieldFloat *clone(bool recDeepCpy) const;
5418 MEDCouplingFieldFloat *cloneWithMesh(bool recDeepCpy) const;
5419 MEDCouplingFieldDouble *convertToDblField() const;
5420 MEDCouplingFieldFloat *buildSubPartRange(int begin, int end, int step) const;
5422 MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5424 return MEDCouplingFieldFloat::New(type,td);
5427 MEDCouplingFieldFloat(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5429 return MEDCouplingFieldFloat::New(ft,td);
5432 PyObject *isEqualIfNotWhy(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const
5435 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5436 PyObject *ret=PyTuple_New(2);
5437 PyObject *ret0Py=ret0?Py_True:Py_False;
5439 PyTuple_SetItem(ret,0,ret0Py);
5440 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5444 std::string __str__() const
5446 return self->simpleRepr();
5449 std::string __repr__() const
5451 std::ostringstream oss;
5452 self->reprQuickOverview(oss);
5456 MEDCouplingFieldFloat *buildSubPart(PyObject *li) const
5458 return fieldT_buildSubPart(self,li);
5461 MEDCouplingFieldFloat *__getitem__(PyObject *li) const
5463 return fieldT__getitem__(self,li);
5466 DataArrayFloat *getArray()
5468 DataArrayFloat *ret=self->getArray();
5477 double tmp0=self->getTime(tmp1,tmp2);
5478 PyObject *res = PyList_New(3);
5479 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5480 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5481 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5485 PyObject *getTinySerializationInformation() const
5487 return field_getTinySerializationInformation<MEDCouplingFieldFloat>(self);
5490 PyObject *serialize() const
5492 return field_serialize<float>(self);
5495 PyObject *__getstate__() const
5497 return field__getstate__<MEDCouplingFieldFloat>(self,MEDCoupling_MEDCouplingFieldFloat_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldFloat_serialize);
5500 void __setstate__(PyObject *inp)
5502 field__setstate__<float>(self,inp);
5507 class MEDCouplingDefinitionTime
5510 MEDCouplingDefinitionTime();
5511 void assign(const MEDCouplingDefinitionTime& other);
5512 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5513 double getTimeResolution() const;
5514 std::vector<double> getHotSpotsTime() const;
5517 std::string __str__() const
5519 std::ostringstream oss;
5520 self->appendRepr(oss);
5524 PyObject *getIdsOnTimeRight(double tm) const
5526 int meshId,arrId,arrIdInField,fieldId;
5527 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5528 PyObject *res=PyList_New(4);
5529 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5530 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5531 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5532 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5536 PyObject *getIdsOnTimeLeft(double tm) const
5538 int meshId,arrId,arrIdInField,fieldId;
5539 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5540 PyObject *res=PyList_New(4);
5541 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5542 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5543 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5544 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5550 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5553 double getTimeTolerance() const;
5554 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5558 MEDCouplingFieldOverTime(PyObject *li)
5560 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5561 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5562 std::size_t sz=tmp.size();
5563 std::vector<MEDCouplingFieldDouble *> fs(sz);
5564 for(std::size_t i=0;i<sz;i++)
5565 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5566 return MEDCouplingFieldOverTime::New(fs);
5568 std::string __str__() const
5570 return self->simpleRepr();
5572 static MEDCouplingFieldOverTime *New(PyObject *li)
5574 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5575 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5576 std::size_t sz=tmp.size();
5577 std::vector<MEDCouplingFieldDouble *> fs(sz);
5578 for(std::size_t i=0;i<sz;i++)
5579 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5580 return MEDCouplingFieldOverTime::New(fs);
5585 class MEDCouplingCartesianAMRMesh;
5587 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5590 int getNumberOfCellsRecursiveWithOverlap() const;
5591 int getNumberOfCellsRecursiveWithoutOverlap() const;
5592 int getMaxNumberOfLevelsRelativeToThis() const;
5595 MEDCouplingCartesianAMRMeshGen *getMesh() const
5597 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5605 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5608 int getNumberOfOverlapedCellsForFather() const;
5609 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const;
5610 std::vector<mcIdType> computeCellGridSt() const;
5613 PyObject *getBLTRRange() const
5615 const std::vector< std::pair<mcIdType,mcIdType> >& ret(self->getBLTRRange());
5616 return convertFromVectorPairInt(ret);
5619 PyObject *getBLTRRangeRelativeToGF() const
5621 std::vector< std::pair<mcIdType,mcIdType> > ret(self->getBLTRRangeRelativeToGF());
5622 return convertFromVectorPairInt(ret);
5625 void addPatch(PyObject *bottomLeftTopRight, const std::vector<mcIdType>& factors)
5627 std::vector< std::pair<mcIdType,mcIdType> > inp;
5628 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5629 self->addPatch(inp,factors);
5632 MEDCouplingCartesianAMRPatch *__getitem__(mcIdType patchId) const
5634 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5636 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5637 if(patchId==mesh->getNumberOfPatches())
5639 std::ostringstream oss;
5640 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5641 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5644 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5650 void __delitem__(mcIdType patchId)
5652 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5654 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5655 mesh->removePatch(patchId);
5658 mcIdType __len__() const
5660 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5662 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5663 return mesh->getNumberOfPatches();
5668 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5672 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5675 mcIdType getAbsoluteLevel() const;
5676 mcIdType getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
5677 std::vector<mcIdType> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
5678 int getSpaceDimension() const;
5679 const std::vector<mcIdType>& getFactors() const;
5680 void setFactors(const std::vector<mcIdType>& newFactors);
5681 mcIdType getMaxNumberOfLevelsRelativeToThis() const;
5682 mcIdType getNumberOfCellsAtCurrentLevel() const;
5683 mcIdType getNumberOfCellsAtCurrentLevelGhost(mcIdType ghostLev) const;
5684 mcIdType getNumberOfCellsRecursiveWithOverlap() const;
5685 mcIdType getNumberOfCellsRecursiveWithoutOverlap() const;
5686 bool isPatchInNeighborhoodOf(mcIdType patchId1, mcIdType patchId2, mcIdType ghostLev) const;
5687 virtual void detachFromFather();
5689 mcIdType getNumberOfPatches() const;
5690 mcIdType getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const;
5691 MEDCouplingUMesh *buildUnstructured() const;
5692 DataArrayDouble *extractGhostFrom(mcIdType ghostSz, const DataArrayDouble *arr) const;
5693 std::vector<mcIdType> getPatchIdsInTheNeighborhoodOf(mcIdType patchId, mcIdType ghostLev) const;
5694 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const;
5695 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const;
5696 void removeAllPatches();
5697 void removePatch(mcIdType patchId);
5698 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<mcIdType>& factors);
5699 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<mcIdType>& factors, double eps);
5700 DataArrayDouble *createCellFieldOnPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnThis) const;
5701 void fillCellFieldOnPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const;
5702 void fillCellFieldOnPatchGhost(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev, bool isConservative=true) const;
5703 void fillCellFieldOnPatchOnlyOnGhostZone(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev) const;
5704 void fillCellFieldOnPatchOnlyOnGhostZoneWith(mcIdType ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5705 void fillCellFieldComingFromPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const;
5706 void fillCellFieldComingFromPatchGhost(mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, bool isConservative=true) const;
5707 DataArrayIdType *findPatchesInTheNeighborhoodOf(mcIdType patchId, mcIdType ghostLev) const;
5708 std::string buildPythonDumpOfThis() const;
5711 void addPatch(PyObject *bottomLeftTopRight, const std::vector<mcIdType>& factors)
5713 std::vector< std::pair<mcIdType,mcIdType> > inp;
5714 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5715 self->addPatch(inp,factors);
5718 PyObject *getPatches() const
5720 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5721 std::size_t sz(ps.size());
5722 PyObject *ret = PyList_New(sz);
5723 for(std::size_t i=0;i<sz;i++)
5725 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5728 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5733 // agy : don't know why typemap fails here ??? let it in the extend section
5734 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const
5736 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5739 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<mcIdType>& pos) const
5741 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5742 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5748 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<mcIdType>& pos) const
5750 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5751 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5757 virtual PyObject *positionRelativeToGodFather() const
5759 std::vector<mcIdType> out1;
5760 std::vector< std::pair<mcIdType,mcIdType> > out0(self->positionRelativeToGodFather(out1));
5761 PyObject *ret(PyTuple_New(2));
5762 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5763 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5767 virtual PyObject *retrieveGridsAt(mcIdType absoluteLev) const
5769 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5770 std::size_t sz(ps.size());
5771 PyObject *ret = PyList_New(sz);
5772 for(std::size_t i=0;i<sz;i++)
5773 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5777 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(mcIdType ghostSz, PyObject *recurseArrs) const
5779 std::vector<const DataArrayDouble *> inp;
5780 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5781 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5784 virtual MEDCouplingCartesianAMRMeshGen *getFather() const
5786 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5792 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const
5794 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5800 MEDCouplingCartesianAMRPatch *getPatch(mcIdType patchId) const
5802 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5808 MEDCouplingIMesh *getImageMesh() const
5810 const MEDCouplingIMesh *ret(self->getImageMesh());
5813 return const_cast<MEDCouplingIMesh *>(ret);
5816 MEDCouplingCartesianAMRPatch *__getitem__(mcIdType patchId) const
5818 if(patchId==self->getNumberOfPatches())
5820 std::ostringstream oss;
5821 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5822 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5825 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5831 void fillCellFieldOnPatchGhostAdv(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const
5833 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5834 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5835 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5838 void fillCellFieldOnPatchOnlyGhostAdv(mcIdType patchId, mcIdType ghostLev, PyObject *arrsOnPatches) const
5840 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5841 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5842 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5845 void __delitem__(mcIdType patchId)
5847 self->removePatch(patchId);
5850 mcIdType __len__() const
5852 return self->getNumberOfPatches();
5857 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5861 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5864 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh);
5867 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
5869 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5870 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5871 const mcIdType *nodeStrctPtr(0);
5872 const double *originPtr(0),*dxyzPtr(0);
5873 mcIdType sw,sz,val0;
5874 std::vector<mcIdType> bb0;
5875 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
5878 std::vector<double> bb,bb2;
5880 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5881 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5883 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5886 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps)
5888 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5889 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5890 std::vector< std::vector<mcIdType> > inp2;
5891 convertPyToVectorOfVectorOfInt(factors,inp2);
5892 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5895 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
5897 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5900 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh)
5902 return MEDCouplingCartesianAMRMesh::New(mesh);
5907 class MEDCouplingDataForGodFather : public RefCountObject
5910 virtual void synchronizeFineToCoarse();
5911 virtual void synchronizeFineToCoarseBetween(mcIdType fromLev, mcIdType toLev);
5912 virtual void synchronizeCoarseToFine();
5913 virtual void synchronizeCoarseToFineBetween(mcIdType fromLev, mcIdType toLev);
5914 virtual void synchronizeAllGhostZones();
5915 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh);
5916 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(mcIdType level);
5917 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(mcIdType level);
5918 virtual void alloc();
5919 virtual void dealloc();
5922 MEDCouplingCartesianAMRMesh *getMyGodFather()
5924 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5932 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5935 mcIdType getNumberOfLevels() const;
5936 MEDCouplingAMRAttribute *deepCopy() const;
5937 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const;
5938 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5939 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5940 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5941 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf);
5942 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const;
5943 std::string writeVTHB(const std::string& fileName) const;
5946 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, mcIdType ghostLev)
5948 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5949 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5950 MEDCouplingAMRAttribute *ret(0);
5953 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5954 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5956 catch(INTERP_KERNEL::Exception&)
5958 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5959 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5964 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, mcIdType ghostLev)
5966 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5969 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const
5971 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5972 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5978 void spillInfoOnComponents(PyObject *compNames)
5980 std::vector< std::vector<std::string> > compNamesCpp;
5981 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5982 self->spillInfoOnComponents(compNamesCpp);
5985 void spillNatures(PyObject *nfs)
5987 std::vector<mcIdType> inp0;
5988 if(!fillIntVector(nfs,inp0))
5989 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5990 std::size_t sz(inp0.size());
5991 std::vector<NatureOfField> inp00(sz);
5992 for(std::size_t i=0;i<sz;i++)
5993 inp00[i]=(NatureOfField)inp0[i];
5994 self->spillNatures(inp00);
5997 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const
5999 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
6000 std::size_t sz(ret.size());
6001 PyObject *retPy(PyList_New(sz));
6002 for(std::size_t i=0;i<sz;i++)
6003 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
6009 class DenseMatrix : public RefCountObject, public TimeLabel
6012 static DenseMatrix *New(mcIdType nbRows, mcIdType nbCols);
6013 static DenseMatrix *New(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols);
6014 DenseMatrix *deepCopy() const;
6015 DenseMatrix *shallowCpy() const;
6017 mcIdType getNumberOfRows() const;
6018 mcIdType getNumberOfCols() const;
6019 mcIdType getNbOfElems() const;
6020 void reBuild(DataArrayDouble *array, mcIdType nbRows=-1, mcIdType nbCols=-1);
6021 void reShape(mcIdType nbRows, mcIdType nbCols);
6024 bool isEqual(const DenseMatrix& other, double eps) const;
6025 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const;
6026 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec);
6029 DenseMatrix(mcIdType nbRows, mcIdType nbCols)
6031 return DenseMatrix::New(nbRows,nbCols);
6034 DenseMatrix(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols)
6036 return DenseMatrix::New(array,nbRows,nbCols);
6039 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const
6042 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
6043 PyObject *ret=PyTuple_New(2);
6044 PyObject *ret0Py=ret0?Py_True:Py_False;
6046 PyTuple_SetItem(ret,0,ret0Py);
6047 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
6051 DataArrayDouble *getData()
6053 DataArrayDouble *ret(self->getData());
6059 DenseMatrix *__add__(const DenseMatrix *other)
6061 return MEDCoupling::DenseMatrix::Add(self,other);
6064 DenseMatrix *__sub__(const DenseMatrix *other)
6066 return MEDCoupling::DenseMatrix::Substract(self,other);
6069 DenseMatrix *__mul__(const DenseMatrix *other)
6071 return MEDCoupling::DenseMatrix::Multiply(self,other);
6074 DenseMatrix *__mul__(const DataArrayDouble *other)
6076 return MEDCoupling::DenseMatrix::Multiply(self,other);
6079 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other)
6081 self->addEqual(other);
6082 Py_XINCREF(trueSelf);
6086 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other)
6088 self->substractEqual(other);
6089 Py_XINCREF(trueSelf);
6093 PyObject *toNumPyMatrix() // not const. It is not a bug !
6095 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
6104 def MEDCouplingUMeshReduce(self):
6105 return MEDCouplingStdReduceFunct,(MEDCouplingUMesh,((),(self.__getstate__()),))
6106 def MEDCouplingCMeshReduce(self):
6107 return MEDCouplingStdReduceFunct,(MEDCouplingCMesh,((),(self.__getstate__()),))
6108 def MEDCouplingIMeshReduce(self):
6109 return MEDCouplingStdReduceFunct,(MEDCouplingIMesh,((),(self.__getstate__()),))
6110 def MEDCouplingMappedExtrudedMeshReduce(self):
6111 return MEDCouplingStdReduceFunct,(MEDCouplingMappedExtrudedMesh,((),(self.__getstate__()),))
6112 def MEDCouplingCurveLinearMeshReduce(self):
6113 return MEDCouplingStdReduceFunct,(MEDCouplingCurveLinearMesh,((),(self.__getstate__()),))
6114 def MEDCoupling1SGTUMeshReduce(self):
6115 return MEDCouplingStdReduceFunct,(MEDCoupling1SGTUMesh,((),(self.__getstate__()),))
6116 def MEDCoupling1DGTUMeshReduce(self):
6117 return MEDCouplingStdReduceFunct,(MEDCoupling1DGTUMesh,((),(self.__getstate__()),))
6118 def MEDCouplingFieldDoubleReduce(self):
6119 self.checkConsistencyLight()
6120 d=(self.getTypeOfField(),self.getTimeDiscretization())
6121 return MEDCouplingStdReduceFunct,(MEDCouplingFieldDouble,(d,(self.__getstate__()),))
6122 def MEDCouplingFieldInt32Reduce(self):
6123 self.checkConsistencyLight()
6124 d=(self.getTypeOfField(),self.getTimeDiscretization())
6125 return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt32,(d,(self.__getstate__()),))
6126 def MEDCouplingFieldInt64Reduce(self):
6127 self.checkConsistencyLight()
6128 d=(self.getTypeOfField(),self.getTimeDiscretization())
6129 return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt64,(d,(self.__getstate__()),))
6130 def MEDCouplingFieldFloatReduce(self):
6131 self.checkConsistencyLight()
6132 d=(self.getTypeOfField(),self.getTimeDiscretization())
6133 return MEDCouplingStdReduceFunct,(MEDCouplingFieldFloat,(d,(self.__getstate__()),))
6134 def MEDCouplingFTReduceFunct(cls,params):
6136 ret=object.__new__(cls)
6140 def MEDCouplingFieldTemplateReduce(self):
6141 ret = MEDCouplingFieldDouble(self)
6142 nbTuples = self.getNumberOfTuplesExpected()
6143 arr = DataArrayDouble(nbTuples) ; arr[:] = 0.
6145 return MEDCouplingFTReduceFunct,(MEDCouplingFieldTemplate,((ret,),()))
6147 # Forwarding DataArrayInt functions to MEDCouplingUMesh:
6149 MEDCouplingUMesh.ExtractFromIndexedArrays = DataArrayInt.ExtractFromIndexedArrays
6150 MEDCouplingUMesh.ExtractFromIndexedArraysSlice = DataArrayInt.ExtractFromIndexedArraysSlice
6151 MEDCouplingUMesh.SetPartOfIndexedArrays = DataArrayInt.SetPartOfIndexedArrays
6152 MEDCouplingUMesh.SetPartOfIndexedArraysSameIdx = DataArrayInt.SetPartOfIndexedArraysSameIdx
6153 MEDCouplingUMesh.RemoveIdsFromIndexedArrays = DataArrayInt.RemoveIdsFromIndexedArrays
6154 MEDCouplingFieldInt = MEDCouplingFieldInt32
6156 if MEDCouplingUse64BitIDs():
6157 MEDCouplingFieldID = MEDCouplingFieldInt64
6159 MEDCouplingFieldID = MEDCouplingFieldInt32
6165 __filename=os.environ.get('PYTHONSTARTUP')
6166 if __filename and os.path.isfile(__filename):
6167 with open(__filename) as __fp: