1 // Copyright (C) 2017-2020 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::computeCellCenterOfMass;
313 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
314 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
315 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
316 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
317 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
318 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
319 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
320 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
321 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
322 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
323 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
324 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
325 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
326 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
327 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
328 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
329 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
330 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
331 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
332 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
333 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
334 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
335 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
336 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
337 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
338 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
339 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
340 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
341 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
342 %newobject MEDCoupling::MEDCouplingUMesh::New;
343 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
344 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
345 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
346 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
347 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
348 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
349 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
350 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
351 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
352 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
353 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
354 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
355 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
356 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
357 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
358 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
359 %newobject MEDCoupling::MEDCouplingUMesh::conformize3D;
360 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
361 %newobject MEDCoupling::MEDCouplingUMesh::colinearizeKeepingConform2D;
362 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
363 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
364 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
365 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
366 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
367 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
368 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
369 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
370 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
371 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
372 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
373 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
374 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
375 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
376 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
377 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
378 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
379 %newobject MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords;
380 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
381 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
382 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
383 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
384 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
385 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
386 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
387 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
388 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
389 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
390 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
391 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
392 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
393 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
394 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
395 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
396 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
397 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
398 %newobject MEDCoupling::MEDCouplingUMesh::convertDegeneratedCellsAndRemoveFlatOnes;
399 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
400 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
401 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
402 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
403 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
404 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
405 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
406 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
407 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
408 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
409 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
410 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
411 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
412 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
413 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
414 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
415 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
416 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
417 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
418 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
419 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
420 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
421 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
422 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
423 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
424 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
425 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
426 %newobject MEDCoupling::MEDCouplingCMesh::New;
427 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
428 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
429 %newobject MEDCoupling::MEDCouplingIMesh::New;
430 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
431 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
432 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
433 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
434 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
435 %newobject MEDCoupling::MEDCouplingMultiFields::New;
436 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
437 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
438 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
439 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
440 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
441 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
442 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
443 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
444 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
445 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
446 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
447 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
448 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
449 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
450 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
451 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
452 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
453 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
454 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
455 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
456 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
457 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
458 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
459 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
460 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
461 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
462 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
463 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
464 %newobject MEDCoupling::DenseMatrix::New;
465 %newobject MEDCoupling::DenseMatrix::deepCopy;
466 %newobject MEDCoupling::DenseMatrix::shallowCpy;
467 %newobject MEDCoupling::DenseMatrix::getData;
468 %newobject MEDCoupling::DenseMatrix::matVecMult;
469 %newobject MEDCoupling::DenseMatrix::MatVecMult;
470 %newobject MEDCoupling::DenseMatrix::__add__;
471 %newobject MEDCoupling::DenseMatrix::__sub__;
472 %newobject MEDCoupling::DenseMatrix::__mul__;
473 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
474 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
475 %newobject MEDCoupling::MEDCouplingSkyLineArray::BuildFromPolyhedronConn;
476 %newobject MEDCoupling::MEDCouplingSkyLineArray::getSuperIndexArray;
477 %newobject MEDCoupling::MEDCouplingSkyLineArray::getIndexArray;
478 %newobject MEDCoupling::MEDCouplingSkyLineArray::getValuesArray;
479 %newobject MEDCoupling::MEDCouplingSkyLineArray::groupPacks;
480 %newobject MEDCoupling::MEDCouplingSkyLineArray::uniqueNotSortedByPack;
481 %newobject MEDCoupling::MEDCouplingSkyLineArray::AggregatePacks;
482 %newobject MEDCoupling::MEDCouplingSkyLineArray::deepCopy;
484 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
485 %feature("unref") MEDCouplingMesh "$this->decrRef();"
486 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
487 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
488 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
489 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
490 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
491 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
492 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
493 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
494 %feature("unref") MEDCouplingField "$this->decrRef();"
495 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
496 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
497 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
498 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
499 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
500 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
501 %feature("unref") MEDCouplingFieldFloat "$this->decrRef();"
502 %feature("unref") MEDCouplingFieldInt32 "$this->decrRef();"
503 %feature("unref") MEDCouplingFieldInt64 "$this->decrRef();"
504 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
505 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
506 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
507 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
508 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
509 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
510 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
511 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
512 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
513 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
514 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
515 %feature("unref") DenseMatrix "$this->decrRef();"
516 %feature("unref") MEDCouplingSkyLineArray "$this->decrRef();"
518 %rename(assign) *::operator=;
519 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
520 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
521 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
522 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
526 // ABN: Instruct SWIG that INTERP_KERNEL::Exception is an exception class and that it should inherit Exception
527 // on the Python side. Must be put BEFORE the %rename clause:
528 %exceptionclass INTERP_KERNEL::Exception;
529 %rename (InterpKernelException) INTERP_KERNEL::Exception;
531 %include "MEDCouplingRefCountObject.i"
532 %include "MEDCouplingMemArray.i"
536 {// AGY : here initialization of C++ traits in MEDCouplingDataArrayTypemaps.i for code factorization. Awful, I know, but no other solutions.
537 SWIGTITraits<double>::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble;
538 SWIGTITraits<float>::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat;
539 SWIGTITraits<Int32>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt32;
540 SWIGTITraits<Int64>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt64;
541 SWIGTITraits<double>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple;
542 SWIGTITraits<float>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayFloatTuple;
543 SWIGTITraits<Int32>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayInt32Tuple;
544 SWIGTITraits<Int64>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayInt64Tuple;
550 PyObject *med2vtk_cell_types()
552 Py_ssize_t sz(sizeof(MEDCOUPLING2VTKTYPETRADUCER)/sizeof(decltype(MEDCOUPLING2VTKTYPETRADUCER[0])));
553 PyObject *ret(PyList_New(sz));
554 for(Py_ssize_t i=0;i<sz;i++)
556 mcIdType elt = MEDCOUPLING2VTKTYPETRADUCER[i]!=MEDCOUPLING2VTKTYPETRADUCER_NONE ? MEDCOUPLING2VTKTYPETRADUCER[i] : -1;
557 PyList_SetItem(ret,i,PyInt_FromLong(elt));
562 PyObject *vtk2med_cell_types()
564 Py_ssize_t sz(sizeof(MEDCOUPLING2VTKTYPETRADUCER)/sizeof(decltype(MEDCOUPLING2VTKTYPETRADUCER[0])));
565 auto maxElt(*std::max_element(MEDCOUPLING2VTKTYPETRADUCER,MEDCOUPLING2VTKTYPETRADUCER+sz,[](unsigned char a, unsigned char b) { if(b==MEDCOUPLING2VTKTYPETRADUCER_NONE) return false; else return a<b; } ));
566 auto szOut(maxElt+1);
567 std::vector< mcIdType > retCpp(szOut,-1);
569 for(const unsigned char *it=MEDCOUPLING2VTKTYPETRADUCER;it!=MEDCOUPLING2VTKTYPETRADUCER+sz;it++,id++)
571 if(*it!=MEDCOUPLING2VTKTYPETRADUCER_NONE)
575 PyObject *ret(PyList_New(szOut));
577 for(auto it=retCpp.begin();it!=retCpp.end();it++,id++)
578 PyList_SetItem(ret,id,PyInt_FromLong(*it));
582 PyObject *AllGeometricTypes()
584 Py_ssize_t sz(MEDCouplingUMesh::N_MEDMEM_ORDER);
585 PyObject *ret(PyList_New(sz));
586 for(Py_ssize_t i=0;i<sz;i++)
587 PyList_SetItem(ret,i,PyInt_FromLong(MEDCouplingUMesh::MEDMEM_ORDER[i]));
592 namespace INTERP_KERNEL
595 * \class BoxSplittingOptions
596 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
598 class BoxSplittingOptions
601 BoxSplittingOptions();
603 double getEfficiencyGoal() const;
604 void setEfficiencyGoal(double efficiency);
605 double getEfficiencyThreshold() const;
606 void setEfficiencyThreshold(double efficiencyThreshold);
607 int getMinimumPatchLength() const;
608 void setMinimumPatchLength(int minPatchLength);
609 int getMaximumPatchLength() const;
610 void setMaximumPatchLength(int maxPatchLength);
611 int getMaximumNbOfCellsInPatch() const;
612 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch);
613 void copyOptions(const BoxSplittingOptions & other);
614 std::string printOptions() const;
617 std::string __str__() const
619 return self->printOptions();
625 namespace MEDCoupling
641 CONST_ON_TIME_INTERVAL = 7
642 } TypeOfTimeDiscretization;
650 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
651 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
653 } MEDCouplingMeshType;
655 class DataArrayInt32;
656 class DataArrayInt64;
657 class DataArrayDouble;
658 class MEDCouplingUMesh;
659 class MEDCouplingCMesh;
660 class MEDCouplingFieldDouble;
662 %extend RefCountObject
664 std::string getHiddenCppPointer() const
666 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
671 %extend MEDCouplingGaussLocalization
673 std::string __str__() const
675 return self->getStringRepr();
678 std::string __repr__() const
680 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
681 oss << self->getStringRepr();
688 class MEDCouplingMesh : public RefCountObject, public TimeLabel
691 void setName(const std::string& name);
692 std::string getName() const;
693 void setDescription(const std::string& descr);
694 std::string getDescription() const;
695 void setTime(double val, int iteration, int order);
696 void setTimeUnit(const std::string& unit);
697 std::string getTimeUnit() const;
698 virtual MEDCouplingMeshType getType() const;
699 bool isStructured() const;
700 virtual MEDCouplingMesh *deepCopy() const;
701 virtual MEDCouplingMesh *clone(bool recDeepCpy) const;
702 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const;
703 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
704 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const;
705 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other);
706 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other);
707 virtual void checkConsistencyLight() const;
708 virtual void checkConsistency(double eps=1e-12) const;
709 virtual int getNumberOfCells() const;
710 virtual int getNumberOfNodes() const;
711 virtual int getSpaceDimension() const;
712 virtual int getMeshDimension() const;
713 virtual DataArrayDouble *getCoordinatesAndOwner() const;
714 virtual DataArrayDouble *computeCellCenterOfMass() const;
715 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
716 virtual DataArrayIdType *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
717 virtual DataArrayIdType *computeNbOfNodesPerCell() const;
718 virtual DataArrayIdType *computeNbOfFacesPerCell() const;
719 virtual DataArrayIdType *computeEffectiveNbOfNodesPerCell() const;
720 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const;
721 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
722 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
723 virtual std::string simpleRepr() const;
724 virtual std::string advancedRepr() const;
725 std::string writeVTK(const std::string& fileName, bool isBinary=true) const;
726 virtual std::string getVTKFileExtension() const;
727 std::string getVTKFileNameOf(const std::string& fileName) const;
729 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const;
730 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const;
731 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const;
732 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const;
733 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const;
734 virtual MEDCouplingFieldDouble *buildOrthogonalField() const;
735 virtual MEDCouplingUMesh *buildUnstructured() const;
736 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
737 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const;
738 virtual DataArrayIdType *simplexize(int policy);
739 virtual void unserialization(const std::vector<double>& tinyInfoD, const std::vector<mcIdType>& tinyInfo, const DataArrayIdType *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings);
740 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2);
741 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type);
742 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type);
743 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type);
744 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
745 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
746 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
749 std::string __str__() const
751 return self->simpleRepr();
757 double tmp0=self->getTime(tmp1,tmp2);
758 PyObject *res = PyList_New(3);
759 PyList_SetItem(res,0,SWIG_From_double(tmp0));
760 PyList_SetItem(res,1,SWIG_From_int(tmp1));
761 PyList_SetItem(res,2,SWIG_From_int(tmp2));
765 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const
767 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
768 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
774 mcIdType getCellContainingPoint(PyObject *p, double eps) const
778 DataArrayDoubleTuple *aa;
779 std::vector<double> bb;
781 int spaceDim=self->getSpaceDimension();
782 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
783 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
784 return self->getCellContainingPoint(pos,eps);
787 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const
791 DataArrayDoubleTuple *aa;
792 std::vector<double> bb;
794 int spaceDim=self->getSpaceDimension();
795 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
796 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
797 MCAuto<DataArrayIdType> elts,eltsIndex;
798 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
799 PyObject *ret=PyTuple_New(2);
800 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
801 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
805 PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, int nbOfPoints, double eps) const
809 DataArrayDoubleTuple *aa;
810 std::vector<double> bb;
812 int spaceDim=self->getSpaceDimension();
813 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPointsLinearPartOnlyOnNonDynType : ";
814 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
815 MCAuto<DataArrayIdType> elts,eltsIndex;
816 self->getCellsContainingPointsLinearPartOnlyOnNonDynType(pos,nbOfPoints,eps,elts,eltsIndex);
817 PyObject *ret=PyTuple_New(2);
818 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
819 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
823 PyObject *getCellsContainingPoints(PyObject *p, double eps) const
825 auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayIdType>& d, MCAuto<DataArrayIdType>& e) { self->getCellsContainingPoints(a,b,c,d,e); };
826 return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
829 PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, double eps) const
831 auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayIdType>& d, MCAuto<DataArrayIdType>& e) { self->getCellsContainingPointsLinearPartOnlyOnNonDynType(a,b,c,d,e); };
832 return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
835 PyObject *getCellsContainingPoint(PyObject *p, double eps) const
839 DataArrayDoubleTuple *aa;
840 std::vector<double> bb;
842 int spaceDim=self->getSpaceDimension();
843 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
844 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
845 std::vector<mcIdType> elts;
846 self->getCellsContainingPoint(pos,eps,elts);
847 DataArrayIdType *ret=DataArrayIdType::New();
848 ret->alloc((int)elts.size(),1);
849 std::copy(elts.begin(),elts.end(),ret->getPointer());
850 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
853 virtual PyObject *getReverseNodalConnectivity() const
855 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
856 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
857 self->getReverseNodalConnectivity(d0,d1);
858 PyObject *ret=PyTuple_New(2);
859 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
860 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
864 void renumberCells(PyObject *li, bool check=true)
867 mcIdType v0; std::vector<mcIdType> v1;
868 const mcIdType *ids(convertIntStarLikePyObjToCppIntStar(li,sw,sz,v0,v1));
869 self->renumberCells(ids,check);
872 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const
874 DataArrayIdType *cellCor, *nodeCor;
875 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
876 PyObject *res = PyList_New(2);
877 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTITraits<mcIdType>::TI, cellCor?SWIG_POINTER_OWN | 0:0 ));
878 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTITraits<mcIdType>::TI, nodeCor?SWIG_POINTER_OWN | 0:0 ));
882 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const
884 DataArrayIdType *cellCor=0,*nodeCor=0;
885 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
886 PyObject *res = PyList_New(2);
887 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTITraits<mcIdType>::TI, cellCor?SWIG_POINTER_OWN | 0:0 ));
888 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTITraits<mcIdType>::TI, nodeCor?SWIG_POINTER_OWN | 0:0 ));
892 DataArrayIdType *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const
894 DataArrayIdType *cellCor=0;
895 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
899 DataArrayIdType *getCellIdsFullyIncludedInNodeIds(PyObject *li) const
902 int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
903 if (!SWIG_IsOK(res1))
906 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
907 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const mcIdType *)tmp)+size);
911 DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
913 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
914 da2->checkAllocated();
915 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
918 PyObject *getNodeIdsOfCell(int cellId) const
920 std::vector<mcIdType> conn;
921 self->getNodeIdsOfCell(cellId,conn);
922 return convertIntArrToPyList2(conn);
925 PyObject *getCoordinatesOfNode(mcIdType nodeId) const
927 std::vector<double> coo;
928 self->getCoordinatesOfNode(nodeId,coo);
929 return convertDblArrToPyList2(coo);
932 void scale(PyObject *point, double factor)
936 DataArrayDoubleTuple *aa;
937 std::vector<double> bb;
939 int spaceDim=self->getSpaceDimension();
940 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
941 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
942 self->scale(pointPtr,factor);
945 PyObject *getBoundingBox() const
947 int spaceDim=self->getSpaceDimension();
948 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
949 self->getBoundingBox(tmp);
950 PyObject *ret=convertDblArrToPyListOfTuple<double>(tmp,2,spaceDim);
954 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const
957 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
958 PyObject *ret=PyTuple_New(2);
959 PyObject *ret0Py=ret0?Py_True:Py_False;
961 PyTuple_SetItem(ret,0,ret0Py);
962 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
966 PyObject *buildPart(PyObject *li) const
968 mcIdType szArr,sw,iTypppArr;
969 std::vector<mcIdType> stdvecTyyppArr;
970 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
971 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
972 if(sw==3)//DataArrayIdType
974 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
975 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
976 std::string name=argpt->getName();
978 ret->setName(name.c_str());
980 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
983 PyObject *buildPartAndReduceNodes(PyObject *li) const
985 mcIdType szArr,sw,iTypppArr;
986 std::vector<mcIdType> stdvecTyyppArr;
987 DataArrayIdType *arr=0;
988 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
989 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
990 if(sw==3)//DataArrayIdType
992 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
993 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
994 std::string name=argpt->getName();
996 ret->setName(name.c_str());
999 PyObject *res = PyList_New(2);
1000 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
1001 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1002 PyList_SetItem(res,0,obj0);
1003 PyList_SetItem(res,1,obj1);
1007 PyObject *buildPartRangeAndReduceNodes(mcIdType beginCellIds, mcIdType endCellIds, mcIdType stepCellIds) const
1010 DataArrayIdType *arr=0;
1011 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
1012 PyObject *res = PyTuple_New(2);
1013 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
1016 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1018 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
1019 PyTuple_SetItem(res,0,obj0);
1020 PyTuple_SetItem(res,1,obj1);
1024 PyObject *getDistributionOfTypes() const
1026 std::vector<mcIdType> vals=self->getDistributionOfTypes();
1027 if(vals.size()%3!=0)
1028 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
1029 PyObject *ret=PyList_New((mcIdType)vals.size()/3);
1030 for(std::size_t j=0;j<vals.size()/3;j++)
1032 PyObject *ret1=PyList_New(3);
1033 PyList_SetItem(ret1,0,PyInt_FromLong(vals[3*j]));
1034 PyList_SetItem(ret1,1,PyInt_FromLong(vals[3*j+1]));
1035 PyList_SetItem(ret1,2,PyInt_FromLong(vals[3*j+2]));
1036 PyList_SetItem(ret,j,ret1);
1041 DataArrayIdType *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const
1043 std::vector<mcIdType> code;
1044 std::vector<const DataArrayIdType *> idsPerType;
1045 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li2,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",idsPerType);
1046 convertPyToNewIntArr4(li,1,3,code);
1047 return self->checkTypeConsistencyAndContig(code,idsPerType);
1050 PyObject *splitProfilePerType(const DataArrayIdType *profile, bool smartPflKiller=true) const
1052 std::vector<mcIdType> code;
1053 std::vector<DataArrayIdType *> idsInPflPerType;
1054 std::vector<DataArrayIdType *> idsPerType;
1055 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType,smartPflKiller);
1056 PyObject *ret=PyTuple_New(3);
1058 if(code.size()%3!=0)
1059 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
1060 PyObject *ret0=PyList_New((mcIdType)code.size()/3);
1061 for(std::size_t j=0;j<code.size()/3;j++)
1063 PyObject *ret00=PyList_New(3);
1064 PyList_SetItem(ret00,0,PyInt_FromLong(code[3*j]));
1065 PyList_SetItem(ret00,1,PyInt_FromLong(code[3*j+1]));
1066 PyList_SetItem(ret00,2,PyInt_FromLong(code[3*j+2]));
1067 PyList_SetItem(ret0,j,ret00);
1069 PyTuple_SetItem(ret,0,ret0);
1071 PyObject *ret1=PyList_New(idsInPflPerType.size());
1072 for(std::size_t j=0;j<idsInPflPerType.size();j++)
1073 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1074 PyTuple_SetItem(ret,1,ret1);
1075 std::size_t n=idsPerType.size();
1076 PyObject *ret2=PyList_New(n);
1077 for(std::size_t i=0;i<n;i++)
1078 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1079 PyTuple_SetItem(ret,2,ret2);
1083 void translate(PyObject *vector)
1087 DataArrayDoubleTuple *aa;
1088 std::vector<double> bb;
1090 int spaceDim=self->getSpaceDimension();
1091 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1092 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1093 self->translate(vectorPtr);
1096 void rotate(PyObject *center, double alpha)
1098 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1101 DataArrayDoubleTuple *aa;
1102 std::vector<double> bb;
1104 int spaceDim=self->getSpaceDimension();
1105 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1106 self->rotate(centerPtr,0,alpha);
1109 void rotate(PyObject *center, PyObject *vector, double alpha)
1111 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1113 DataArrayDouble *a,*a2;
1114 DataArrayDoubleTuple *aa,*aa2;
1115 std::vector<double> bb,bb2;
1117 int spaceDim=self->getSpaceDimension();
1118 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1119 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
1120 self->rotate(centerPtr,vectorPtr,alpha);
1123 PyObject *getAllGeoTypes() const
1125 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1126 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1127 PyObject *res=PyList_New(result.size());
1128 for(int i=0;iL!=result.end(); i++, iL++)
1129 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1133 virtual PyObject *getTinySerializationInformation() const
1135 std::vector<double> a0;
1136 std::vector<mcIdType> a1;
1137 std::vector<std::string> a2;
1138 self->getTinySerializationInformation(a0,a1,a2);
1139 PyObject *ret(PyTuple_New(3));
1140 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1141 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1142 std::size_t sz(a2.size());
1143 PyObject *ret2(PyList_New(sz));
1145 for(std::size_t i=0;i<sz;i++)
1146 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1148 PyTuple_SetItem(ret,2,ret2);
1152 virtual PyObject *serialize() const
1154 DataArrayIdType *a0Tmp(0);
1155 DataArrayDouble *a1Tmp(0);
1156 self->serialize(a0Tmp,a1Tmp);
1157 PyObject *ret(PyTuple_New(2));
1158 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1159 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1163 void resizeForUnserialization(const std::vector<mcIdType>& tinyInfo, DataArrayIdType *a1, DataArrayDouble *a2) const
1165 std::vector<std::string> littleStrings;
1166 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1169 PyObject *__getstate__() const
1171 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1172 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1173 PyObject *ret(PyTuple_New(2));
1174 PyTuple_SetItem(ret,0,ret0);
1175 PyTuple_SetItem(ret,1,ret1);
1179 void __setstate__(PyObject *inp)
1181 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1182 if(!PyTuple_Check(inp))
1183 throw INTERP_KERNEL::Exception(MSG);
1184 std::size_t sz(PyTuple_Size(inp));
1186 throw INTERP_KERNEL::Exception(MSG);
1187 PyObject *elt0(PyTuple_GetItem(inp,0));
1188 PyObject *elt1(PyTuple_GetItem(inp,1));
1189 std::vector<double> a0;
1190 std::vector<mcIdType> a1;
1191 std::vector<std::string> a2;
1192 DataArrayIdType *b0(0);
1193 DataArrayDouble *b1(0);
1195 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1196 throw INTERP_KERNEL::Exception(MSG);
1197 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1199 fillArrayWithPyListDbl3(a0py,tmp,a0);
1200 convertPyToNewIntArr3(a1py,a1);
1201 fillStringVector(a2py,a2);
1204 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1205 throw INTERP_KERNEL::Exception(MSG);
1206 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1208 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTITraits<mcIdType>::TI,0|0));
1209 if(!SWIG_IsOK(status))
1210 throw INTERP_KERNEL::Exception(MSG);
1211 b0=reinterpret_cast<DataArrayIdType *>(argp);
1212 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1213 if(!SWIG_IsOK(status))
1214 throw INTERP_KERNEL::Exception(MSG);
1215 b1=reinterpret_cast<DataArrayDouble *>(argp);
1217 // useless here to call resizeForUnserialization because arrays are well resized.
1218 self->unserialization(a0,a1,b0,b1,a2);
1221 static MEDCouplingMesh *MergeMeshes(PyObject *li)
1223 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1224 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1225 return MEDCouplingMesh::MergeMeshes(tmp);
1231 //== MEDCouplingMesh End
1233 %include "NormalizedGeometricTypes"
1234 %include "MEDCouplingNatureOfFieldEnum"
1236 namespace MEDCoupling
1238 class MEDCouplingNatureOfField
1241 static const char *GetRepr(NatureOfField nat);
1242 static std::string GetReprNoThrow(NatureOfField nat);
1243 static std::string GetAllPossibilitiesStr();
1247 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1248 // include "MEDCouplingTimeDiscretization.i"
1250 namespace MEDCoupling
1252 class MEDCouplingGaussLocalization
1255 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1256 const std::vector<double>& gsCoo, const std::vector<double>& w);
1257 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ);
1258 INTERP_KERNEL::NormalizedCellType getType() const;
1259 void setType(INTERP_KERNEL::NormalizedCellType typ);
1260 int getNumberOfGaussPt() const;
1261 int getDimension() const;
1262 int getNumberOfPtsInRefCell() const;
1263 std::string getStringRepr() const;
1264 void checkConsistencyLight() const;
1265 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const;
1267 const std::vector<double>& getRefCoords() const;
1268 double getRefCoord(int ptIdInCell, int comp) const;
1269 const std::vector<double>& getGaussCoords() const;
1270 double getGaussCoord(int gaussPtIdInCell, int comp) const;
1271 const std::vector<double>& getWeights() const;
1272 double getWeight(int gaussPtIdInCell, double newVal) const;
1273 void setRefCoord(int ptIdInCell, int comp, double newVal);
1274 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal);
1275 void setWeight(int gaussPtIdInCell, double newVal);
1276 void setRefCoords(const std::vector<double>& refCoo);
1277 void setGaussCoords(const std::vector<double>& gsCoo);
1278 void setWeights(const std::vector<double>& w);
1280 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1284 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const
1286 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1290 MEDCouplingUMesh *buildRefCell() const
1292 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1298 class MEDCouplingSkyLineArray
1301 static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayIdType* c, const DataArrayIdType* cI );
1303 void set( DataArrayIdType* index, DataArrayIdType* value );
1304 void set3( DataArrayIdType* superIndex, DataArrayIdType* index, DataArrayIdType* value );
1306 int getSuperNumberOf() const;
1307 int getNumberOf() const;
1308 int getLength() const;
1310 void deletePack(const int i, const int j);
1312 void deleteSimplePack(const int i);
1313 void deleteSimplePacks(const DataArrayIdType* idx);
1315 MEDCouplingSkyLineArray *groupPacks(const DataArrayIdType *indexedPacks) const;
1316 MEDCouplingSkyLineArray *uniqueNotSortedByPack() const;
1318 MEDCouplingSkyLineArray *deepCopy() const;
1322 MEDCouplingSkyLineArray()
1324 return MEDCouplingSkyLineArray::New();
1327 MEDCouplingSkyLineArray( const std::vector<mcIdType>& index, const std::vector<mcIdType>& value)
1329 return MEDCouplingSkyLineArray::New(index, value);
1332 MEDCouplingSkyLineArray( DataArrayIdType* index, DataArrayIdType* value )
1334 return MEDCouplingSkyLineArray::New(index, value);
1337 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other )
1339 return MEDCouplingSkyLineArray::New(other);
1342 std::string __str__() const
1344 return self->simpleRepr();
1347 DataArrayIdType *getSuperIndexArray() const
1349 DataArrayIdType *ret(self->getSuperIndexArray());
1355 DataArrayIdType *getIndexArray() const
1357 DataArrayIdType *ret(self->getIndexArray());
1363 DataArrayIdType *getValuesArray() const
1365 DataArrayIdType *ret(self->getValuesArray());
1371 PyObject *getSimplePackSafe(mcIdType absolutePackId) const
1373 std::vector<mcIdType> ret;
1374 self->getSimplePackSafe(absolutePackId,ret);
1375 return convertIntArrToPyList2(ret);
1378 PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const
1380 std::vector<mcIdType> vpack, vspIdx, out;
1382 convertPyToNewIntArr3(superPackIndices,vspIdx);
1383 convertPyToNewIntArr3(pack,vpack);
1385 self->findPackIds(vspIdx, vpack.data(), vpack.data()+vpack.size(), out);
1386 return convertIntArrToPyList2(out);
1389 void pushBackPack(const mcIdType i, PyObject *pack)
1391 std::vector<mcIdType> vpack;
1392 convertPyToNewIntArr3(pack,vpack);
1393 self->pushBackPack(i,vpack.data(), vpack.data()+vpack.size());
1396 void replaceSimplePack(const mcIdType idx, PyObject *pack)
1398 std::vector<mcIdType> vpack;
1399 convertPyToNewIntArr3(pack,vpack);
1400 self->replaceSimplePack(idx, vpack.data(), vpack.data()+vpack.size());
1403 void replaceSimplePacks(const DataArrayIdType* idx, PyObject *listePacks)
1405 std::vector<const DataArrayIdType*> packs;
1406 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType*>(listePacks,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",packs);
1407 self->replaceSimplePacks(idx, packs);
1410 static MEDCouplingSkyLineArray *AggregatePacks(PyObject *sks)
1412 std::vector<const MEDCouplingSkyLineArray *> sksCpp;
1413 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingSkyLineArray*>(sks,SWIGTYPE_p_MEDCoupling__MEDCouplingSkyLineArray,"MEDCouplingSkyLineArray",sksCpp);
1414 return MEDCoupling::MEDCouplingSkyLineArray::AggregatePacks(sksCpp);
1417 void replacePack(const mcIdType superIdx, const mcIdType idx, PyObject *pack)
1419 std::vector<mcIdType> vpack;
1420 convertPyToNewIntArr3(pack,vpack);
1421 self->replacePack(superIdx, idx, vpack.data(), vpack.data()+vpack.size());
1424 PyObject *convertToPolyhedronConn() const
1426 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
1427 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
1428 self->convertToPolyhedronConn(d0,d1);
1429 PyObject *ret=PyTuple_New(2);
1430 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1431 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1435 PyObject *thresholdPerPack(mcIdType threshold) const
1437 MCAuto<MEDCouplingSkyLineArray> left, right;
1438 self->thresholdPerPack(threshold,left,right);
1439 PyObject *ret=PyTuple_New(2);
1440 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(left.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingSkyLineArray, SWIG_POINTER_OWN | 0 ));
1441 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(right.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingSkyLineArray, SWIG_POINTER_OWN | 0 ));
1448 %include "MEDCouplingFieldDiscretization.i"
1450 //== MEDCouplingPointSet
1452 namespace MEDCoupling
1454 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1457 void setCoords(const DataArrayDouble *coords);
1458 DataArrayDouble *getCoordinatesAndOwner() const;
1459 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const;
1461 double getCaracteristicDimension() const;
1462 void recenterForMaxPrecision(double eps);
1463 void changeSpaceDimension(int newSpaceDim, double dftVal=0.);
1464 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon);
1465 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other);
1466 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const;
1467 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon);
1468 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2);
1469 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type);
1470 static DataArrayIdType *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps);
1471 virtual DataArrayIdType *computeFetchedNodeIds() const;
1472 virtual int getNumberOfNodesInCell(int cellId) const;
1473 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const;
1474 virtual DataArrayIdType *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps);
1475 virtual DataArrayIdType *zipCoordsTraducer();
1476 virtual DataArrayIdType *findBoundaryNodes() const;
1477 virtual DataArrayIdType *zipConnectivityTraducer(int compType, int startCellId=0);
1478 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const;
1479 virtual void checkFullyDefined() const;
1480 virtual bool isEmptyMesh(const std::vector<mcIdType>& tinyInfo) const;
1481 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const;
1482 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const;
1483 virtual void renumberNodesWithOffsetInConn(int offset);
1484 virtual bool areAllNodesFetched() const;
1485 virtual MEDCouplingFieldDouble *computeDiameterField() const;
1486 virtual void invertOrientationOfAllCells();
1489 std::string __str__() const
1491 return self->simpleRepr();
1494 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayIdType *comm, const DataArrayIdType *commIndex) const
1496 mcIdType newNbOfNodes;
1497 DataArrayIdType *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1498 PyObject *res = PyList_New(2);
1499 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1500 PyList_SetItem(res,1,PyInt_FromLong(newNbOfNodes));
1504 PyObject *findCommonNodes(double prec, mcIdType limitTupleId=-1) const
1506 DataArrayIdType *comm, *commIndex;
1507 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1508 PyObject *res = PyList_New(2);
1509 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1510 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1514 PyObject *getCoords()
1516 DataArrayDouble *ret1=self->getCoords();
1519 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1522 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const
1524 mcIdType szArr,sw,iTypppArr;
1525 std::vector<mcIdType> stdvecTyyppArr;
1526 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1527 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1528 if(sw==3)//DataArrayIdType
1530 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1531 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1532 std::string name=argpt->getName();
1534 ret->setName(name.c_str());
1536 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1539 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const
1541 mcIdType szArr,sw,iTypppArr;
1542 std::vector<mcIdType> stdvecTyyppArr;
1543 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1544 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1545 if(sw==3)//DataArrayIdType
1547 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1548 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1549 std::string name=argpt->getName();
1551 ret->setName(name.c_str());
1553 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1556 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const
1558 mcIdType szArr,sw,iTypppArr;
1559 std::vector<mcIdType> stdvecTyyppArr;
1560 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1561 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1562 if(sw==3)//DataArrayIdType
1564 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1565 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1566 std::string name=argpt->getName();
1568 ret->setName(name.c_str());
1570 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1573 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(mcIdType start, mcIdType end, mcIdType step) const
1575 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1576 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1579 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const
1581 mcIdType szArr,sw,iTypppArr;
1582 std::vector<mcIdType> stdvecTyyppArr;
1583 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1584 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1585 if(sw==3)//DataArrayIdType
1587 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1588 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1589 std::string name=argpt->getName();
1591 ret->setName(name.c_str());
1593 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1596 void renumberNodes(PyObject *li, mcIdType newNbOfNodes)
1598 mcIdType szArr,sw,iTypppArr;
1599 std::vector<mcIdType> stdvecTyyppArr;
1600 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1601 self->renumberNodes(tmp,newNbOfNodes);
1604 void renumberNodesCenter(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->renumberNodesCenter(tmp,newNbOfNodes);
1612 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const
1614 int spaceDim=self->getSpaceDimension();
1616 DataArrayDouble *a,*a2;
1617 DataArrayDoubleTuple *aa,*aa2;
1618 std::vector<double> bb,bb2;
1620 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st parameter for point.";
1621 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd parameter for vector.";
1622 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1623 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1624 std::vector<mcIdType> nodes;
1625 self->findNodesOnLine(p,v,eps,nodes);
1626 DataArrayIdType *ret=DataArrayIdType::New();
1627 ret->alloc(nodes.size(),1);
1628 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1629 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1631 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const
1633 int spaceDim=self->getSpaceDimension();
1635 DataArrayDouble *a,*a2;
1636 DataArrayDoubleTuple *aa,*aa2;
1637 std::vector<double> bb,bb2;
1639 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st parameter for point.";
1640 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd parameter for vector.";
1641 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1642 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1643 std::vector<mcIdType> nodes;
1644 self->findNodesOnPlane(p,v,eps,nodes);
1645 DataArrayIdType *ret=DataArrayIdType::New();
1646 ret->alloc(nodes.size(),1);
1647 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1648 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1651 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const
1655 DataArrayDoubleTuple *aa;
1656 std::vector<double> bb;
1658 int spaceDim=self->getSpaceDimension();
1659 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1660 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1661 DataArrayIdType *ret=self->getNodeIdsNearPoint(pos,eps);
1662 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1665 PyObject *getNodeIdsNearPoints(PyObject *pt, mcIdType nbOfPoints, double eps) const
1667 DataArrayIdType *c=0,*cI=0;
1671 DataArrayDoubleTuple *aa;
1672 std::vector<double> bb;
1674 int spaceDim=self->getSpaceDimension();
1675 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1676 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1677 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1678 PyObject *ret=PyTuple_New(2);
1679 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1680 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1684 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const
1686 DataArrayIdType *c=0,*cI=0;
1687 int spaceDim=self->getSpaceDimension();
1690 DataArrayDoubleTuple *aa;
1691 std::vector<double> bb;
1693 mcIdType nbOfTuples=-1;
1694 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1695 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1697 PyObject *ret=PyTuple_New(2);
1698 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1699 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1703 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const
1707 DataArrayDoubleTuple *aa;
1708 std::vector<double> bb;
1710 int spaceDim=self->getSpaceDimension();
1711 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1712 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1714 DataArrayIdType *elems=self->getCellsInBoundingBox(tmp,eps);
1715 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1718 void duplicateNodesInCoords(PyObject *li)
1722 std::vector<mcIdType> multiVal;
1723 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
1724 MEDCoupling::DataArrayIdType *daIntTyypp=0;
1725 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1729 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1731 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1733 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1735 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
1739 virtual PyObject *findCommonCells(int compType, mcIdType startCellId=0) const
1741 DataArrayIdType *v0(nullptr),*v1(nullptr);
1742 self->findCommonCells(compType,startCellId,v0,v1);
1743 PyObject *res = PyList_New(2);
1744 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1745 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1750 virtual void renumberNodesInConn(PyObject *li)
1754 int res1(SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__MapII, 0 | 0 ));
1757 MapII *da2(reinterpret_cast<MapII *>(da));
1758 self->renumberNodesInConn(da2->data());
1762 int res1(SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 ));
1763 if (!SWIG_IsOK(res1))
1766 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
1767 self->renumberNodesInConn(tmp);
1771 DataArrayIdType *da2(reinterpret_cast< DataArrayIdType * >(da));
1773 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
1774 da2->checkAllocated();
1775 self->renumberNodesInConn(da2->getConstPointer());
1779 virtual PyObject *getNodeIdsInUse() const
1782 DataArrayIdType *ret0=self->getNodeIdsInUse(ret1);
1783 PyObject *ret=PyTuple_New(2);
1784 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1785 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1789 virtual DataArrayIdType *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1791 DataArrayIdType *ret(nullptr);
1793 mcIdType szArr,sw,iTypppArr;
1794 std::vector<mcIdType> stdvecTyyppArr;
1795 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1796 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1800 virtual PyObject *mergeNodes(double precision)
1804 DataArrayIdType *ret0=self->mergeNodes(precision,ret1,ret2);
1805 PyObject *res = PyList_New(3);
1806 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1807 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1808 PyList_SetItem(res,2,PyInt_FromLong(ret2));
1812 virtual PyObject *mergeNodesCenter(double precision)
1816 DataArrayIdType *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1817 PyObject *res = PyList_New(3);
1818 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1819 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1820 PyList_SetItem(res,2,PyInt_FromLong(ret2));
1824 DataArrayIdType *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const
1827 int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
1828 if (!SWIG_IsOK(res1))
1831 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
1832 return self->getCellIdsLyingOnNodes(tmp,((const mcIdType *)tmp)+size,fullyIn);
1836 DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
1838 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
1839 da2->checkAllocated();
1840 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1844 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI)
1848 std::vector<mcIdType> multiVal;
1849 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
1850 MEDCoupling::DataArrayIdType *daIntTyypp=0;
1851 mcIdType nbc=self->getNumberOfCells();
1852 convertIntStarOrSliceLikePyObjToCpp(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1859 std::ostringstream oss;
1860 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1861 throw INTERP_KERNEL::Exception(oss.str().c_str());
1864 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1869 mcIdType tmp=nbc+singleVal;
1870 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1874 std::ostringstream oss;
1875 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1876 throw INTERP_KERNEL::Exception(oss.str().c_str());
1882 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1886 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1891 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1892 daIntTyypp->checkAllocated();
1893 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1896 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayIdType instance !");
1900 static void Rotate2DAlg(PyObject *center, double angle, mcIdType nbNodes, PyObject *coords)
1903 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1904 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1905 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1906 for(mcIdType i=0;i<sz;i++)
1907 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1910 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords)
1913 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1914 mcIdType sw,nbNodes=0;
1915 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1916 std::vector<double> val3;
1917 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1918 "Rotate2DAlg",2,true,nbNodes);
1920 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1921 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1924 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, mcIdType nbNodes, PyObject *coords)
1927 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1928 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1929 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1930 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1931 for(mcIdType i=0;i<sz;i++)
1932 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1935 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords)
1938 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1939 mcIdType sw,nbNodes=0;
1940 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1941 std::vector<double> val3;
1942 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1943 "Rotate3DAlg",3,true,nbNodes);
1945 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1946 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1947 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1952 //== MEDCouplingPointSet End
1954 class MEDCouplingUMeshCell
1957 INTERP_KERNEL::NormalizedCellType getType() const;
1960 std::string __str__() const
1962 return self->repr();
1965 PyObject *getAllConn() const
1968 const mcIdType *r=self->getAllConn(ret2);
1969 PyObject *ret=PyTuple_New(ret2);
1970 for(mcIdType i=0;i<ret2;i++)
1971 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1977 class MEDCouplingUMeshCellIterator
1984 MEDCouplingUMeshCell *ret=self->nextt();
1986 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1989 PyErr_SetString(PyExc_StopIteration,"No more data.");
1996 class MEDCouplingUMeshCellByTypeIterator
1999 ~MEDCouplingUMeshCellByTypeIterator();
2004 MEDCouplingUMeshCellEntry *ret=self->nextt();
2006 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
2009 PyErr_SetString(PyExc_StopIteration,"No more data.");
2016 class MEDCouplingUMeshCellByTypeEntry
2019 ~MEDCouplingUMeshCellByTypeEntry();
2022 MEDCouplingUMeshCellByTypeIterator *__iter__()
2024 return self->iterator();
2029 class MEDCouplingUMeshCellEntry
2032 INTERP_KERNEL::NormalizedCellType getType() const;
2033 int getNumberOfElems() const;
2036 MEDCouplingUMeshCellIterator *__iter__()
2038 return self->iterator();
2043 //== MEDCouplingUMesh
2045 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
2048 static MEDCouplingUMesh *New();
2049 static MEDCouplingUMesh *New(const char *meshName, int meshDim);
2050 void checkConsistencyLight() const;
2051 void setMeshDimension(int meshDim);
2052 void allocateCells(int nbOfCells=0);
2053 void finishInsertingCells();
2054 MEDCouplingUMeshCellByTypeEntry *cellsByType();
2055 void setConnectivity(DataArrayIdType *conn, DataArrayIdType *connIndex, bool isComputingTypes=true);
2056 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
2057 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis);
2058 int getNodalConnectivityArrayLen() const;
2059 void computeTypes();
2060 std::string reprConnectivityOfThis() const;
2061 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const;
2063 DataArrayIdType *conformize2D(double eps);
2064 DataArrayIdType *conformize3D(double eps);
2065 DataArrayIdType *colinearize2D(double eps);
2066 DataArrayIdType *colinearizeKeepingConform2D(double eps);
2067 void shiftNodeNumbersInConn(int delta);
2068 std::vector<bool> getQuadraticStatus() const;
2069 DataArrayIdType *findCellIdsOnBoundary() const;
2070 MEDCouplingUMesh *computeSkin() const;
2071 bool checkConsecutiveCellTypes() const;
2072 bool checkConsecutiveCellTypesForMEDFileFrmt() const;
2073 DataArrayIdType *rearrange2ConsecutiveCellTypes();
2074 DataArrayIdType *sortCellsInMEDFileFrmt();
2075 DataArrayIdType *getRenumArrForMEDFileFrmt() const;
2076 DataArrayIdType *convertCellArrayPerGeoType(const DataArrayIdType *da) const;
2077 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2078 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2079 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2080 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2081 void orientCorrectlyPolyhedrons();
2082 bool isPresenceOfQuadratic() const;
2083 bool isFullyQuadratic() const;
2084 MEDCouplingFieldDouble *buildDirectionVectorField() const;
2085 bool isContiguous1D() const;
2086 void tessellate2D(double eps);
2087 void convertQuadraticCellsToLinear();
2088 DataArrayIdType *convertLinearCellsToQuadratic(int conversionType=0);
2089 void convertDegeneratedCells();
2090 DataArrayIdType *convertDegeneratedCellsAndRemoveFlatOnes();
2091 bool removeDegenerated1DCells();
2092 bool areOnlySimplexCells() const;
2093 MEDCouplingFieldDouble *getEdgeRatioField() const;
2094 MEDCouplingFieldDouble *getAspectRatioField() const;
2095 MEDCouplingFieldDouble *getWarpField() const;
2096 MEDCouplingFieldDouble *getSkewField() const;
2097 DataArrayDouble *computePlaneEquationOf3DFaces() const;
2098 DataArrayIdType *convexEnvelop2D();
2099 std::string cppRepr() const;
2100 DataArrayIdType *findAndCorrectBadOriented3DExtrudedCells();
2101 DataArrayIdType *findAndCorrectBadOriented3DCells();
2102 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const;
2103 MEDCouplingSkyLineArray *generateGraph() const;
2104 DataArrayIdType *convertNodalConnectivityToStaticGeoTypeMesh() const;
2105 DataArrayIdType *buildUnionOf2DMesh() const;
2106 DataArrayIdType *buildUnionOf3DMesh() const;
2107 DataArrayIdType *orderConsecutiveCells1D() const;
2108 DataArrayDouble *getBoundingBoxForBBTreeFast() const;
2109 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const;
2110 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const;
2111 void changeOrientationOfCells();
2112 DataArrayDouble *computeCellCenterOfMassWithPrecision(double eps);
2113 int split2DCells(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *subNodesInSeg, const DataArrayIdType *subNodesInSegI, const DataArrayIdType *midOpt=0, const DataArrayIdType *midOptI=0);
2114 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da);
2115 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
2116 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
2117 static DataArrayIdType *ComputeSpreadZoneGradually(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn);
2118 static DataArrayIdType *ComputeRangesFromTypeDistribution(const std::vector<mcIdType>& code);
2122 return MEDCouplingUMesh::New();
2125 MEDCouplingUMesh(const char *meshName, int meshDim)
2127 return MEDCouplingUMesh::New(meshName,meshDim);
2130 std::string __str__() const
2132 return self->simpleRepr();
2135 std::string __repr__() const
2137 std::ostringstream oss;
2138 self->reprQuickOverview(oss);
2142 MEDCouplingUMeshCellIterator *__iter__()
2144 return self->cellIterator();
2147 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da)
2149 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
2153 PyObject *getAllGeoTypesSorted() const
2155 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
2156 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2157 PyObject *res=PyList_New(result.size());
2158 for(int i=0;iL!=result.end(); i++, iL++)
2159 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2163 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
2167 std::vector<mcIdType> multiVal;
2168 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2169 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2170 mcIdType nbc=self->getNumberOfCells();
2171 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2178 std::ostringstream oss;
2179 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2180 throw INTERP_KERNEL::Exception(oss.str().c_str());
2184 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2191 mcIdType tmp=nbc+singleVal;
2192 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2197 std::ostringstream oss;
2198 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2199 throw INTERP_KERNEL::Exception(oss.str().c_str());
2205 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2211 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2212 daIntTyypp->checkAllocated();
2213 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2217 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayIdType instance !");
2221 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
2225 std::vector<mcIdType> multiVal;
2226 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2227 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2228 mcIdType nbc=self->getNumberOfCells();
2229 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2236 std::ostringstream oss;
2237 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2238 throw INTERP_KERNEL::Exception(oss.str().c_str());
2242 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2249 mcIdType tmp=nbc+singleVal;
2250 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2255 std::ostringstream oss;
2256 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2257 throw INTERP_KERNEL::Exception(oss.str().c_str());
2263 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2268 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2274 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2275 daIntTyypp->checkAllocated();
2276 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2280 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayIdType instance !");
2284 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, mcIdType size, PyObject *li)
2286 mcIdType szArr,sw,iTypppArr;
2287 std::vector<mcIdType> stdvecTyyppArr;
2288 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2291 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2292 throw INTERP_KERNEL::Exception(oss.str().c_str());
2294 self->insertNextCell(type,size,tmp);
2297 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li)
2299 mcIdType szArr,sw,iTypppArr;
2300 std::vector<mcIdType> stdvecTyyppArr;
2301 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2302 self->insertNextCell(type,szArr,tmp);
2305 DataArrayIdType *getNodalConnectivity()
2307 DataArrayIdType *ret=self->getNodalConnectivity();
2312 DataArrayIdType *getNodalConnectivityIndex()
2314 DataArrayIdType *ret=self->getNodalConnectivityIndex();
2320 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn, mcIdType nbOfDepthPeeling=-1)
2322 mcIdType szArr,sw,iTypppArr;
2323 std::vector<mcIdType> stdvecTyyppArr;
2324 const mcIdType *seedPtr=convertIntStarLikePyObjToCppIntStar(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2325 mcIdType nbOfDepthPeelingPerformed=0;
2326 DataArrayIdType *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2327 PyObject *res=PyTuple_New(2);
2328 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2329 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2333 static PyObject *FindCommonCellsAlg(int compType, mcIdType startCellId, const DataArrayIdType *nodal, const DataArrayIdType *nodalI, const DataArrayIdType *revNodal, const DataArrayIdType *revNodalI)
2335 DataArrayIdType *v0=0,*v1=0;
2336 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2337 PyObject *res = PyList_New(2);
2338 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2339 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2343 PyObject *distanceToPoint(PyObject *point) const
2347 DataArrayDoubleTuple *aa;
2348 std::vector<double> bb;
2350 int nbOfCompo=self->getSpaceDimension();
2351 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2354 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2355 PyObject *ret=PyTuple_New(2);
2356 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2357 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2361 PyObject *distanceToPoints(const DataArrayDouble *pts) const
2363 DataArrayIdType *ret1=0;
2364 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2365 PyObject *ret=PyTuple_New(2);
2366 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2367 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2371 PyObject *tetrahedrize(int policy)
2374 DataArrayIdType *ret1(0);
2375 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2376 PyObject *ret=PyTuple_New(3);
2377 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2378 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2379 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2383 PyObject *checkButterflyCells(double eps=1e-12)
2385 std::vector<mcIdType> cells;
2386 self->checkButterflyCells(cells,eps);
2387 DataArrayIdType *ret=DataArrayIdType::New();
2388 ret->alloc(cells.size(),1);
2389 std::copy(cells.begin(),cells.end(),ret->getPointer());
2390 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2393 PyObject *splitByType() const
2395 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2396 std::size_t sz=ms.size();
2397 PyObject *ret = PyList_New(sz);
2398 for(std::size_t i=0;i<sz;i++)
2399 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2403 PyObject *partitionBySpreadZone() const
2405 std::vector<DataArrayIdType *> retCpp=self->partitionBySpreadZone();
2406 std::size_t sz=retCpp.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(retCpp[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2413 static PyObject *PartitionBySpreadZone(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn)
2415 std::vector<DataArrayIdType *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
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 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const
2426 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(ids,&size);
2427 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2428 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2431 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const
2434 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2435 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2439 DataArrayIdType *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const
2442 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2443 DataArrayIdType *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2447 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
2449 DataArrayIdType *tmp0=0,*tmp1=0,*tmp2=0;
2450 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2451 PyObject *ret=PyTuple_New(3);
2452 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2453 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2454 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2458 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
2460 DataArrayIdType *tmp0=0,*tmp1=0;
2461 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2462 PyObject *ret=PyTuple_New(2);
2463 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2464 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2468 void duplicateNodes(PyObject *li)
2472 std::vector<mcIdType> multiVal;
2473 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2474 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2475 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2479 return self->duplicateNodes(&singleVal,&singleVal+1);
2481 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2483 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2485 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
2489 void duplicateNodesInConn(PyObject *li, mcIdType offset)
2493 std::vector<mcIdType> multiVal;
2494 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2495 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2496 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2500 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2502 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2504 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2506 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
2510 void attractSeg3MidPtsAroundNodes(double ratio, PyObject *nodeIds)
2512 mcIdType szArr,sw,iTypppArr;
2513 std::vector<mcIdType> stdvecTyyppArr;
2514 const mcIdType *nodeIdsPtr(convertIntStarLikePyObjToCppIntStar(nodeIds,sw,szArr,iTypppArr,stdvecTyyppArr));
2515 self->attractSeg3MidPtsAroundNodes(ratio,nodeIdsPtr,nodeIdsPtr+szArr);
2518 PyObject *getLevArrPerCellTypes(PyObject *li) const
2521 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2522 DataArrayIdType *tmp0,*tmp1=0;
2523 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2524 PyObject *ret=PyTuple_New(2);
2525 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2526 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2530 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const
2532 DataArrayIdType *ret0=0,*ret1=0;
2533 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2534 PyObject *ret=PyTuple_New(2);
2535 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2536 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2540 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms)
2542 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2543 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2544 DataArrayIdType *ret1=0,*ret2=0;
2545 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2546 PyObject *ret=PyTuple_New(3);
2547 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2548 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2549 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2553 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms)
2555 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2556 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2557 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2558 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2561 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType)
2564 std::vector<const MEDCouplingUMesh *> meshes;
2565 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2566 std::vector<DataArrayIdType *> corr;
2567 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2569 PyObject *ret1=PyList_New(sz);
2570 for(std::size_t i=0;i<sz;i++)
2571 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2572 PyObject *ret=PyList_New(2);
2573 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2574 PyList_SetItem(ret,1,ret1);
2578 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms)
2580 std::vector<MEDCouplingUMesh *> meshes;
2581 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2582 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2585 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps)
2587 std::vector<MEDCouplingUMesh *> meshes;
2588 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2589 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2592 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const
2596 DataArrayDoubleTuple *aa;
2597 std::vector<double> bb;
2599 int spaceDim=self->getSpaceDimension();
2600 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2601 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2603 std::vector<mcIdType> cells;
2604 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2605 DataArrayIdType *ret=DataArrayIdType::New();
2606 ret->alloc(cells.size(),1);
2607 std::copy(cells.begin(),cells.end(),ret->getPointer());
2608 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2611 void orientCorrectly2DCells(PyObject *vec, bool polyOnly)
2615 DataArrayDoubleTuple *aa;
2616 std::vector<double> bb;
2618 int spaceDim=self->getSpaceDimension();
2619 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2620 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2621 self->orientCorrectly2DCells(v,polyOnly);
2624 PyObject *arePolyhedronsNotCorrectlyOriented() const
2626 std::vector<mcIdType> cells;
2627 self->arePolyhedronsNotCorrectlyOriented(cells);
2628 DataArrayIdType *ret=DataArrayIdType::New();
2629 ret->alloc(cells.size(),1);
2630 std::copy(cells.begin(),cells.end(),ret->getPointer());
2631 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2634 PyObject *getFastAveragePlaneOfThis() const
2638 self->getFastAveragePlaneOfThis(vec,pos);
2640 std::copy(vec,vec+3,vals);
2641 std::copy(pos,pos+3,vals+3);
2642 return convertDblArrToPyListOfTuple<double>(vals,3,2);
2645 static MEDCouplingUMesh *MergeUMeshes(PyObject *li)
2647 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2648 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2649 return MEDCouplingUMesh::MergeUMeshes(tmp);
2652 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const
2654 DataArrayIdType *ret1;
2655 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2656 PyObject *ret=PyTuple_New(2);
2657 PyObject *ret0Py=ret0?Py_True:Py_False;
2659 PyTuple_SetItem(ret,0,ret0Py);
2660 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2664 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const
2666 DataArrayIdType *ret1;
2667 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2668 PyObject *ret=PyTuple_New(2);
2669 PyObject *ret0Py=ret0?Py_True:Py_False;
2671 PyTuple_SetItem(ret,0,ret0Py);
2672 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2676 PyObject *explode3DMeshTo1D() const
2678 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2679 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2680 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2681 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2682 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2683 PyObject *ret=PyTuple_New(5);
2684 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2685 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2686 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2687 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2688 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2692 PyObject *explodeIntoEdges() const
2694 MCAuto<DataArrayIdType> desc,descIndex,revDesc,revDescIndx;
2695 MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2696 PyObject *ret=PyTuple_New(5);
2697 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2698 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2699 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2700 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2701 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2705 PyObject *explodeMeshIntoMicroEdges() const
2707 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2708 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2709 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2710 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2711 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2712 PyObject *ret=PyTuple_New(5);
2713 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2714 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2715 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2716 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2717 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2721 PyObject *buildDescendingConnectivity() const
2723 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2724 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2725 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2726 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2727 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2728 PyObject *ret=PyTuple_New(5);
2729 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2730 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2731 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2732 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2733 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2737 PyObject *buildDescendingConnectivity2() const
2739 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2740 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2741 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2742 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2743 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2744 PyObject *ret=PyTuple_New(5);
2745 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2746 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2747 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2748 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2749 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2753 PyObject *computeNeighborsOfCells() const
2755 DataArrayIdType *neighbors=0,*neighborsIdx=0;
2756 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2757 PyObject *ret=PyTuple_New(2);
2758 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2759 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2763 PyObject *computeNeighborsOfNodes() const
2765 DataArrayIdType *neighbors=0,*neighborsIdx=0;
2766 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2767 PyObject *ret=PyTuple_New(2);
2768 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2769 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2773 PyObject *computeEnlargedNeighborsOfNodes() const
2775 MCAuto<DataArrayIdType> neighbors,neighborsIdx;
2776 self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2777 PyObject *ret=PyTuple_New(2);
2778 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2779 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2783 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayIdType *nodeNeigh, const DataArrayIdType *nodeNeighI) const
2785 MCAuto<DataArrayIdType> cellNeigh,cellNeighIndex;
2786 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2787 PyObject *ret=PyTuple_New(2);
2788 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2789 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2793 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *revDesc, const DataArrayIdType *revDescI)
2795 DataArrayIdType *neighbors=0,*neighborsIdx=0;
2796 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2797 PyObject *ret=PyTuple_New(2);
2798 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2799 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2803 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2805 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2806 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2807 DataArrayIdType *d2,*d3,*d4,*dd5;
2808 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2809 PyObject *ret=PyTuple_New(7);
2810 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2811 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2812 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2813 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2814 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2815 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2816 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2820 DataArrayDouble *getPartBarycenterAndOwner(DataArrayIdType *da) const
2823 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2824 da->checkAllocated();
2825 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2828 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayIdType *da) const
2831 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2832 da->checkAllocated();
2833 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2836 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayIdType *da) const
2839 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2840 da->checkAllocated();
2841 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2844 PyObject *getTypesOfPart(DataArrayIdType *da) const
2847 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2848 da->checkAllocated();
2849 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2850 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2851 PyObject *res = PyList_New(result.size());
2852 for (int i=0;iL!=result.end(); i++, iL++)
2853 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2857 DataArrayIdType *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayIdType *da) const
2860 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2861 da->checkAllocated();
2862 DataArrayIdType *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2863 ret->setName(da->getName().c_str());
2867 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps)
2869 DataArrayIdType *cellNb1=0,*cellNb2=0;
2870 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2871 PyObject *ret=PyTuple_New(3);
2872 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2873 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2874 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2878 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps)
2880 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2881 DataArrayIdType *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2882 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2883 PyObject *ret(PyTuple_New(4));
2884 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2885 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2886 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2887 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2891 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const
2893 int spaceDim=self->getSpaceDimension();
2895 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2897 DataArrayDouble *a,*a2;
2898 DataArrayDoubleTuple *aa,*aa2;
2899 std::vector<double> bb,bb2;
2901 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st parameter for origin.";
2902 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd parameter for vector.";
2903 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2904 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2906 DataArrayIdType *cellIds=0;
2907 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2908 PyObject *ret=PyTuple_New(2);
2909 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2910 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2914 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const
2916 int spaceDim=self->getSpaceDimension();
2918 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2920 DataArrayDouble *a,*a2;
2921 DataArrayDoubleTuple *aa,*aa2;
2922 std::vector<double> bb,bb2;
2924 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st parameter for origin.";
2925 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd parameter for vector.";
2926 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2927 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2929 DataArrayIdType *cellIds=0;
2930 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2931 PyObject *ret=PyTuple_New(2);
2932 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2933 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2937 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const
2940 DataArrayDouble *a,*a2;
2941 DataArrayDoubleTuple *aa,*aa2;
2942 std::vector<double> bb,bb2;
2944 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st parameter for origin.";
2945 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd parameter for vector.";
2946 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2947 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2948 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2952 DataArrayIdType *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const
2954 int spaceDim=self->getSpaceDimension();
2956 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2958 DataArrayDouble *a,*a2;
2959 DataArrayDoubleTuple *aa,*aa2;
2960 std::vector<double> bb,bb2;
2962 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st parameter for origin.";
2963 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd parameter for vector.";
2964 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2965 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2966 return self->getCellIdsCrossingPlane(orig,vect,eps);
2969 void convertToPolyTypes(PyObject *li)
2973 std::vector<mcIdType> pos2;
2974 DataArrayIdType *pos3=0;
2975 DataArrayIdTypeTuple *pos4=0;
2976 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2981 self->convertToPolyTypes(&pos1,&pos1+1);
2988 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2993 self->convertToPolyTypes(pos3->begin(),pos3->end());
2997 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
3001 void convertAllToPoly();
3002 void convertExtrudedPolyhedra();
3004 void simplifyPolyhedra(double eps);
3005 MEDCouplingUMesh *buildSpreadZonesWithPoly() const;
3006 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy);
3009 //== MEDCouplingUMesh End
3011 //== MEDCouplingMappedExtrudedMesh
3013 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
3016 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
3017 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D);
3018 MEDCouplingUMesh *build3DUnstructuredMesh() const;
3019 int get2DCellIdForExtrusion() const;
3021 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, mcIdType cell2DId)
3023 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3026 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D)
3028 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3031 MEDCouplingMappedExtrudedMesh()
3033 return MEDCouplingMappedExtrudedMesh::New();
3036 std::string __str__() const
3038 return self->simpleRepr();
3041 std::string __repr__() const
3043 std::ostringstream oss;
3044 self->reprQuickOverview(oss);
3048 PyObject *getMesh2D() const
3050 MEDCouplingUMesh *ret=self->getMesh2D();
3053 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3055 PyObject *getMesh1D() const
3057 MEDCouplingUMesh *ret=self->getMesh1D();
3060 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3062 PyObject *getMesh3DIds() const
3064 DataArrayIdType *ret=self->getMesh3DIds();
3067 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
3072 //== MEDCouplingMappedExtrudedMesh End
3074 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3077 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3078 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m);
3079 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const;
3080 int getNodalConnectivityLength() const;
3081 virtual void allocateCells(int nbOfCells=0);
3082 virtual void checkConsistencyOfConnectivity() const;
3085 virtual void insertNextCell(PyObject *li)
3087 mcIdType szArr,sw,iTypppArr;
3088 std::vector<mcIdType> stdvecTyyppArr;
3089 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3090 self->insertNextCell(tmp,tmp+szArr);
3093 virtual DataArrayIdType *getNodalConnectivity() const
3095 DataArrayIdType *ret=self->getNodalConnectivity();
3096 if(ret) ret->incrRef();
3100 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li)
3102 std::vector< const MEDCoupling1GTUMesh *> parts;
3103 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3104 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3109 //== MEDCoupling1SGTUMesh
3111 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3114 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3115 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m);
3116 void setNodalConnectivity(DataArrayIdType *nodalConn);
3117 int getNumberOfNodesPerCell() const;
3118 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2);
3119 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
3120 MEDCoupling1GTUMesh *computeDualMesh() const;
3121 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const;
3122 DataArrayIdType *sortHexa8EachOther();
3125 MEDCoupling1SGTUMesh()
3127 return MEDCoupling1SGTUMesh::New();
3130 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
3132 return MEDCoupling1SGTUMesh::New(name,type);
3135 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m)
3137 return MEDCoupling1SGTUMesh::New(m);
3140 std::string __str__() const
3142 return self->simpleRepr();
3145 std::string __repr__() const
3147 std::ostringstream oss;
3148 self->reprQuickOverview(oss);
3152 PyObject *structurizeMe(double eps=1e-12) const
3154 DataArrayIdType *cellPerm(0),*nodePerm(0);
3155 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3156 PyObject *ret(PyTuple_New(3));
3157 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3158 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3159 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3163 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li)
3165 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3166 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3167 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3170 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li)
3172 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3173 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3174 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3179 //== MEDCoupling1SGTUMesh End
3181 //== MEDCoupling1DGTUMesh
3183 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3186 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3187 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m);
3188 void setNodalConnectivity(DataArrayIdType *nodalConn, DataArrayIdType *nodalConnIndex);
3189 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
3190 bool isPacked() const;
3193 MEDCoupling1DGTUMesh()
3195 return MEDCoupling1DGTUMesh::New();
3197 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
3199 return MEDCoupling1DGTUMesh::New(name,type);
3202 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m)
3204 return MEDCoupling1DGTUMesh::New(m);
3207 std::string __str__() const
3209 return self->simpleRepr();
3212 std::string __repr__() const
3214 std::ostringstream oss;
3215 self->reprQuickOverview(oss);
3219 DataArrayIdType *getNodalConnectivityIndex() const
3221 DataArrayIdType *ret=self->getNodalConnectivityIndex();
3222 if(ret) ret->incrRef();
3226 PyObject *retrievePackedNodalConnectivity() const
3228 DataArrayIdType *ret1=0,*ret2=0;
3229 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3230 PyObject *ret0Py=ret0?Py_True:Py_False;
3232 PyObject *ret=PyTuple_New(3);
3233 PyTuple_SetItem(ret,0,ret0Py);
3234 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3235 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3239 PyObject *copyWithNodalConnectivityPacked() const
3242 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3243 PyObject *ret=PyTuple_New(2);
3244 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3245 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3246 PyTuple_SetItem(ret,1,ret1Py);
3250 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li)
3252 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3253 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3254 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3257 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li)
3259 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3260 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3261 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3264 static DataArrayIdType *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<mcIdType>& offsetInNodeIdsPerElt)
3266 std::vector<const MEDCoupling::DataArrayIdType *> tmp;
3267 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",tmp);
3268 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3273 //== MEDCoupling1DGTUMeshEnd
3275 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3278 mcIdType getCellIdFromPos(mcIdType i, mcIdType j, mcIdType k) const;
3279 mcIdType getNodeIdFromPos(mcIdType i, mcIdType j, mcIdType k) const;
3280 mcIdType getNumberOfCellsOfSubLevelMesh() const;
3281 int getSpaceDimensionOnNodeStruct() const;
3282 double computeSquareness() const;
3283 virtual std::vector<mcIdType> getNodeGridStructure() const;
3284 std::vector<mcIdType> getCellGridStructure() const;
3285 MEDCoupling1SGTUMesh *build1SGTUnstructured() const;
3286 std::vector<mcIdType> getLocationFromCellId(mcIdType cellId) const;
3287 std::vector<mcIdType> getLocationFromNodeId(mcIdType cellId) const;
3288 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim);
3289 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const;
3290 static mcIdType DeduceNumberOfGivenStructure(const std::vector<mcIdType>& st);
3291 static DataArrayIdType *ComputeCornersGhost(const std::vector<mcIdType>& st, mcIdType ghostLev);
3292 static std::vector<mcIdType> GetSplitVectFromStruct(const std::vector<mcIdType>& strct);
3295 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const
3297 mcIdType tmpp1=-1,tmpp2=-1;
3298 std::vector<mcIdType> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3299 std::vector< std::pair<mcIdType,mcIdType> > inp;
3303 for(mcIdType i=0;i<tmpp1;i++)
3304 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3309 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3310 inp.resize(tmpp1/2);
3311 for(mcIdType i=0;i<tmpp1/2;i++)
3312 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3315 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3316 return self->buildStructuredSubPart(inp);
3319 static DataArrayIdType *BuildExplicitIdsFrom(PyObject *st, PyObject *part)
3321 std::vector< std::pair<mcIdType,mcIdType> > inp;
3322 convertPyToVectorPairInt(part,inp);
3324 mcIdType szArr,sw,iTypppArr;
3325 std::vector<mcIdType> stdvecTyyppArr;
3326 const mcIdType *tmp4=convertIntStarLikePyObjToCppIntStar(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3327 std::vector<mcIdType> tmp5(tmp4,tmp4+szArr);
3329 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3332 static void MultiplyPartOf(const std::vector<mcIdType>& st, PyObject *part, double factor, DataArrayDouble *da)
3334 std::vector< std::pair<mcIdType,mcIdType> > inp;
3335 convertPyToVectorPairInt(part,inp);
3336 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3339 static void MultiplyPartOfByGhost(const std::vector<mcIdType>& st, PyObject *part, mcIdType ghostSize, double factor, DataArrayDouble *da)
3341 std::vector< std::pair<mcIdType,mcIdType> > inp;
3342 convertPyToVectorPairInt(part,inp);
3343 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3346 static PyObject *PutInGhostFormat(mcIdType ghostSize, const std::vector<mcIdType>& st, PyObject *part)
3348 std::vector< std::pair<mcIdType,mcIdType> > inp;
3349 convertPyToVectorPairInt(part,inp);
3350 std::vector<mcIdType> stWithGhost;
3351 std::vector< std::pair<mcIdType,mcIdType> > partWithGhost;
3352 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3353 PyObject *ret(PyTuple_New(2));
3354 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3355 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3359 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<mcIdType>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat)
3361 std::vector< std::pair<mcIdType,mcIdType> > inp;
3362 convertPyToVectorPairInt(partCompactFormat,inp);
3363 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3366 static void AssignPartOfFieldOfDoubleUsing(const std::vector<mcIdType>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other)
3368 std::vector< std::pair<mcIdType,mcIdType> > inp;
3369 convertPyToVectorPairInt(partCompactFormat,inp);
3370 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3373 static mcIdType DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part)
3375 std::vector< std::pair<mcIdType,mcIdType> > inp;
3376 convertPyToVectorPairInt(part,inp);
3377 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3380 static DataArrayIdType *Build1GTNodalConnectivity(PyObject *li)
3382 mcIdType szArr,sw,iTypppArr;
3383 std::vector<mcIdType> stdvecTyyppArr;
3384 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3385 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3388 static DataArrayIdType *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li)
3390 mcIdType szArr,sw,iTypppArr;
3391 std::vector<mcIdType> stdvecTyyppArr;
3392 const mcIdType *tmp(convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3393 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3396 static std::vector<mcIdType> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat)
3398 std::vector< std::pair<mcIdType,mcIdType> > inp;
3399 convertPyToVectorPairInt(partCompactFormat,inp);
3400 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3403 static PyObject *GetCompactFrmtFromDimensions(const std::vector<mcIdType>& dims)
3405 std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3406 PyObject *retPy=PyList_New(ret.size());
3407 for(std::size_t i=0;i<ret.size();i++)
3409 PyObject *tmp=PyTuple_New(2);
3410 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3411 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3412 PyList_SetItem(retPy,i,tmp);
3417 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2)
3419 std::vector< std::pair<mcIdType,mcIdType> > r1Cpp,r2Cpp;
3420 convertPyToVectorPairInt(r1,r1Cpp);
3421 convertPyToVectorPairInt(r2,r2Cpp);
3422 std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3423 PyObject *retPy=PyList_New(ret.size());
3424 for(std::size_t i=0;i<ret.size();i++)
3426 PyObject *tmp=PyTuple_New(2);
3427 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3428 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3429 PyList_SetItem(retPy,i,tmp);
3434 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3436 std::vector< std::pair<mcIdType,mcIdType> > r1Cpp,r2Cpp;
3437 convertPyToVectorPairInt(r1,r1Cpp);
3438 convertPyToVectorPairInt(r2,r2Cpp);
3439 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3442 static PyObject *IsPartStructured(PyObject *li, PyObject *st)
3444 mcIdType szArr,sw,iTypppArr;
3445 std::vector<mcIdType> stdvecTyyppArr;
3446 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3447 mcIdType szArr2,sw2,iTypppArr2;
3448 std::vector<mcIdType> stdvecTyyppArr2;
3449 const mcIdType *tmp2=convertIntStarLikePyObjToCppIntStar(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3450 std::vector<mcIdType> tmp3(tmp2,tmp2+szArr2);
3451 std::vector< std::pair<mcIdType,mcIdType> > partCompactFormat;
3452 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3453 PyObject *ret=PyTuple_New(2);
3454 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3455 PyTuple_SetItem(ret,0,ret0Py);
3456 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3457 for(std::size_t i=0;i<partCompactFormat.size();i++)
3459 PyObject *tmp4=PyTuple_New(2);
3460 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3461 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3462 PyList_SetItem(ret1Py,i,tmp4);
3464 PyTuple_SetItem(ret,1,ret1Py);
3468 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true)
3470 std::vector< std::pair<mcIdType,mcIdType> > param0,param1,ret;
3471 convertPyToVectorPairInt(bigInAbs,param0);
3472 convertPyToVectorPairInt(partOfBigInAbs,param1);
3473 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3474 PyObject *retPy(PyList_New(ret.size()));
3475 for(std::size_t i=0;i<ret.size();i++)
3477 PyObject *tmp(PyTuple_New(2));
3478 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3479 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3480 PyList_SetItem(retPy,i,tmp);
3485 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<mcIdType>& translation)
3487 std::vector< std::pair<mcIdType,mcIdType> > param0;
3488 convertPyToVectorPairInt(part,param0);
3489 std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3490 PyObject *retPy(PyList_New(ret.size()));
3491 for(std::size_t i=0;i<ret.size();i++)
3493 PyObject *tmp(PyTuple_New(2));
3494 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3495 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3496 PyList_SetItem(retPy,i,tmp);
3501 static std::vector<mcIdType> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo)
3503 std::vector< std::pair<mcIdType,mcIdType> > param0,param1;
3504 convertPyToVectorPairInt(startingFrom,param0);
3505 convertPyToVectorPairInt(goingTo,param1);
3506 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3509 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true)
3511 std::vector< std::pair<mcIdType,mcIdType> > param0,param1,ret;
3512 convertPyToVectorPairInt(bigInAbs,param0);
3513 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3514 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3515 PyObject *retPy(PyList_New(ret.size()));
3516 for(std::size_t i=0;i<ret.size();i++)
3518 PyObject *tmp(PyTuple_New(2));
3519 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3520 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3521 PyList_SetItem(retPy,i,tmp);
3528 class MEDCouplingCurveLinearMesh;
3530 //== MEDCouplingCMesh
3532 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3535 static MEDCouplingCMesh *New();
3536 static MEDCouplingCMesh *New(const std::string& meshName);
3537 void setCoords(const DataArrayDouble *coordsX,
3538 const DataArrayDouble *coordsY=0,
3539 const DataArrayDouble *coordsZ=0);
3540 void setCoordsAt(int i, const DataArrayDouble *arr);
3541 MEDCouplingCurveLinearMesh *buildCurveLinear() const;
3545 return MEDCouplingCMesh::New();
3547 MEDCouplingCMesh(const std::string& meshName)
3549 return MEDCouplingCMesh::New(meshName);
3551 std::string __str__() const
3553 return self->simpleRepr();
3555 std::string __repr__() const
3557 std::ostringstream oss;
3558 self->reprQuickOverview(oss);
3561 DataArrayDouble *getCoordsAt(int i)
3563 DataArrayDouble *ret=self->getCoordsAt(i);
3571 //== MEDCouplingCMesh End
3573 //== MEDCouplingCurveLinearMesh
3575 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3578 static MEDCouplingCurveLinearMesh *New();
3579 static MEDCouplingCurveLinearMesh *New(const std::string& meshName);
3580 void setCoords(const DataArrayDouble *coords);
3582 MEDCouplingCurveLinearMesh()
3584 return MEDCouplingCurveLinearMesh::New();
3586 MEDCouplingCurveLinearMesh(const std::string& meshName)
3588 return MEDCouplingCurveLinearMesh::New(meshName);
3590 std::string __str__() const
3592 return self->simpleRepr();
3594 std::string __repr__() const
3596 std::ostringstream oss;
3597 self->reprQuickOverview(oss);
3600 DataArrayDouble *getCoords()
3602 DataArrayDouble *ret=self->getCoords();
3607 void setNodeGridStructure(PyObject *gridStruct)
3609 mcIdType szArr,sw,iTypppArr;
3610 std::vector<mcIdType> stdvecTyyppArr;
3611 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3612 self->setNodeGridStructure(tmp,tmp+szArr);
3617 //== MEDCouplingCurveLinearMesh End
3619 //== MEDCouplingIMesh
3621 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3624 static MEDCouplingIMesh *New();
3626 void setSpaceDimension(int spaceDim);
3627 std::vector<mcIdType> getNodeStruct() const;
3628 std::vector<double> getOrigin() const;
3629 std::vector<double> getDXYZ() const;
3630 void setAxisUnit(const std::string& unitName);
3631 std::string getAxisUnit() const;
3632 double getMeasureOfAnyCell() const;
3633 MEDCouplingCMesh *convertToCartesian() const;
3634 void refineWithFactor(const std::vector<mcIdType>& factors);
3635 MEDCouplingIMesh *asSingleCell() const;
3636 MEDCouplingIMesh *buildWithGhost(mcIdType ghostLev) const;
3641 return MEDCouplingIMesh::New();
3643 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
3645 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3646 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3647 const mcIdType *nodeStrctPtr(0);
3648 const double *originPtr(0),*dxyzPtr(0);
3649 mcIdType sw,sz,val0;
3650 std::vector<mcIdType> bb0;
3651 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
3654 std::vector<double> bb,bb2;
3656 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3657 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3659 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3662 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
3664 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3667 void setNodeStruct(PyObject *nodeStrct)
3669 mcIdType sw,sz,val0;
3670 std::vector<mcIdType> bb0;
3671 const mcIdType *nodeStrctPtr(convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0));
3672 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3675 void setOrigin(PyObject *origin)
3677 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3679 std::vector<double> bb;
3680 mcIdType sw,nbTuples;
3681 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3682 self->setOrigin(originPtr,originPtr+nbTuples);
3685 void setDXYZ(PyObject *dxyz)
3687 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3689 std::vector<double> bb;
3690 mcIdType sw,nbTuples;
3691 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3692 self->setDXYZ(originPtr,originPtr+nbTuples);
3695 static void CondenseFineToCoarse(const std::vector<mcIdType>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, DataArrayDouble *coarseDA)
3697 std::vector< std::pair<mcIdType,mcIdType> > inp;
3698 convertPyToVectorPairInt(fineLocInCoarse,inp);
3699 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3702 static void CondenseFineToCoarseGhost(const std::vector<mcIdType>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, DataArrayDouble *coarseDA, mcIdType ghostSize)
3704 std::vector< std::pair<mcIdType,mcIdType> > inp;
3705 convertPyToVectorPairInt(fineLocInCoarse,inp);
3706 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3709 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts)
3711 std::vector< std::pair<mcIdType,mcIdType> > inp;
3712 convertPyToVectorPairInt(fineLocInCoarse,inp);
3713 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3716 static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, mcIdType ghostSize)
3718 std::vector< std::pair<mcIdType,mcIdType> > inp;
3719 convertPyToVectorPairInt(fineLocInCoarse,inp);
3720 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3723 static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, mcIdType ghostSize)
3725 std::vector< std::pair<mcIdType,mcIdType> > inp;
3726 convertPyToVectorPairInt(fineLocInCoarse,inp);
3727 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3730 std::string __str__() const
3732 return self->simpleRepr();
3734 std::string __repr__() const
3736 std::ostringstream oss;
3737 self->reprQuickOverview(oss);
3743 //== MEDCouplingIMesh End
3747 namespace MEDCoupling
3749 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3752 virtual void checkConsistencyLight() const;
3753 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const;
3754 bool areStrictlyCompatible(const MEDCouplingField *other) const;
3755 bool areStrictlyCompatibleForMulDiv(const MEDCouplingField *other) const;
3756 virtual void copyTinyStringsFrom(const MEDCouplingField *other);
3757 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh);
3758 void setName(const char *name);
3759 std::string getDescription() const;
3760 void setDescription(const char *desc);
3761 std::string getName() const;
3762 TypeOfField getTypeOfField() const;
3763 NatureOfField getNature() const;
3764 virtual void setNature(NatureOfField nat);
3765 DataArrayDouble *getLocalizationOfDiscr() const;
3766 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const;
3767 mcIdType getNumberOfTuplesExpected() const;
3768 mcIdType getNumberOfMeshPlacesExpected() const;
3769 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3770 const std::vector<double>& gsCoo, const std::vector<double>& wg);
3771 void clearGaussLocalizations();
3772 MEDCouplingGaussLocalization& getGaussLocalization(int locId);
3773 mcIdType getNbOfGaussLocalization() const;
3774 mcIdType getGaussLocalizationIdOfOneCell(mcIdType cellId) const;
3775 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const;
3776 mcIdType getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const;
3777 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3779 PyObject *getMesh() const
3781 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3784 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3787 PyObject *getDiscretization()
3789 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3792 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3795 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const
3797 std::set<mcIdType> ret=self->getGaussLocalizationIdsOfOneType(type);
3798 return convertIntArrToPyList3(ret);
3801 PyObject *buildSubMeshData(PyObject *li) const
3803 DataArrayIdType *ret1=0;
3804 MEDCouplingMesh *ret0=0;
3806 int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
3807 if (!SWIG_IsOK(res1))
3810 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
3811 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3815 DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
3817 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
3818 da2->checkAllocated();
3819 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3821 PyObject *res = PyList_New(2);
3822 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3823 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
3827 PyObject *buildSubMeshDataRange(mcIdType begin, mcIdType end, mcIdType step) const
3829 DataArrayIdType *ret1=0;
3831 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3832 PyObject *res=PyTuple_New(2);
3833 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3835 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
3838 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3839 PyTuple_SetItem(res,1,res1);
3844 DataArrayIdType *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3847 mcIdType v0; std::vector<mcIdType> v1;
3848 const mcIdType *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
3849 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3852 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3853 const std::vector<double>& gsCoo, const std::vector<double>& wg)
3856 int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
3857 if (!SWIG_IsOK(res1))
3860 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
3861 self->setGaussLocalizationOnCells(tmp,((mcIdType *)tmp)+size,refCoo,gsCoo,wg);
3865 DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
3867 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
3868 da2->checkAllocated();
3869 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3873 PyObject *getCellIdsHavingGaussLocalization(int locId) const
3875 std::vector<mcIdType> tmp;
3876 self->getCellIdsHavingGaussLocalization(locId,tmp);
3877 DataArrayIdType *ret=DataArrayIdType::New();
3878 ret->alloc((mcIdType)tmp.size(),1);
3879 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3880 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
3883 mcIdType getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const
3885 std::vector<mcIdType> inp0;
3886 convertPyToNewIntArr4(code,1,3,inp0);
3887 std::vector<const DataArrayIdType *> inp1;
3888 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(idsPerType,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",inp1);
3889 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3894 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3897 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f);
3898 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f);
3899 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt32& f);
3900 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt64& f);
3901 static MEDCouplingFieldTemplate *New(TypeOfField type);
3902 std::string simpleRepr() const;
3903 std::string advancedRepr() const;
3904 bool isEqual(const MEDCouplingFieldTemplate *other, double meshPrec) const;
3905 bool isEqualWithoutConsideringStr(const MEDCouplingFieldTemplate *other, double meshPrec) const;
3908 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f)
3910 return MEDCouplingFieldTemplate::New(f);
3913 MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f)
3915 return MEDCouplingFieldTemplate::New(f);
3918 MEDCouplingFieldTemplate(const MEDCouplingFieldInt32& f)
3920 return MEDCouplingFieldTemplate::New(f);
3923 MEDCouplingFieldTemplate(const MEDCouplingFieldInt64& f)
3925 return MEDCouplingFieldTemplate::New(f);
3928 MEDCouplingFieldTemplate(TypeOfField type)
3930 return MEDCouplingFieldTemplate::New(type);
3933 std::string __str__() const
3935 return self->simpleRepr();
3938 std::string __repr__() const
3940 std::ostringstream oss;
3941 self->reprQuickOverview(oss);
3945 PyObject *isEqualIfNotWhy(const MEDCouplingFieldTemplate *other, double meshPrec) const
3948 bool ret0=self->isEqualIfNotWhy(other,meshPrec,ret1);
3949 PyObject *ret=PyTuple_New(2);
3950 PyObject *ret0Py=ret0?Py_True:Py_False;
3952 PyTuple_SetItem(ret,0,ret0Py);
3953 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3960 class MEDCouplingFieldT : public MEDCoupling::MEDCouplingField
3963 TypeOfTimeDiscretization getTimeDiscretization() const;
3965 MEDCouplingFieldT();
3966 ~MEDCouplingFieldT();
3969 %template(MEDCouplingFieldTdouble) MEDCoupling::MEDCouplingFieldT<double>;
3970 %template(MEDCouplingFieldTfloat) MEDCoupling::MEDCouplingFieldT<float>;
3971 %template(MEDCouplingFieldTint) MEDCoupling::MEDCouplingFieldT<int>;
3973 class MEDCouplingFieldInt32;
3974 class MEDCouplingFieldInt64;
3975 class MEDCouplingFieldFloat;
3977 class MEDCouplingFieldDouble : public MEDCouplingFieldT<double>
3980 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3981 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3982 bool isEqual(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
3983 bool isEqualWithoutConsideringStr(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
3984 void setTimeUnit(const std::string& unit);
3985 std::string getTimeUnit() const;
3986 void synchronizeTimeWithSupport();
3987 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other);
3988 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other);
3989 std::string simpleRepr() const;
3990 std::string advancedRepr() const;
3991 std::string writeVTK(const std::string& fileName, bool isBinary=true) const;
3992 MEDCouplingFieldInt32 *convertToIntField() const;
3993 MEDCouplingFieldFloat *convertToFloatField() const;
3994 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3995 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3996 MEDCouplingFieldDouble *deepCopy() const;
3997 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const;
3998 MEDCouplingFieldDouble *nodeToCellDiscretization() const;
3999 MEDCouplingFieldDouble *cellToNodeDiscretization() const;
4000 double getIJ(int tupleId, int compoId) const;
4001 double getIJK(int cellId, int nodeIdInCell, int compoId) const;
4002 void synchronizeTimeWithMesh();
4003 void setArray(DataArrayDouble *array);
4004 void setEndArray(DataArrayDouble *array);
4005 void setTime(double val, int iteration, int order);
4006 void setStartTime(double val, int iteration, int order);
4007 void setEndTime(double val, int iteration, int order);
4008 void applyLin(double a, double b, int compoId);
4009 void applyLin(double a, double b);
4010 int getNumberOfComponents() const;
4011 int getNumberOfTuples() const;
4012 int getNumberOfValues() const;
4013 void setTimeTolerance(double val);
4014 double getTimeTolerance() const;
4015 void setIteration(int it);
4016 void setEndIteration(int it);
4017 void setOrder(int order);
4018 void setEndOrder(int order);
4019 void setTimeValue(double val);
4020 void setEndTimeValue(double val);
4021 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15);
4022 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15);
4023 bool mergeNodes(double eps, double epsOnVals=1e-15);
4024 bool mergeNodesCenter(double eps, double epsOnVals=1e-15);
4025 bool zipCoords(double epsOnVals=1e-15);
4026 bool zipConnectivity(int compType,double epsOnVals=1e-15);
4027 bool simplexize(int policy);
4028 MEDCouplingFieldDouble *doublyContractedProduct() const;
4029 MEDCouplingFieldDouble *determinant() const;
4030 MEDCouplingFieldDouble *eigenValues() const;
4031 MEDCouplingFieldDouble *eigenVectors() const;
4032 MEDCouplingFieldDouble *inverse() const;
4033 MEDCouplingFieldDouble *trace() const;
4034 MEDCouplingFieldDouble *deviator() const;
4035 MEDCouplingFieldDouble *magnitude() const;
4036 MEDCouplingFieldDouble *maxPerTuple() const;
4037 void changeNbOfComponents(std::size_t newNbOfComp, double dftValue=0.);
4038 void sortPerTuple(bool asc);
4039 MEDCouplingFieldDouble &operator=(double value);
4040 void fillFromAnalytic(int nbOfComp, const std::string& func);
4041 void fillFromAnalyticCompo(int nbOfComp, const std::string& func);
4042 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
4043 void applyFunc(int nbOfComp, const std::string& func);
4044 void applyFuncCompo(int nbOfComp, const std::string& func);
4045 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
4046 void applyFunc(int nbOfComp, double val);
4047 void applyFunc(const std::string& func);
4048 void applyFuncFast32(const std::string& func);
4049 void applyFuncFast64(const std::string& func);
4050 double accumulate(int compId) const;
4051 double getMaxValue() const;
4052 double getMinValue() const;
4053 double getAverageValue() const;
4054 double norm2() const;
4055 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4056 double getWeightedAverageValue(int compId, bool isWAbs) const;
4057 double integral(int compId, bool isWAbs) const;
4058 double normL1(int compId) const;
4059 double normL2(int compId) const;
4060 double normMax(int compId) const;
4061 DataArrayIdType *findIdsInRange(double vmin, double vmax) const;
4062 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const;
4063 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4064 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4065 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4066 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const;
4067 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4068 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const;
4069 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4070 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const;
4071 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4072 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4073 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4074 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4075 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4076 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const;
4077 MEDCouplingFieldDouble *negate() const;
4079 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4081 return MEDCouplingFieldDouble::New(type,td);
4084 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4086 return MEDCouplingFieldDouble::New(ft,td);
4089 std::string __str__() const
4091 return self->simpleRepr();
4094 std::string __repr__() const
4096 std::ostringstream oss;
4097 self->reprQuickOverview(oss);
4101 PyObject *isEqualIfNotWhy(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const
4104 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
4105 PyObject *ret=PyTuple_New(2);
4106 PyObject *ret0Py=ret0?Py_True:Py_False;
4108 PyTuple_SetItem(ret,0,ret0Py);
4109 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4113 MEDCouplingFieldDouble *voronoize(double eps) const
4115 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4119 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const
4121 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4125 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4127 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4129 DataArrayDouble *a,*a2;
4130 DataArrayDoubleTuple *aa,*aa2;
4131 std::vector<double> bb,bb2;
4133 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4134 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4135 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4138 DataArrayDouble *getArray()
4140 DataArrayDouble *ret=self->getArray();
4146 PyObject *getArrays() const
4148 std::vector<DataArrayDouble *> arrs=self->getArrays();
4149 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4152 std::size_t sz=arrs.size();
4153 PyObject *ret=PyTuple_New(sz);
4154 for(std::size_t i=0;i<sz;i++)
4157 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4159 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4164 void setArrays(PyObject *ls)
4166 std::vector<const DataArrayDouble *> tmp;
4167 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4168 std::size_t sz=tmp.size();
4169 std::vector<DataArrayDouble *> arrs(sz);
4170 for(std::size_t i=0;i<sz;i++)
4171 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4172 self->setArrays(arrs);
4175 DataArrayDouble *getEndArray()
4177 DataArrayDouble *ret=self->getEndArray();
4183 PyObject *getValueOn(PyObject *sl) const
4187 DataArrayDoubleTuple *aa;
4188 std::vector<double> bb;
4190 const MEDCouplingMesh *mesh=self->getMesh();
4192 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4193 int spaceDim=mesh->getSpaceDimension();
4194 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4195 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4197 mcIdType sz=ToIdType(self->getNumberOfComponents());
4198 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4199 self->getValueOn(spaceLoc,res);
4200 return convertDblArrToPyList<double>(res,sz);
4203 PyObject *getValueOnPos(mcIdType i, mcIdType j, mcIdType k) const
4205 mcIdType sz=ToIdType(self->getNumberOfComponents());
4206 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4207 self->getValueOnPos(i,j,k,res);
4208 return convertDblArrToPyList<double>(res,sz);
4211 DataArrayDouble *getValueOnMulti(PyObject *locs) const
4213 const MEDCouplingMesh *mesh(self->getMesh());
4215 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4218 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4219 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4220 mesh->getSpaceDimension(),true,nbPts);
4221 return self->getValueOnMulti(inp,(int)nbPts);
4224 PyObject *getValueOn(PyObject *sl, double time) const
4228 DataArrayDoubleTuple *aa;
4229 std::vector<double> bb;
4231 const MEDCouplingMesh *mesh=self->getMesh();
4233 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4234 int spaceDim=mesh->getSpaceDimension();
4235 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4236 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4239 mcIdType sz=ToIdType(self->getNumberOfComponents());
4240 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4241 self->getValueOn(spaceLoc,time,res);
4242 return convertDblArrToPyList<double>(res,sz);
4245 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
4247 if(self->getArray()!=0)
4248 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4251 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4252 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4253 self->setArray(arr);
4260 double tmp0=self->getTime(tmp1,tmp2);
4261 PyObject *res = PyList_New(3);
4262 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4263 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4264 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4268 PyObject *getStartTime()
4271 double tmp0=self->getStartTime(tmp1,tmp2);
4272 PyObject *res = PyList_New(3);
4273 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4274 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4275 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4279 PyObject *getEndTime()
4282 double tmp0=self->getEndTime(tmp1,tmp2);
4283 PyObject *res = PyList_New(3);
4284 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4285 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4286 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4289 PyObject *accumulate() const
4291 mcIdType sz=ToIdType(self->getNumberOfComponents());
4292 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4293 self->accumulate(tmp);
4294 return convertDblArrToPyList<double>(tmp,sz);
4296 PyObject *integral(bool isWAbs) const
4298 mcIdType sz=ToIdType(self->getNumberOfComponents());
4299 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4300 self->integral(isWAbs,tmp);
4301 return convertDblArrToPyList<double>(tmp,sz);
4303 PyObject *getWeightedAverageValue(bool isWAbs=true) const
4305 mcIdType sz=ToIdType(self->getNumberOfComponents());
4306 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4307 self->getWeightedAverageValue(tmp,isWAbs);
4308 return convertDblArrToPyList<double>(tmp,sz);
4310 PyObject *normL1() const
4312 mcIdType sz=ToIdType(self->getNumberOfComponents());
4313 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4315 return convertDblArrToPyList<double>(tmp,sz);
4317 PyObject *normL2() const
4319 mcIdType sz=ToIdType(self->getNumberOfComponents());
4320 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4322 return convertDblArrToPyList<double>(tmp,sz);
4324 PyObject *normMax() const
4326 mcIdType sz=ToIdType(self->getNumberOfComponents());
4327 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4329 return convertDblArrToPyList<double>(tmp,sz);
4331 void renumberCells(PyObject *li, bool check=true)
4333 mcIdType szArr,sw,iTypppArr;
4334 std::vector<mcIdType> stdvecTyyppArr;
4335 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4336 self->renumberCells(tmp,check);
4339 void renumberCellsWithoutMesh(PyObject *li, bool check=true)
4341 mcIdType szArr,sw,iTypppArr;
4342 std::vector<mcIdType> stdvecTyyppArr;
4343 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4344 self->renumberCellsWithoutMesh(tmp,check);
4347 void renumberNodes(PyObject *li, double eps=1e-15)
4349 mcIdType szArr,sw,iTypppArr;
4350 std::vector<mcIdType> stdvecTyyppArr;
4351 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4352 self->renumberNodes(tmp,eps);
4355 void renumberNodesWithoutMesh(PyObject *li, mcIdType newNbOfNodes, double eps=1e-15)
4357 mcIdType szArr,sw,iTypppArr;
4358 std::vector<mcIdType> stdvecTyyppArr;
4359 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4360 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4363 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const
4365 return fieldT_buildSubPart(self,li);
4368 MEDCouplingFieldDouble *__getitem__(PyObject *li) const
4370 return fieldT__getitem__(self,li);
4373 PyObject *getMaxValue2() const
4375 DataArrayIdType *tmp;
4376 double r1=self->getMaxValue2(tmp);
4377 PyObject *ret=PyTuple_New(2);
4378 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4379 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4383 PyObject *getMinValue2() const
4385 DataArrayIdType *tmp;
4386 double r1=self->getMinValue2(tmp);
4387 PyObject *ret=PyTuple_New(2);
4388 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4389 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4393 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const
4395 std::vector<std::size_t> tmp;
4396 convertPyToNewIntArr3(li,tmp);
4397 return self->keepSelectedComponents(tmp);
4400 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li)
4402 std::vector<std::size_t> tmp;
4403 convertPyToNewIntArr3(li,tmp);
4404 self->setSelectedComponents(f,tmp);
4407 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const
4410 DataArrayDouble *a,*a2;
4411 DataArrayDoubleTuple *aa,*aa2;
4412 std::vector<double> bb,bb2;
4415 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st parameter for origin.";
4416 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd parameter for vector.";
4417 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4418 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4420 return self->extractSlice3D(orig,vect,eps);
4423 MEDCouplingFieldDouble *__add__(PyObject *obj)
4425 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4428 MEDCouplingFieldDouble *__radd__(PyObject *obj)
4430 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4433 MEDCouplingFieldDouble *__sub__(PyObject *obj)
4435 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.";
4436 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4439 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4441 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4443 return (*self)-(*other);
4445 throw INTERP_KERNEL::Exception(msg);
4450 DataArrayDoubleTuple *aa;
4451 std::vector<double> bb;
4453 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4458 if(!self->getArray())
4459 throw INTERP_KERNEL::Exception(msg2);
4460 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4461 ret->applyLin(1.,-val);
4462 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4463 ret2->setArray(ret);
4468 if(!self->getArray())
4469 throw INTERP_KERNEL::Exception(msg2);
4470 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4471 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4472 ret2->setArray(ret);
4477 if(!self->getArray())
4478 throw INTERP_KERNEL::Exception(msg2);
4479 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4480 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4481 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4482 ret2->setArray(ret);
4487 if(!self->getArray())
4488 throw INTERP_KERNEL::Exception(msg2);
4489 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4490 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4491 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4492 ret2->setArray(ret);
4496 { throw INTERP_KERNEL::Exception(msg); }
4500 MEDCouplingFieldDouble *__rsub__(PyObject *obj)
4502 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4505 MEDCouplingFieldDouble *__mul__(PyObject *obj)
4507 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4510 MEDCouplingFieldDouble *__rmul__(PyObject *obj)
4512 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4515 MEDCouplingFieldDouble *__div__(PyObject *obj)
4517 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.";
4518 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4521 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4523 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4525 return (*self)/(*other);
4527 throw INTERP_KERNEL::Exception(msg);
4532 DataArrayDoubleTuple *aa;
4533 std::vector<double> bb;
4535 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4541 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4542 if(!self->getArray())
4543 throw INTERP_KERNEL::Exception(msg2);
4544 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4545 ret->applyLin(1./val,0);
4546 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4547 ret2->setArray(ret);
4552 if(!self->getArray())
4553 throw INTERP_KERNEL::Exception(msg2);
4554 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4555 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4556 ret2->setArray(ret);
4561 if(!self->getArray())
4562 throw INTERP_KERNEL::Exception(msg2);
4563 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4564 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4565 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4566 ret2->setArray(ret);
4571 if(!self->getArray())
4572 throw INTERP_KERNEL::Exception(msg2);
4573 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4574 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4575 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4576 ret2->setArray(ret);
4580 { throw INTERP_KERNEL::Exception(msg); }
4584 MEDCouplingFieldDouble *__rdiv__(PyObject *obj)
4586 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4589 MEDCouplingFieldDouble *__pow__(PyObject *obj)
4591 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.";
4592 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4595 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4597 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4599 return (*self)^(*other);
4601 throw INTERP_KERNEL::Exception(msg);
4606 DataArrayDoubleTuple *aa;
4607 std::vector<double> bb;
4609 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4614 if(!self->getArray())
4615 throw INTERP_KERNEL::Exception(msg2);
4616 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4618 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4619 ret2->setArray(ret);
4624 if(!self->getArray())
4625 throw INTERP_KERNEL::Exception(msg2);
4626 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4627 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4628 ret2->setArray(ret);
4633 if(!self->getArray())
4634 throw INTERP_KERNEL::Exception(msg2);
4635 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4636 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4637 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4638 ret2->setArray(ret);
4643 if(!self->getArray())
4644 throw INTERP_KERNEL::Exception(msg2);
4645 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4646 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4647 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4648 ret2->setArray(ret);
4652 { throw INTERP_KERNEL::Exception(msg); }
4656 MEDCouplingFieldDouble *__neg__() const
4658 return self->negate();
4661 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
4663 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.";
4664 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4667 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4669 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4673 Py_XINCREF(trueSelf);
4677 throw INTERP_KERNEL::Exception(msg);
4682 DataArrayDoubleTuple *aa;
4683 std::vector<double> bb;
4685 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4690 if(!self->getArray())
4691 throw INTERP_KERNEL::Exception(msg2);
4692 self->getArray()->applyLin(1.,val);
4693 Py_XINCREF(trueSelf);
4698 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4701 Py_XINCREF(trueSelf);
4706 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4707 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4708 ret2->setArray(aaa);
4710 Py_XINCREF(trueSelf);
4715 if(!self->getArray())
4716 throw INTERP_KERNEL::Exception(msg2);
4717 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4718 self->getArray()->addEqual(aaa);
4719 Py_XINCREF(trueSelf);
4723 { throw INTERP_KERNEL::Exception(msg); }
4727 PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
4729 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.";
4730 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4733 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4735 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4739 Py_XINCREF(trueSelf);
4743 throw INTERP_KERNEL::Exception(msg);
4748 DataArrayDoubleTuple *aa;
4749 std::vector<double> bb;
4751 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4756 if(!self->getArray())
4757 throw INTERP_KERNEL::Exception(msg2);
4758 self->getArray()->applyLin(1.,-val);
4759 Py_XINCREF(trueSelf);
4764 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4767 Py_XINCREF(trueSelf);
4772 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4773 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4774 ret2->setArray(aaa);
4776 Py_XINCREF(trueSelf);
4781 if(!self->getArray())
4782 throw INTERP_KERNEL::Exception(msg2);
4783 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4784 self->getArray()->substractEqual(aaa);
4785 Py_XINCREF(trueSelf);
4789 { throw INTERP_KERNEL::Exception(msg); }
4793 PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
4795 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.";
4796 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4799 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4801 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4805 Py_XINCREF(trueSelf);
4809 throw INTERP_KERNEL::Exception(msg);
4814 DataArrayDoubleTuple *aa;
4815 std::vector<double> bb;
4817 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4822 if(!self->getArray())
4823 throw INTERP_KERNEL::Exception(msg2);
4824 self->getArray()->applyLin(val,0);
4825 Py_XINCREF(trueSelf);
4830 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4833 Py_XINCREF(trueSelf);
4838 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4839 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4840 ret2->setArray(aaa);
4842 Py_XINCREF(trueSelf);
4847 if(!self->getArray())
4848 throw INTERP_KERNEL::Exception(msg2);
4849 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4850 self->getArray()->multiplyEqual(aaa);
4851 Py_XINCREF(trueSelf);
4855 { throw INTERP_KERNEL::Exception(msg); }
4859 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
4861 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.";
4862 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4865 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4867 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4871 Py_XINCREF(trueSelf);
4875 throw INTERP_KERNEL::Exception(msg);
4880 DataArrayDoubleTuple *aa;
4881 std::vector<double> bb;
4883 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4889 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4890 if(!self->getArray())
4891 throw INTERP_KERNEL::Exception(msg2);
4892 self->getArray()->applyLin(1./val,0);
4893 Py_XINCREF(trueSelf);
4898 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4901 Py_XINCREF(trueSelf);
4906 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4907 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4908 ret2->setArray(aaa);
4910 Py_XINCREF(trueSelf);
4915 if(!self->getArray())
4916 throw INTERP_KERNEL::Exception(msg2);
4917 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4918 self->getArray()->divideEqual(aaa);
4919 Py_XINCREF(trueSelf);
4923 { throw INTERP_KERNEL::Exception(msg); }
4927 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj)
4929 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.";
4930 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4933 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4935 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4939 Py_XINCREF(trueSelf);
4943 throw INTERP_KERNEL::Exception(msg);
4948 DataArrayDoubleTuple *aa;
4949 std::vector<double> bb;
4951 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4956 if(!self->getArray())
4957 throw INTERP_KERNEL::Exception(msg2);
4958 self->getArray()->applyPow(val);
4959 Py_XINCREF(trueSelf);
4964 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4967 Py_XINCREF(trueSelf);
4972 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4973 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4974 ret2->setArray(aaa);
4976 Py_XINCREF(trueSelf);
4981 if(!self->getArray())
4982 throw INTERP_KERNEL::Exception(msg2);
4983 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4984 self->getArray()->powEqual(aaa);
4985 Py_XINCREF(trueSelf);
4989 { throw INTERP_KERNEL::Exception(msg); }
4993 static MEDCouplingFieldDouble *MergeFields(PyObject *li)
4995 std::vector<const MEDCouplingFieldDouble *> tmp;
4996 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4997 return MEDCouplingFieldDouble::MergeFields(tmp);
5000 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true)
5002 std::vector<const MEDCouplingFieldDouble *> tmp;
5003 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5004 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
5007 PyObject *getTinySerializationInformation() const
5009 return field_getTinySerializationInformation<MEDCouplingFieldDouble>(self);
5012 PyObject *serialize() const
5014 return field_serialize<double>(self);
5017 PyObject *__getstate__() const
5019 return field__getstate__<MEDCouplingFieldDouble>(self,MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldDouble_serialize);
5022 void __setstate__(PyObject *inp)
5024 field__setstate__<double>(self,inp);
5029 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5032 int getNumberOfFields() const;
5033 MEDCouplingMultiFields *deepCopy() const;
5034 virtual std::string simpleRepr() const;
5035 virtual std::string advancedRepr() const;
5036 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5037 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5038 virtual void checkConsistencyLight() const;
5041 std::string __str__() const
5043 return self->simpleRepr();
5045 static MEDCouplingMultiFields *New(PyObject *li)
5047 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5048 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5049 std::size_t sz=tmp.size();
5050 std::vector<MEDCouplingFieldDouble *> fs(sz);
5051 for(std::size_t i=0;i<sz;i++)
5052 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5053 return MEDCouplingMultiFields::New(fs);
5055 MEDCouplingMultiFields(PyObject *li)
5057 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5058 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5059 std::size_t sz=tmp.size();
5060 std::vector<MEDCouplingFieldDouble *> fs(sz);
5061 for(std::size_t i=0;i<sz;i++)
5062 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5063 return MEDCouplingMultiFields::New(fs);
5065 PyObject *getFields() const
5067 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5068 std::size_t sz=fields.size();
5069 PyObject *res = PyList_New(sz);
5070 for(std::size_t i=0;i<sz;i++)
5074 fields[i]->incrRef();
5075 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5079 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5084 PyObject *getFieldAtPos(int id) const
5086 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5090 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5093 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5095 PyObject *getMeshes() const
5097 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5098 std::size_t sz=ms.size();
5099 PyObject *res = PyList_New(sz);
5100 for(std::size_t i=0;i<sz;i++)
5105 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5109 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5114 PyObject *getDifferentMeshes() const
5116 std::vector<int> refs;
5117 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5118 std::size_t sz=ms.size();
5119 PyObject *res = PyList_New(sz);
5120 for(std::size_t i=0;i<sz;i++)
5125 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5129 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5133 PyObject *ret=PyTuple_New(2);
5134 PyTuple_SetItem(ret,0,res);
5135 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5138 PyObject *getArrays() const
5140 std::vector<DataArrayDouble *> ms=self->getArrays();
5141 std::size_t sz=ms.size();
5142 PyObject *res = PyList_New(sz);
5143 for(std::size_t i=0;i<sz;i++)
5148 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5152 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5157 PyObject *getDifferentArrays() const
5159 std::vector< std::vector<int> > refs;
5160 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5161 std::size_t sz=ms.size();
5162 PyObject *res = PyList_New(sz);
5163 PyObject *res2 = PyList_New(sz);
5164 for(std::size_t i=0;i<sz;i++)
5169 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5173 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5175 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5178 PyObject *ret=PyTuple_New(2);
5179 PyTuple_SetItem(ret,0,res);
5180 PyTuple_SetItem(ret,1,res2);
5186 class MEDCouplingFieldInt32 : public MEDCouplingFieldT<int>
5189 static MEDCouplingFieldInt32 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5190 static MEDCouplingFieldInt32 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5191 bool isEqual(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const;
5192 bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const;
5193 void setTimeUnit(const std::string& unit);
5194 std::string getTimeUnit() const;
5195 void setTime(double val, int iteration, int order);
5196 void setArray(DataArrayInt32 *array);
5197 MEDCouplingFieldInt32 *deepCopy() const;
5198 MEDCouplingFieldInt32 *clone(bool recDeepCpy) const;
5199 MEDCouplingFieldInt32 *cloneWithMesh(bool recDeepCpy) const;
5200 MEDCouplingFieldDouble *convertToDblField() const;
5201 MEDCouplingFieldInt32 *buildSubPartRange(int begin, int end, int step) const;
5203 MEDCouplingFieldInt32(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5205 return MEDCouplingFieldInt32::New(type,td);
5208 MEDCouplingFieldInt32(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5210 return MEDCouplingFieldInt32::New(ft,td);
5213 PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const
5216 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5217 PyObject *ret=PyTuple_New(2);
5218 PyObject *ret0Py=ret0?Py_True:Py_False;
5220 PyTuple_SetItem(ret,0,ret0Py);
5221 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5225 std::string __str__() const
5227 return self->simpleRepr();
5230 std::string __repr__() const
5232 std::ostringstream oss;
5233 self->reprQuickOverview(oss);
5237 MEDCouplingFieldInt32 *buildSubPart(PyObject *li) const
5239 return fieldT_buildSubPart(self,li);
5242 MEDCouplingFieldInt32 *__getitem__(PyObject *li) const
5244 return fieldT__getitem__(self,li);
5247 DataArrayInt32 *getArray()
5249 DataArrayInt32 *ret=self->getArray();
5258 double tmp0=self->getTime(tmp1,tmp2);
5259 PyObject *res = PyList_New(3);
5260 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5261 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5262 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5266 PyObject *getTinySerializationInformation() const
5268 return field_getTinySerializationInformation<MEDCouplingFieldInt32>(self);
5271 PyObject *serialize() const
5273 return field_serialize<int>(self);
5276 PyObject *__getstate__() const
5278 return field__getstate__<MEDCouplingFieldInt32>(self,MEDCoupling_MEDCouplingFieldInt32_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt32_serialize);
5281 void __setstate__(PyObject *inp)
5283 field__setstate__<int>(self,inp);
5288 class MEDCouplingFieldInt64 : public MEDCouplingFieldT<int>
5291 static MEDCouplingFieldInt64 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5292 static MEDCouplingFieldInt64 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5293 bool isEqual(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
5294 bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
5295 void setTimeUnit(const std::string& unit);
5296 std::string getTimeUnit() const;
5297 void setTime(double val, int iteration, int order);
5298 void setArray(DataArrayInt64 *array);
5299 MEDCouplingFieldInt64 *deepCopy() const;
5300 MEDCouplingFieldInt64 *clone(bool recDeepCpy) const;
5301 MEDCouplingFieldInt64 *cloneWithMesh(bool recDeepCpy) const;
5302 MEDCouplingFieldDouble *convertToDblField() const;
5303 MEDCouplingFieldInt64 *buildSubPartRange(int begin, int end, int step) const;
5305 MEDCouplingFieldInt64(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5307 return MEDCouplingFieldInt64::New(type,td);
5310 MEDCouplingFieldInt64(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5312 return MEDCouplingFieldInt64::New(ft,td);
5315 PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const
5318 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5319 PyObject *ret=PyTuple_New(2);
5320 PyObject *ret0Py=ret0?Py_True:Py_False;
5322 PyTuple_SetItem(ret,0,ret0Py);
5323 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5327 std::string __str__() const
5329 return self->simpleRepr();
5332 std::string __repr__() const
5334 std::ostringstream oss;
5335 self->reprQuickOverview(oss);
5339 MEDCouplingFieldInt64 *buildSubPart(PyObject *li) const
5341 return fieldT_buildSubPart(self,li);
5344 MEDCouplingFieldInt64 *__getitem__(PyObject *li) const
5346 return fieldT__getitem__(self,li);
5349 DataArrayInt64 *getArray()
5351 DataArrayInt64 *ret=self->getArray();
5360 double tmp0=self->getTime(tmp1,tmp2);
5361 PyObject *res = PyList_New(3);
5362 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5363 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5364 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5368 PyObject *getTinySerializationInformation() const
5370 return field_getTinySerializationInformation<MEDCouplingFieldInt64>(self);
5373 PyObject *serialize() const
5375 return field_serialize<Int64>(self);
5378 PyObject *__getstate__() const
5380 return field__getstate__<MEDCouplingFieldInt64>(self,MEDCoupling_MEDCouplingFieldInt64_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt64_serialize);
5383 void __setstate__(PyObject *inp)
5385 field__setstate__<Int64>(self,inp);
5390 class MEDCouplingFieldFloat : public MEDCouplingFieldT<float>
5393 static MEDCouplingFieldFloat *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5394 static MEDCouplingFieldFloat *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5395 bool isEqual(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
5396 bool isEqualWithoutConsideringStr(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
5397 void setTimeUnit(const std::string& unit);
5398 std::string getTimeUnit() const;
5399 void setTime(double val, int iteration, int order);
5400 void setArray(DataArrayFloat *array);
5401 MEDCouplingFieldFloat *deepCopy() const;
5402 MEDCouplingFieldFloat *clone(bool recDeepCpy) const;
5403 MEDCouplingFieldFloat *cloneWithMesh(bool recDeepCpy) const;
5404 MEDCouplingFieldDouble *convertToDblField() const;
5405 MEDCouplingFieldFloat *buildSubPartRange(int begin, int end, int step) const;
5407 MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5409 return MEDCouplingFieldFloat::New(type,td);
5412 MEDCouplingFieldFloat(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5414 return MEDCouplingFieldFloat::New(ft,td);
5417 PyObject *isEqualIfNotWhy(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const
5420 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5421 PyObject *ret=PyTuple_New(2);
5422 PyObject *ret0Py=ret0?Py_True:Py_False;
5424 PyTuple_SetItem(ret,0,ret0Py);
5425 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5429 std::string __str__() const
5431 return self->simpleRepr();
5434 std::string __repr__() const
5436 std::ostringstream oss;
5437 self->reprQuickOverview(oss);
5441 MEDCouplingFieldFloat *buildSubPart(PyObject *li) const
5443 return fieldT_buildSubPart(self,li);
5446 MEDCouplingFieldFloat *__getitem__(PyObject *li) const
5448 return fieldT__getitem__(self,li);
5451 DataArrayFloat *getArray()
5453 DataArrayFloat *ret=self->getArray();
5462 double tmp0=self->getTime(tmp1,tmp2);
5463 PyObject *res = PyList_New(3);
5464 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5465 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5466 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5470 PyObject *getTinySerializationInformation() const
5472 return field_getTinySerializationInformation<MEDCouplingFieldFloat>(self);
5475 PyObject *serialize() const
5477 return field_serialize<float>(self);
5480 PyObject *__getstate__() const
5482 return field__getstate__<MEDCouplingFieldFloat>(self,MEDCoupling_MEDCouplingFieldFloat_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldFloat_serialize);
5485 void __setstate__(PyObject *inp)
5487 field__setstate__<float>(self,inp);
5492 class MEDCouplingDefinitionTime
5495 MEDCouplingDefinitionTime();
5496 void assign(const MEDCouplingDefinitionTime& other);
5497 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5498 double getTimeResolution() const;
5499 std::vector<double> getHotSpotsTime() const;
5502 std::string __str__() const
5504 std::ostringstream oss;
5505 self->appendRepr(oss);
5509 PyObject *getIdsOnTimeRight(double tm) const
5511 int meshId,arrId,arrIdInField,fieldId;
5512 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5513 PyObject *res=PyList_New(4);
5514 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5515 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5516 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5517 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5521 PyObject *getIdsOnTimeLeft(double tm) const
5523 int meshId,arrId,arrIdInField,fieldId;
5524 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5525 PyObject *res=PyList_New(4);
5526 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5527 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5528 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5529 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5535 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5538 double getTimeTolerance() const;
5539 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5543 MEDCouplingFieldOverTime(PyObject *li)
5545 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5546 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5547 std::size_t sz=tmp.size();
5548 std::vector<MEDCouplingFieldDouble *> fs(sz);
5549 for(std::size_t i=0;i<sz;i++)
5550 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5551 return MEDCouplingFieldOverTime::New(fs);
5553 std::string __str__() const
5555 return self->simpleRepr();
5557 static MEDCouplingFieldOverTime *New(PyObject *li)
5559 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5560 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5561 std::size_t sz=tmp.size();
5562 std::vector<MEDCouplingFieldDouble *> fs(sz);
5563 for(std::size_t i=0;i<sz;i++)
5564 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5565 return MEDCouplingFieldOverTime::New(fs);
5570 class MEDCouplingCartesianAMRMesh;
5572 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5575 int getNumberOfCellsRecursiveWithOverlap() const;
5576 int getNumberOfCellsRecursiveWithoutOverlap() const;
5577 int getMaxNumberOfLevelsRelativeToThis() const;
5580 MEDCouplingCartesianAMRMeshGen *getMesh() const
5582 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5590 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5593 int getNumberOfOverlapedCellsForFather() const;
5594 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const;
5595 std::vector<mcIdType> computeCellGridSt() const;
5598 PyObject *getBLTRRange() const
5600 const std::vector< std::pair<mcIdType,mcIdType> >& ret(self->getBLTRRange());
5601 return convertFromVectorPairInt(ret);
5604 PyObject *getBLTRRangeRelativeToGF() const
5606 std::vector< std::pair<mcIdType,mcIdType> > ret(self->getBLTRRangeRelativeToGF());
5607 return convertFromVectorPairInt(ret);
5610 void addPatch(PyObject *bottomLeftTopRight, const std::vector<mcIdType>& factors)
5612 std::vector< std::pair<mcIdType,mcIdType> > inp;
5613 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5614 self->addPatch(inp,factors);
5617 MEDCouplingCartesianAMRPatch *__getitem__(mcIdType patchId) const
5619 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5621 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5622 if(patchId==mesh->getNumberOfPatches())
5624 std::ostringstream oss;
5625 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5626 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5629 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5635 void __delitem__(mcIdType patchId)
5637 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5639 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5640 mesh->removePatch(patchId);
5643 mcIdType __len__() const
5645 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5647 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5648 return mesh->getNumberOfPatches();
5653 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5657 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5660 mcIdType getAbsoluteLevel() const;
5661 mcIdType getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
5662 std::vector<mcIdType> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
5663 int getSpaceDimension() const;
5664 const std::vector<mcIdType>& getFactors() const;
5665 void setFactors(const std::vector<mcIdType>& newFactors);
5666 mcIdType getMaxNumberOfLevelsRelativeToThis() const;
5667 mcIdType getNumberOfCellsAtCurrentLevel() const;
5668 mcIdType getNumberOfCellsAtCurrentLevelGhost(mcIdType ghostLev) const;
5669 mcIdType getNumberOfCellsRecursiveWithOverlap() const;
5670 mcIdType getNumberOfCellsRecursiveWithoutOverlap() const;
5671 bool isPatchInNeighborhoodOf(mcIdType patchId1, mcIdType patchId2, mcIdType ghostLev) const;
5672 virtual void detachFromFather();
5674 mcIdType getNumberOfPatches() const;
5675 mcIdType getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const;
5676 MEDCouplingUMesh *buildUnstructured() const;
5677 DataArrayDouble *extractGhostFrom(mcIdType ghostSz, const DataArrayDouble *arr) const;
5678 std::vector<mcIdType> getPatchIdsInTheNeighborhoodOf(mcIdType patchId, mcIdType ghostLev) const;
5679 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const;
5680 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const;
5681 void removeAllPatches();
5682 void removePatch(mcIdType patchId);
5683 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<mcIdType>& factors);
5684 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<mcIdType>& factors, double eps);
5685 DataArrayDouble *createCellFieldOnPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnThis) const;
5686 void fillCellFieldOnPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const;
5687 void fillCellFieldOnPatchGhost(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev, bool isConservative=true) const;
5688 void fillCellFieldOnPatchOnlyOnGhostZone(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev) const;
5689 void fillCellFieldOnPatchOnlyOnGhostZoneWith(mcIdType ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5690 void fillCellFieldComingFromPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const;
5691 void fillCellFieldComingFromPatchGhost(mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, bool isConservative=true) const;
5692 DataArrayIdType *findPatchesInTheNeighborhoodOf(mcIdType patchId, mcIdType ghostLev) const;
5693 std::string buildPythonDumpOfThis() const;
5696 void addPatch(PyObject *bottomLeftTopRight, const std::vector<mcIdType>& factors)
5698 std::vector< std::pair<mcIdType,mcIdType> > inp;
5699 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5700 self->addPatch(inp,factors);
5703 PyObject *getPatches() const
5705 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5706 std::size_t sz(ps.size());
5707 PyObject *ret = PyList_New(sz);
5708 for(std::size_t i=0;i<sz;i++)
5710 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5713 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5718 // agy : don't know why typemap fails here ??? let it in the extend section
5719 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const
5721 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5724 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<mcIdType>& pos) const
5726 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5727 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5733 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<mcIdType>& pos) const
5735 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5736 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5742 virtual PyObject *positionRelativeToGodFather() const
5744 std::vector<mcIdType> out1;
5745 std::vector< std::pair<mcIdType,mcIdType> > out0(self->positionRelativeToGodFather(out1));
5746 PyObject *ret(PyTuple_New(2));
5747 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5748 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5752 virtual PyObject *retrieveGridsAt(mcIdType absoluteLev) const
5754 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5755 std::size_t sz(ps.size());
5756 PyObject *ret = PyList_New(sz);
5757 for(std::size_t i=0;i<sz;i++)
5758 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5762 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(mcIdType ghostSz, PyObject *recurseArrs) const
5764 std::vector<const DataArrayDouble *> inp;
5765 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5766 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5769 virtual MEDCouplingCartesianAMRMeshGen *getFather() const
5771 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5777 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const
5779 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5785 MEDCouplingCartesianAMRPatch *getPatch(mcIdType patchId) const
5787 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5793 MEDCouplingIMesh *getImageMesh() const
5795 const MEDCouplingIMesh *ret(self->getImageMesh());
5798 return const_cast<MEDCouplingIMesh *>(ret);
5801 MEDCouplingCartesianAMRPatch *__getitem__(mcIdType patchId) const
5803 if(patchId==self->getNumberOfPatches())
5805 std::ostringstream oss;
5806 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5807 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5810 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5816 void fillCellFieldOnPatchGhostAdv(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const
5818 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5819 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5820 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5823 void fillCellFieldOnPatchOnlyGhostAdv(mcIdType patchId, mcIdType ghostLev, PyObject *arrsOnPatches) const
5825 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5826 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5827 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5830 void __delitem__(mcIdType patchId)
5832 self->removePatch(patchId);
5835 mcIdType __len__() const
5837 return self->getNumberOfPatches();
5842 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5846 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5849 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh);
5852 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
5854 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5855 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5856 const mcIdType *nodeStrctPtr(0);
5857 const double *originPtr(0),*dxyzPtr(0);
5858 mcIdType sw,sz,val0;
5859 std::vector<mcIdType> bb0;
5860 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
5863 std::vector<double> bb,bb2;
5865 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5866 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5868 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5871 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps)
5873 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5874 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5875 std::vector< std::vector<mcIdType> > inp2;
5876 convertPyToVectorOfVectorOfInt(factors,inp2);
5877 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5880 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
5882 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5885 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh)
5887 return MEDCouplingCartesianAMRMesh::New(mesh);
5892 class MEDCouplingDataForGodFather : public RefCountObject
5895 virtual void synchronizeFineToCoarse();
5896 virtual void synchronizeFineToCoarseBetween(mcIdType fromLev, mcIdType toLev);
5897 virtual void synchronizeCoarseToFine();
5898 virtual void synchronizeCoarseToFineBetween(mcIdType fromLev, mcIdType toLev);
5899 virtual void synchronizeAllGhostZones();
5900 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh);
5901 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(mcIdType level);
5902 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(mcIdType level);
5903 virtual void alloc();
5904 virtual void dealloc();
5907 MEDCouplingCartesianAMRMesh *getMyGodFather()
5909 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5917 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5920 mcIdType getNumberOfLevels() const;
5921 MEDCouplingAMRAttribute *deepCopy() const;
5922 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const;
5923 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5924 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5925 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5926 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf);
5927 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const;
5928 std::string writeVTHB(const std::string& fileName) const;
5931 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, mcIdType ghostLev)
5933 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5934 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5935 MEDCouplingAMRAttribute *ret(0);
5938 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5939 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5941 catch(INTERP_KERNEL::Exception&)
5943 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5944 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5949 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, mcIdType ghostLev)
5951 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5954 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const
5956 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5957 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5963 void spillInfoOnComponents(PyObject *compNames)
5965 std::vector< std::vector<std::string> > compNamesCpp;
5966 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5967 self->spillInfoOnComponents(compNamesCpp);
5970 void spillNatures(PyObject *nfs)
5972 std::vector<mcIdType> inp0;
5973 if(!fillIntVector(nfs,inp0))
5974 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5975 std::size_t sz(inp0.size());
5976 std::vector<NatureOfField> inp00(sz);
5977 for(std::size_t i=0;i<sz;i++)
5978 inp00[i]=(NatureOfField)inp0[i];
5979 self->spillNatures(inp00);
5982 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const
5984 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5985 std::size_t sz(ret.size());
5986 PyObject *retPy(PyList_New(sz));
5987 for(std::size_t i=0;i<sz;i++)
5988 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5994 class DenseMatrix : public RefCountObject, public TimeLabel
5997 static DenseMatrix *New(mcIdType nbRows, mcIdType nbCols);
5998 static DenseMatrix *New(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols);
5999 DenseMatrix *deepCopy() const;
6000 DenseMatrix *shallowCpy() const;
6002 mcIdType getNumberOfRows() const;
6003 mcIdType getNumberOfCols() const;
6004 mcIdType getNbOfElems() const;
6005 void reBuild(DataArrayDouble *array, mcIdType nbRows=-1, mcIdType nbCols=-1);
6006 void reShape(mcIdType nbRows, mcIdType nbCols);
6009 bool isEqual(const DenseMatrix& other, double eps) const;
6010 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const;
6011 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec);
6014 DenseMatrix(mcIdType nbRows, mcIdType nbCols)
6016 return DenseMatrix::New(nbRows,nbCols);
6019 DenseMatrix(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols)
6021 return DenseMatrix::New(array,nbRows,nbCols);
6024 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const
6027 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
6028 PyObject *ret=PyTuple_New(2);
6029 PyObject *ret0Py=ret0?Py_True:Py_False;
6031 PyTuple_SetItem(ret,0,ret0Py);
6032 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
6036 DataArrayDouble *getData()
6038 DataArrayDouble *ret(self->getData());
6044 DenseMatrix *__add__(const DenseMatrix *other)
6046 return MEDCoupling::DenseMatrix::Add(self,other);
6049 DenseMatrix *__sub__(const DenseMatrix *other)
6051 return MEDCoupling::DenseMatrix::Substract(self,other);
6054 DenseMatrix *__mul__(const DenseMatrix *other)
6056 return MEDCoupling::DenseMatrix::Multiply(self,other);
6059 DenseMatrix *__mul__(const DataArrayDouble *other)
6061 return MEDCoupling::DenseMatrix::Multiply(self,other);
6064 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other)
6066 self->addEqual(other);
6067 Py_XINCREF(trueSelf);
6071 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other)
6073 self->substractEqual(other);
6074 Py_XINCREF(trueSelf);
6078 PyObject *toNumPyMatrix() // not const. It is not a bug !
6080 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
6089 def MEDCouplingUMeshReduce(self):
6090 return MEDCouplingStdReduceFunct,(MEDCouplingUMesh,((),(self.__getstate__()),))
6091 def MEDCouplingCMeshReduce(self):
6092 return MEDCouplingStdReduceFunct,(MEDCouplingCMesh,((),(self.__getstate__()),))
6093 def MEDCouplingIMeshReduce(self):
6094 return MEDCouplingStdReduceFunct,(MEDCouplingIMesh,((),(self.__getstate__()),))
6095 def MEDCouplingMappedExtrudedMeshReduce(self):
6096 return MEDCouplingStdReduceFunct,(MEDCouplingMappedExtrudedMesh,((),(self.__getstate__()),))
6097 def MEDCouplingCurveLinearMeshReduce(self):
6098 return MEDCouplingStdReduceFunct,(MEDCouplingCurveLinearMesh,((),(self.__getstate__()),))
6099 def MEDCoupling1SGTUMeshReduce(self):
6100 return MEDCouplingStdReduceFunct,(MEDCoupling1SGTUMesh,((),(self.__getstate__()),))
6101 def MEDCoupling1DGTUMeshReduce(self):
6102 return MEDCouplingStdReduceFunct,(MEDCoupling1DGTUMesh,((),(self.__getstate__()),))
6103 def MEDCouplingFieldDoubleReduce(self):
6104 self.checkConsistencyLight()
6105 d=(self.getTypeOfField(),self.getTimeDiscretization())
6106 return MEDCouplingStdReduceFunct,(MEDCouplingFieldDouble,(d,(self.__getstate__()),))
6107 def MEDCouplingFieldInt32Reduce(self):
6108 self.checkConsistencyLight()
6109 d=(self.getTypeOfField(),self.getTimeDiscretization())
6110 return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt32,(d,(self.__getstate__()),))
6111 def MEDCouplingFieldInt64Reduce(self):
6112 self.checkConsistencyLight()
6113 d=(self.getTypeOfField(),self.getTimeDiscretization())
6114 return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt64,(d,(self.__getstate__()),))
6115 def MEDCouplingFieldFloatReduce(self):
6116 self.checkConsistencyLight()
6117 d=(self.getTypeOfField(),self.getTimeDiscretization())
6118 return MEDCouplingStdReduceFunct,(MEDCouplingFieldFloat,(d,(self.__getstate__()),))
6119 def MEDCouplingFTReduceFunct(cls,params):
6121 ret=object.__new__(cls)
6125 def MEDCouplingFieldTemplateReduce(self):
6126 ret = MEDCouplingFieldDouble(self)
6127 nbTuples = self.getNumberOfTuplesExpected()
6128 arr = DataArrayDouble(nbTuples) ; arr[:] = 0.
6130 return MEDCouplingFTReduceFunct,(MEDCouplingFieldTemplate,((ret,),()))
6132 # Forwarding DataArrayInt functions to MEDCouplingUMesh:
6134 MEDCouplingUMesh.ExtractFromIndexedArrays = DataArrayInt.ExtractFromIndexedArrays
6135 MEDCouplingUMesh.ExtractFromIndexedArraysSlice = DataArrayInt.ExtractFromIndexedArraysSlice
6136 MEDCouplingUMesh.SetPartOfIndexedArrays = DataArrayInt.SetPartOfIndexedArrays
6137 MEDCouplingUMesh.SetPartOfIndexedArraysSameIdx = DataArrayInt.SetPartOfIndexedArraysSameIdx
6138 MEDCouplingUMesh.RemoveIdsFromIndexedArrays = DataArrayInt.RemoveIdsFromIndexedArrays
6139 MEDCouplingFieldInt = MEDCouplingFieldInt32
6141 if MEDCouplingUse64BitIDs():
6142 MEDCouplingFieldID = MEDCouplingFieldInt64
6144 MEDCouplingFieldID = MEDCouplingFieldInt32
6150 __filename=os.environ.get('PYTHONSTARTUP')
6151 if __filename and os.path.isfile(__filename):
6152 with open(__filename) as __fp: