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 checkGeomConsistency(double eps=1e-12) const;
2052 void setMeshDimension(int meshDim);
2053 void allocateCells(int nbOfCells=0);
2054 void finishInsertingCells();
2055 MEDCouplingUMeshCellByTypeEntry *cellsByType();
2056 void setConnectivity(DataArrayIdType *conn, DataArrayIdType *connIndex, bool isComputingTypes=true);
2057 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
2058 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis);
2059 int getNodalConnectivityArrayLen() const;
2060 void computeTypes();
2061 std::string reprConnectivityOfThis() const;
2062 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const;
2064 DataArrayIdType *conformize2D(double eps);
2065 DataArrayIdType *conformize3D(double eps);
2066 DataArrayIdType *colinearize2D(double eps);
2067 DataArrayIdType *colinearizeKeepingConform2D(double eps);
2068 void shiftNodeNumbersInConn(int delta);
2069 std::vector<bool> getQuadraticStatus() const;
2070 DataArrayIdType *findCellIdsOnBoundary() const;
2071 MEDCouplingUMesh *computeSkin() const;
2072 bool checkConsecutiveCellTypes() const;
2073 bool checkConsecutiveCellTypesForMEDFileFrmt() const;
2074 DataArrayIdType *rearrange2ConsecutiveCellTypes();
2075 DataArrayIdType *sortCellsInMEDFileFrmt();
2076 DataArrayIdType *getRenumArrForMEDFileFrmt() const;
2077 DataArrayIdType *convertCellArrayPerGeoType(const DataArrayIdType *da) const;
2078 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2079 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2080 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2081 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2082 void orientCorrectlyPolyhedrons();
2083 bool isPresenceOfQuadratic() const;
2084 bool isFullyQuadratic() const;
2085 MEDCouplingFieldDouble *buildDirectionVectorField() const;
2086 bool isContiguous1D() const;
2087 void tessellate2D(double eps);
2088 void convertQuadraticCellsToLinear();
2089 DataArrayIdType *convertLinearCellsToQuadratic(int conversionType=0);
2090 void convertDegeneratedCells();
2091 DataArrayIdType *convertDegeneratedCellsAndRemoveFlatOnes();
2092 bool removeDegenerated1DCells();
2093 bool areOnlySimplexCells() const;
2094 MEDCouplingFieldDouble *getEdgeRatioField() const;
2095 MEDCouplingFieldDouble *getAspectRatioField() const;
2096 MEDCouplingFieldDouble *getWarpField() const;
2097 MEDCouplingFieldDouble *getSkewField() const;
2098 DataArrayDouble *computePlaneEquationOf3DFaces() const;
2099 DataArrayIdType *convexEnvelop2D();
2100 std::string cppRepr() const;
2101 DataArrayIdType *findAndCorrectBadOriented3DExtrudedCells();
2102 DataArrayIdType *findAndCorrectBadOriented3DCells();
2103 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const;
2104 MEDCouplingSkyLineArray *generateGraph() const;
2105 DataArrayIdType *convertNodalConnectivityToStaticGeoTypeMesh() const;
2106 DataArrayIdType *buildUnionOf2DMesh() const;
2107 DataArrayIdType *buildUnionOf3DMesh() const;
2108 DataArrayIdType *orderConsecutiveCells1D() const;
2109 DataArrayDouble *getBoundingBoxForBBTreeFast() const;
2110 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const;
2111 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const;
2112 void changeOrientationOfCells();
2113 DataArrayDouble *computeCellCenterOfMassWithPrecision(double eps);
2114 int split2DCells(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *subNodesInSeg, const DataArrayIdType *subNodesInSegI, const DataArrayIdType *midOpt=0, const DataArrayIdType *midOptI=0);
2115 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da);
2116 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
2117 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
2118 static DataArrayIdType *ComputeSpreadZoneGradually(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn);
2119 static DataArrayIdType *ComputeRangesFromTypeDistribution(const std::vector<mcIdType>& code);
2123 return MEDCouplingUMesh::New();
2126 MEDCouplingUMesh(const char *meshName, int meshDim)
2128 return MEDCouplingUMesh::New(meshName,meshDim);
2131 std::string __str__() const
2133 return self->simpleRepr();
2136 std::string __repr__() const
2138 std::ostringstream oss;
2139 self->reprQuickOverview(oss);
2143 MEDCouplingUMeshCellIterator *__iter__()
2145 return self->cellIterator();
2148 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da)
2150 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
2154 PyObject *getAllGeoTypesSorted() const
2156 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
2157 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2158 PyObject *res=PyList_New(result.size());
2159 for(int i=0;iL!=result.end(); i++, iL++)
2160 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2164 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
2168 std::vector<mcIdType> multiVal;
2169 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2170 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2171 mcIdType nbc=self->getNumberOfCells();
2172 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2179 std::ostringstream oss;
2180 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2181 throw INTERP_KERNEL::Exception(oss.str().c_str());
2185 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2192 mcIdType tmp=nbc+singleVal;
2193 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2198 std::ostringstream oss;
2199 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2200 throw INTERP_KERNEL::Exception(oss.str().c_str());
2206 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2212 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2213 daIntTyypp->checkAllocated();
2214 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2218 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayIdType instance !");
2222 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
2226 std::vector<mcIdType> multiVal;
2227 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2228 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2229 mcIdType nbc=self->getNumberOfCells();
2230 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2237 std::ostringstream oss;
2238 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2239 throw INTERP_KERNEL::Exception(oss.str().c_str());
2243 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2250 mcIdType tmp=nbc+singleVal;
2251 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2256 std::ostringstream oss;
2257 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2258 throw INTERP_KERNEL::Exception(oss.str().c_str());
2264 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2269 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2275 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2276 daIntTyypp->checkAllocated();
2277 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2281 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayIdType instance !");
2285 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, mcIdType size, PyObject *li)
2287 mcIdType szArr,sw,iTypppArr;
2288 std::vector<mcIdType> stdvecTyyppArr;
2289 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2292 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2293 throw INTERP_KERNEL::Exception(oss.str().c_str());
2295 self->insertNextCell(type,size,tmp);
2298 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li)
2300 mcIdType szArr,sw,iTypppArr;
2301 std::vector<mcIdType> stdvecTyyppArr;
2302 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2303 self->insertNextCell(type,szArr,tmp);
2306 DataArrayIdType *getNodalConnectivity()
2308 DataArrayIdType *ret=self->getNodalConnectivity();
2313 DataArrayIdType *getNodalConnectivityIndex()
2315 DataArrayIdType *ret=self->getNodalConnectivityIndex();
2321 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn, mcIdType nbOfDepthPeeling=-1)
2323 mcIdType szArr,sw,iTypppArr;
2324 std::vector<mcIdType> stdvecTyyppArr;
2325 const mcIdType *seedPtr=convertIntStarLikePyObjToCppIntStar(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2326 mcIdType nbOfDepthPeelingPerformed=0;
2327 DataArrayIdType *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2328 PyObject *res=PyTuple_New(2);
2329 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2330 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2334 static PyObject *FindCommonCellsAlg(int compType, mcIdType startCellId, const DataArrayIdType *nodal, const DataArrayIdType *nodalI, const DataArrayIdType *revNodal, const DataArrayIdType *revNodalI)
2336 DataArrayIdType *v0=0,*v1=0;
2337 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2338 PyObject *res = PyList_New(2);
2339 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2340 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2344 PyObject *distanceToPoint(PyObject *point) const
2348 DataArrayDoubleTuple *aa;
2349 std::vector<double> bb;
2351 int nbOfCompo=self->getSpaceDimension();
2352 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2355 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2356 PyObject *ret=PyTuple_New(2);
2357 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2358 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2362 PyObject *distanceToPoints(const DataArrayDouble *pts) const
2364 DataArrayIdType *ret1=0;
2365 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2366 PyObject *ret=PyTuple_New(2);
2367 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2368 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2372 PyObject *tetrahedrize(int policy)
2375 DataArrayIdType *ret1(0);
2376 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2377 PyObject *ret=PyTuple_New(3);
2378 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2379 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2380 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2384 PyObject *checkButterflyCells(double eps=1e-12)
2386 std::vector<mcIdType> cells;
2387 self->checkButterflyCells(cells,eps);
2388 DataArrayIdType *ret=DataArrayIdType::New();
2389 ret->alloc(cells.size(),1);
2390 std::copy(cells.begin(),cells.end(),ret->getPointer());
2391 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2394 PyObject *splitByType() const
2396 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2397 std::size_t sz=ms.size();
2398 PyObject *ret = PyList_New(sz);
2399 for(std::size_t i=0;i<sz;i++)
2400 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2404 PyObject *partitionBySpreadZone() const
2406 std::vector<DataArrayIdType *> retCpp=self->partitionBySpreadZone();
2407 std::size_t sz=retCpp.size();
2408 PyObject *ret=PyList_New(sz);
2409 for(std::size_t i=0;i<sz;i++)
2410 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2414 static PyObject *PartitionBySpreadZone(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn)
2416 std::vector<DataArrayIdType *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2417 std::size_t sz=retCpp.size();
2418 PyObject *ret=PyList_New(sz);
2419 for(std::size_t i=0;i<sz;i++)
2420 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2424 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const
2427 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(ids,&size);
2428 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2429 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2432 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const
2435 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2436 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2440 DataArrayIdType *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const
2443 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2444 DataArrayIdType *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2448 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
2450 DataArrayIdType *tmp0=0,*tmp1=0,*tmp2=0;
2451 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2452 PyObject *ret=PyTuple_New(3);
2453 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2454 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2455 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2459 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
2461 DataArrayIdType *tmp0=0,*tmp1=0;
2462 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2463 PyObject *ret=PyTuple_New(2);
2464 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2465 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2469 void duplicateNodes(PyObject *li)
2473 std::vector<mcIdType> multiVal;
2474 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2475 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2476 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2480 return self->duplicateNodes(&singleVal,&singleVal+1);
2482 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2484 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2486 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
2490 void duplicateNodesInConn(PyObject *li, mcIdType offset)
2494 std::vector<mcIdType> multiVal;
2495 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2496 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2497 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2501 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2503 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2505 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2507 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
2511 void attractSeg3MidPtsAroundNodes(double ratio, PyObject *nodeIds)
2513 mcIdType szArr,sw,iTypppArr;
2514 std::vector<mcIdType> stdvecTyyppArr;
2515 const mcIdType *nodeIdsPtr(convertIntStarLikePyObjToCppIntStar(nodeIds,sw,szArr,iTypppArr,stdvecTyyppArr));
2516 self->attractSeg3MidPtsAroundNodes(ratio,nodeIdsPtr,nodeIdsPtr+szArr);
2519 PyObject *getLevArrPerCellTypes(PyObject *li) const
2522 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2523 DataArrayIdType *tmp0,*tmp1=0;
2524 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2525 PyObject *ret=PyTuple_New(2);
2526 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2527 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2531 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const
2533 DataArrayIdType *ret0=0,*ret1=0;
2534 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2535 PyObject *ret=PyTuple_New(2);
2536 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2537 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2541 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms)
2543 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2544 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2545 DataArrayIdType *ret1=0,*ret2=0;
2546 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2547 PyObject *ret=PyTuple_New(3);
2548 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2549 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2550 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2554 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms)
2556 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2557 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2558 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2559 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2562 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType)
2565 std::vector<const MEDCouplingUMesh *> meshes;
2566 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2567 std::vector<DataArrayIdType *> corr;
2568 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2570 PyObject *ret1=PyList_New(sz);
2571 for(std::size_t i=0;i<sz;i++)
2572 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2573 PyObject *ret=PyList_New(2);
2574 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2575 PyList_SetItem(ret,1,ret1);
2579 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms)
2581 std::vector<MEDCouplingUMesh *> meshes;
2582 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2583 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2586 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps)
2588 std::vector<MEDCouplingUMesh *> meshes;
2589 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2590 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2593 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const
2597 DataArrayDoubleTuple *aa;
2598 std::vector<double> bb;
2600 int spaceDim=self->getSpaceDimension();
2601 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2602 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2604 std::vector<mcIdType> cells;
2605 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2606 DataArrayIdType *ret=DataArrayIdType::New();
2607 ret->alloc(cells.size(),1);
2608 std::copy(cells.begin(),cells.end(),ret->getPointer());
2609 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2612 void orientCorrectly2DCells(PyObject *vec, bool polyOnly)
2616 DataArrayDoubleTuple *aa;
2617 std::vector<double> bb;
2619 int spaceDim=self->getSpaceDimension();
2620 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2621 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2622 self->orientCorrectly2DCells(v,polyOnly);
2625 PyObject *arePolyhedronsNotCorrectlyOriented() const
2627 std::vector<mcIdType> cells;
2628 self->arePolyhedronsNotCorrectlyOriented(cells);
2629 DataArrayIdType *ret=DataArrayIdType::New();
2630 ret->alloc(cells.size(),1);
2631 std::copy(cells.begin(),cells.end(),ret->getPointer());
2632 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2635 PyObject *getFastAveragePlaneOfThis() const
2639 self->getFastAveragePlaneOfThis(vec,pos);
2641 std::copy(vec,vec+3,vals);
2642 std::copy(pos,pos+3,vals+3);
2643 return convertDblArrToPyListOfTuple<double>(vals,3,2);
2646 static MEDCouplingUMesh *MergeUMeshes(PyObject *li)
2648 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2649 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2650 return MEDCouplingUMesh::MergeUMeshes(tmp);
2653 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const
2655 DataArrayIdType *ret1;
2656 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2657 PyObject *ret=PyTuple_New(2);
2658 PyObject *ret0Py=ret0?Py_True:Py_False;
2660 PyTuple_SetItem(ret,0,ret0Py);
2661 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2665 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const
2667 DataArrayIdType *ret1;
2668 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2669 PyObject *ret=PyTuple_New(2);
2670 PyObject *ret0Py=ret0?Py_True:Py_False;
2672 PyTuple_SetItem(ret,0,ret0Py);
2673 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2677 PyObject *explode3DMeshTo1D() const
2679 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2680 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2681 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2682 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2683 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2684 PyObject *ret=PyTuple_New(5);
2685 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2686 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2687 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2688 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2689 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2693 PyObject *explodeIntoEdges() const
2695 MCAuto<DataArrayIdType> desc,descIndex,revDesc,revDescIndx;
2696 MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2697 PyObject *ret=PyTuple_New(5);
2698 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2699 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2700 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2701 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2702 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2706 PyObject *explodeMeshIntoMicroEdges() const
2708 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2709 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2710 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2711 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2712 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2713 PyObject *ret=PyTuple_New(5);
2714 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2715 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2716 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2717 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2718 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2722 PyObject *buildDescendingConnectivity() const
2724 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2725 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2726 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2727 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2728 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2729 PyObject *ret=PyTuple_New(5);
2730 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2731 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2732 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2733 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2734 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2738 PyObject *buildDescendingConnectivity2() const
2740 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2741 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2742 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2743 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2744 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2745 PyObject *ret=PyTuple_New(5);
2746 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2747 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2748 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2749 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2750 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2754 PyObject *computeNeighborsOfCells() const
2756 DataArrayIdType *neighbors=0,*neighborsIdx=0;
2757 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2758 PyObject *ret=PyTuple_New(2);
2759 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2760 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2764 PyObject *computeNeighborsOfNodes() const
2766 DataArrayIdType *neighbors=0,*neighborsIdx=0;
2767 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2768 PyObject *ret=PyTuple_New(2);
2769 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2770 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2774 PyObject *computeEnlargedNeighborsOfNodes() const
2776 MCAuto<DataArrayIdType> neighbors,neighborsIdx;
2777 self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2778 PyObject *ret=PyTuple_New(2);
2779 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2780 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2784 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayIdType *nodeNeigh, const DataArrayIdType *nodeNeighI) const
2786 MCAuto<DataArrayIdType> cellNeigh,cellNeighIndex;
2787 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2788 PyObject *ret=PyTuple_New(2);
2789 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2790 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2794 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *revDesc, const DataArrayIdType *revDescI)
2796 DataArrayIdType *neighbors=0,*neighborsIdx=0;
2797 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2798 PyObject *ret=PyTuple_New(2);
2799 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2800 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2804 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2806 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2807 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2808 DataArrayIdType *d2,*d3,*d4,*dd5;
2809 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2810 PyObject *ret=PyTuple_New(7);
2811 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2812 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2813 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2814 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2815 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2816 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2817 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2821 DataArrayDouble *getPartBarycenterAndOwner(DataArrayIdType *da) const
2824 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2825 da->checkAllocated();
2826 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2829 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayIdType *da) const
2832 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2833 da->checkAllocated();
2834 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2837 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayIdType *da) const
2840 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2841 da->checkAllocated();
2842 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2845 PyObject *getTypesOfPart(DataArrayIdType *da) const
2848 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2849 da->checkAllocated();
2850 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2851 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2852 PyObject *res = PyList_New(result.size());
2853 for (int i=0;iL!=result.end(); i++, iL++)
2854 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2858 DataArrayIdType *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayIdType *da) const
2861 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2862 da->checkAllocated();
2863 DataArrayIdType *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2864 ret->setName(da->getName().c_str());
2868 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps)
2870 DataArrayIdType *cellNb1=0,*cellNb2=0;
2871 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2872 PyObject *ret=PyTuple_New(3);
2873 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2874 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2875 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2879 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps)
2881 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2882 DataArrayIdType *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2883 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2884 PyObject *ret(PyTuple_New(4));
2885 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2886 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2887 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2888 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2892 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const
2894 int spaceDim=self->getSpaceDimension();
2896 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2898 DataArrayDouble *a,*a2;
2899 DataArrayDoubleTuple *aa,*aa2;
2900 std::vector<double> bb,bb2;
2902 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st parameter for origin.";
2903 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd parameter for vector.";
2904 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2905 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2907 DataArrayIdType *cellIds=0;
2908 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2909 PyObject *ret=PyTuple_New(2);
2910 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2911 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2915 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const
2917 int spaceDim=self->getSpaceDimension();
2919 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2921 DataArrayDouble *a,*a2;
2922 DataArrayDoubleTuple *aa,*aa2;
2923 std::vector<double> bb,bb2;
2925 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st parameter for origin.";
2926 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd parameter for vector.";
2927 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2928 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2930 DataArrayIdType *cellIds=0;
2931 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2932 PyObject *ret=PyTuple_New(2);
2933 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2934 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2938 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const
2941 DataArrayDouble *a,*a2;
2942 DataArrayDoubleTuple *aa,*aa2;
2943 std::vector<double> bb,bb2;
2945 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st parameter for origin.";
2946 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd parameter for vector.";
2947 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2948 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2949 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2953 DataArrayIdType *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const
2955 int spaceDim=self->getSpaceDimension();
2957 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2959 DataArrayDouble *a,*a2;
2960 DataArrayDoubleTuple *aa,*aa2;
2961 std::vector<double> bb,bb2;
2963 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st parameter for origin.";
2964 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd parameter for vector.";
2965 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2966 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2967 return self->getCellIdsCrossingPlane(orig,vect,eps);
2970 void convertToPolyTypes(PyObject *li)
2974 std::vector<mcIdType> pos2;
2975 DataArrayIdType *pos3=0;
2976 DataArrayIdTypeTuple *pos4=0;
2977 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2982 self->convertToPolyTypes(&pos1,&pos1+1);
2989 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2994 self->convertToPolyTypes(pos3->begin(),pos3->end());
2998 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
3002 void convertAllToPoly();
3003 void convertExtrudedPolyhedra();
3005 void simplifyPolyhedra(double eps);
3006 MEDCouplingUMesh *buildSpreadZonesWithPoly() const;
3007 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy);
3010 //== MEDCouplingUMesh End
3012 //== MEDCouplingMappedExtrudedMesh
3014 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
3017 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
3018 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D);
3019 MEDCouplingUMesh *build3DUnstructuredMesh() const;
3020 int get2DCellIdForExtrusion() const;
3022 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, mcIdType cell2DId)
3024 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3027 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D)
3029 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3032 MEDCouplingMappedExtrudedMesh()
3034 return MEDCouplingMappedExtrudedMesh::New();
3037 std::string __str__() const
3039 return self->simpleRepr();
3042 std::string __repr__() const
3044 std::ostringstream oss;
3045 self->reprQuickOverview(oss);
3049 PyObject *getMesh2D() const
3051 MEDCouplingUMesh *ret=self->getMesh2D();
3054 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3056 PyObject *getMesh1D() const
3058 MEDCouplingUMesh *ret=self->getMesh1D();
3061 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3063 PyObject *getMesh3DIds() const
3065 DataArrayIdType *ret=self->getMesh3DIds();
3068 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
3073 //== MEDCouplingMappedExtrudedMesh End
3075 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3078 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3079 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m);
3080 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const;
3081 int getNodalConnectivityLength() const;
3082 virtual void allocateCells(int nbOfCells=0);
3083 virtual void checkConsistencyOfConnectivity() const;
3086 virtual void insertNextCell(PyObject *li)
3088 mcIdType szArr,sw,iTypppArr;
3089 std::vector<mcIdType> stdvecTyyppArr;
3090 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3091 self->insertNextCell(tmp,tmp+szArr);
3094 virtual DataArrayIdType *getNodalConnectivity() const
3096 DataArrayIdType *ret=self->getNodalConnectivity();
3097 if(ret) ret->incrRef();
3101 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li)
3103 std::vector< const MEDCoupling1GTUMesh *> parts;
3104 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3105 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3110 //== MEDCoupling1SGTUMesh
3112 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3115 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3116 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m);
3117 void setNodalConnectivity(DataArrayIdType *nodalConn);
3118 int getNumberOfNodesPerCell() const;
3119 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2);
3120 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
3121 MEDCoupling1GTUMesh *computeDualMesh() const;
3122 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const;
3123 DataArrayIdType *sortHexa8EachOther();
3126 MEDCoupling1SGTUMesh()
3128 return MEDCoupling1SGTUMesh::New();
3131 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
3133 return MEDCoupling1SGTUMesh::New(name,type);
3136 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m)
3138 return MEDCoupling1SGTUMesh::New(m);
3141 std::string __str__() const
3143 return self->simpleRepr();
3146 std::string __repr__() const
3148 std::ostringstream oss;
3149 self->reprQuickOverview(oss);
3153 PyObject *structurizeMe(double eps=1e-12) const
3155 DataArrayIdType *cellPerm(0),*nodePerm(0);
3156 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3157 PyObject *ret(PyTuple_New(3));
3158 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3159 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3160 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3164 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li)
3166 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3167 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3168 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3171 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li)
3173 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3174 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3175 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3180 //== MEDCoupling1SGTUMesh End
3182 //== MEDCoupling1DGTUMesh
3184 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3187 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3188 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m);
3189 void setNodalConnectivity(DataArrayIdType *nodalConn, DataArrayIdType *nodalConnIndex);
3190 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
3191 bool isPacked() const;
3194 MEDCoupling1DGTUMesh()
3196 return MEDCoupling1DGTUMesh::New();
3198 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
3200 return MEDCoupling1DGTUMesh::New(name,type);
3203 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m)
3205 return MEDCoupling1DGTUMesh::New(m);
3208 std::string __str__() const
3210 return self->simpleRepr();
3213 std::string __repr__() const
3215 std::ostringstream oss;
3216 self->reprQuickOverview(oss);
3220 DataArrayIdType *getNodalConnectivityIndex() const
3222 DataArrayIdType *ret=self->getNodalConnectivityIndex();
3223 if(ret) ret->incrRef();
3227 PyObject *retrievePackedNodalConnectivity() const
3229 DataArrayIdType *ret1=0,*ret2=0;
3230 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3231 PyObject *ret0Py=ret0?Py_True:Py_False;
3233 PyObject *ret=PyTuple_New(3);
3234 PyTuple_SetItem(ret,0,ret0Py);
3235 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3236 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3240 PyObject *copyWithNodalConnectivityPacked() const
3243 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3244 PyObject *ret=PyTuple_New(2);
3245 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3246 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3247 PyTuple_SetItem(ret,1,ret1Py);
3251 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li)
3253 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3254 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3255 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3258 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li)
3260 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3261 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3262 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3265 static DataArrayIdType *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<mcIdType>& offsetInNodeIdsPerElt)
3267 std::vector<const MEDCoupling::DataArrayIdType *> tmp;
3268 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",tmp);
3269 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3274 //== MEDCoupling1DGTUMeshEnd
3276 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3279 mcIdType getCellIdFromPos(mcIdType i, mcIdType j, mcIdType k) const;
3280 mcIdType getNodeIdFromPos(mcIdType i, mcIdType j, mcIdType k) const;
3281 mcIdType getNumberOfCellsOfSubLevelMesh() const;
3282 int getSpaceDimensionOnNodeStruct() const;
3283 double computeSquareness() const;
3284 virtual std::vector<mcIdType> getNodeGridStructure() const;
3285 std::vector<mcIdType> getCellGridStructure() const;
3286 MEDCoupling1SGTUMesh *build1SGTUnstructured() const;
3287 std::vector<mcIdType> getLocationFromCellId(mcIdType cellId) const;
3288 std::vector<mcIdType> getLocationFromNodeId(mcIdType cellId) const;
3289 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim);
3290 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const;
3291 static mcIdType DeduceNumberOfGivenStructure(const std::vector<mcIdType>& st);
3292 static DataArrayIdType *ComputeCornersGhost(const std::vector<mcIdType>& st, mcIdType ghostLev);
3293 static std::vector<mcIdType> GetSplitVectFromStruct(const std::vector<mcIdType>& strct);
3296 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const
3298 mcIdType tmpp1=-1,tmpp2=-1;
3299 std::vector<mcIdType> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3300 std::vector< std::pair<mcIdType,mcIdType> > inp;
3304 for(mcIdType i=0;i<tmpp1;i++)
3305 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3310 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3311 inp.resize(tmpp1/2);
3312 for(mcIdType i=0;i<tmpp1/2;i++)
3313 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3316 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3317 return self->buildStructuredSubPart(inp);
3320 static DataArrayIdType *BuildExplicitIdsFrom(PyObject *st, PyObject *part)
3322 std::vector< std::pair<mcIdType,mcIdType> > inp;
3323 convertPyToVectorPairInt(part,inp);
3325 mcIdType szArr,sw,iTypppArr;
3326 std::vector<mcIdType> stdvecTyyppArr;
3327 const mcIdType *tmp4=convertIntStarLikePyObjToCppIntStar(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3328 std::vector<mcIdType> tmp5(tmp4,tmp4+szArr);
3330 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3333 static void MultiplyPartOf(const std::vector<mcIdType>& st, PyObject *part, double factor, DataArrayDouble *da)
3335 std::vector< std::pair<mcIdType,mcIdType> > inp;
3336 convertPyToVectorPairInt(part,inp);
3337 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3340 static void MultiplyPartOfByGhost(const std::vector<mcIdType>& st, PyObject *part, mcIdType ghostSize, double factor, DataArrayDouble *da)
3342 std::vector< std::pair<mcIdType,mcIdType> > inp;
3343 convertPyToVectorPairInt(part,inp);
3344 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3347 static PyObject *PutInGhostFormat(mcIdType ghostSize, const std::vector<mcIdType>& st, PyObject *part)
3349 std::vector< std::pair<mcIdType,mcIdType> > inp;
3350 convertPyToVectorPairInt(part,inp);
3351 std::vector<mcIdType> stWithGhost;
3352 std::vector< std::pair<mcIdType,mcIdType> > partWithGhost;
3353 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3354 PyObject *ret(PyTuple_New(2));
3355 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3356 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3360 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<mcIdType>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat)
3362 std::vector< std::pair<mcIdType,mcIdType> > inp;
3363 convertPyToVectorPairInt(partCompactFormat,inp);
3364 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3367 static void AssignPartOfFieldOfDoubleUsing(const std::vector<mcIdType>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other)
3369 std::vector< std::pair<mcIdType,mcIdType> > inp;
3370 convertPyToVectorPairInt(partCompactFormat,inp);
3371 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3374 static mcIdType DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part)
3376 std::vector< std::pair<mcIdType,mcIdType> > inp;
3377 convertPyToVectorPairInt(part,inp);
3378 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3381 static DataArrayIdType *Build1GTNodalConnectivity(PyObject *li)
3383 mcIdType szArr,sw,iTypppArr;
3384 std::vector<mcIdType> stdvecTyyppArr;
3385 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3386 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3389 static DataArrayIdType *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li)
3391 mcIdType szArr,sw,iTypppArr;
3392 std::vector<mcIdType> stdvecTyyppArr;
3393 const mcIdType *tmp(convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3394 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3397 static std::vector<mcIdType> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat)
3399 std::vector< std::pair<mcIdType,mcIdType> > inp;
3400 convertPyToVectorPairInt(partCompactFormat,inp);
3401 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3404 static PyObject *GetCompactFrmtFromDimensions(const std::vector<mcIdType>& dims)
3406 std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3407 PyObject *retPy=PyList_New(ret.size());
3408 for(std::size_t i=0;i<ret.size();i++)
3410 PyObject *tmp=PyTuple_New(2);
3411 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3412 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3413 PyList_SetItem(retPy,i,tmp);
3418 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2)
3420 std::vector< std::pair<mcIdType,mcIdType> > r1Cpp,r2Cpp;
3421 convertPyToVectorPairInt(r1,r1Cpp);
3422 convertPyToVectorPairInt(r2,r2Cpp);
3423 std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3424 PyObject *retPy=PyList_New(ret.size());
3425 for(std::size_t i=0;i<ret.size();i++)
3427 PyObject *tmp=PyTuple_New(2);
3428 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3429 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3430 PyList_SetItem(retPy,i,tmp);
3435 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3437 std::vector< std::pair<mcIdType,mcIdType> > r1Cpp,r2Cpp;
3438 convertPyToVectorPairInt(r1,r1Cpp);
3439 convertPyToVectorPairInt(r2,r2Cpp);
3440 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3443 static PyObject *IsPartStructured(PyObject *li, PyObject *st)
3445 mcIdType szArr,sw,iTypppArr;
3446 std::vector<mcIdType> stdvecTyyppArr;
3447 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3448 mcIdType szArr2,sw2,iTypppArr2;
3449 std::vector<mcIdType> stdvecTyyppArr2;
3450 const mcIdType *tmp2=convertIntStarLikePyObjToCppIntStar(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3451 std::vector<mcIdType> tmp3(tmp2,tmp2+szArr2);
3452 std::vector< std::pair<mcIdType,mcIdType> > partCompactFormat;
3453 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3454 PyObject *ret=PyTuple_New(2);
3455 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3456 PyTuple_SetItem(ret,0,ret0Py);
3457 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3458 for(std::size_t i=0;i<partCompactFormat.size();i++)
3460 PyObject *tmp4=PyTuple_New(2);
3461 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3462 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3463 PyList_SetItem(ret1Py,i,tmp4);
3465 PyTuple_SetItem(ret,1,ret1Py);
3469 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true)
3471 std::vector< std::pair<mcIdType,mcIdType> > param0,param1,ret;
3472 convertPyToVectorPairInt(bigInAbs,param0);
3473 convertPyToVectorPairInt(partOfBigInAbs,param1);
3474 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3475 PyObject *retPy(PyList_New(ret.size()));
3476 for(std::size_t i=0;i<ret.size();i++)
3478 PyObject *tmp(PyTuple_New(2));
3479 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3480 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3481 PyList_SetItem(retPy,i,tmp);
3486 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<mcIdType>& translation)
3488 std::vector< std::pair<mcIdType,mcIdType> > param0;
3489 convertPyToVectorPairInt(part,param0);
3490 std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3491 PyObject *retPy(PyList_New(ret.size()));
3492 for(std::size_t i=0;i<ret.size();i++)
3494 PyObject *tmp(PyTuple_New(2));
3495 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3496 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3497 PyList_SetItem(retPy,i,tmp);
3502 static std::vector<mcIdType> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo)
3504 std::vector< std::pair<mcIdType,mcIdType> > param0,param1;
3505 convertPyToVectorPairInt(startingFrom,param0);
3506 convertPyToVectorPairInt(goingTo,param1);
3507 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3510 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true)
3512 std::vector< std::pair<mcIdType,mcIdType> > param0,param1,ret;
3513 convertPyToVectorPairInt(bigInAbs,param0);
3514 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3515 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3516 PyObject *retPy(PyList_New(ret.size()));
3517 for(std::size_t i=0;i<ret.size();i++)
3519 PyObject *tmp(PyTuple_New(2));
3520 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3521 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3522 PyList_SetItem(retPy,i,tmp);
3529 class MEDCouplingCurveLinearMesh;
3531 //== MEDCouplingCMesh
3533 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3536 static MEDCouplingCMesh *New();
3537 static MEDCouplingCMesh *New(const std::string& meshName);
3538 void setCoords(const DataArrayDouble *coordsX,
3539 const DataArrayDouble *coordsY=0,
3540 const DataArrayDouble *coordsZ=0);
3541 void setCoordsAt(int i, const DataArrayDouble *arr);
3542 MEDCouplingCurveLinearMesh *buildCurveLinear() const;
3546 return MEDCouplingCMesh::New();
3548 MEDCouplingCMesh(const std::string& meshName)
3550 return MEDCouplingCMesh::New(meshName);
3552 std::string __str__() const
3554 return self->simpleRepr();
3556 std::string __repr__() const
3558 std::ostringstream oss;
3559 self->reprQuickOverview(oss);
3562 DataArrayDouble *getCoordsAt(int i)
3564 DataArrayDouble *ret=self->getCoordsAt(i);
3572 //== MEDCouplingCMesh End
3574 //== MEDCouplingCurveLinearMesh
3576 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3579 static MEDCouplingCurveLinearMesh *New();
3580 static MEDCouplingCurveLinearMesh *New(const std::string& meshName);
3581 void setCoords(const DataArrayDouble *coords);
3583 MEDCouplingCurveLinearMesh()
3585 return MEDCouplingCurveLinearMesh::New();
3587 MEDCouplingCurveLinearMesh(const std::string& meshName)
3589 return MEDCouplingCurveLinearMesh::New(meshName);
3591 std::string __str__() const
3593 return self->simpleRepr();
3595 std::string __repr__() const
3597 std::ostringstream oss;
3598 self->reprQuickOverview(oss);
3601 DataArrayDouble *getCoords()
3603 DataArrayDouble *ret=self->getCoords();
3608 void setNodeGridStructure(PyObject *gridStruct)
3610 mcIdType szArr,sw,iTypppArr;
3611 std::vector<mcIdType> stdvecTyyppArr;
3612 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3613 self->setNodeGridStructure(tmp,tmp+szArr);
3618 //== MEDCouplingCurveLinearMesh End
3620 //== MEDCouplingIMesh
3622 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3625 static MEDCouplingIMesh *New();
3627 void setSpaceDimension(int spaceDim);
3628 std::vector<mcIdType> getNodeStruct() const;
3629 std::vector<double> getOrigin() const;
3630 std::vector<double> getDXYZ() const;
3631 void setAxisUnit(const std::string& unitName);
3632 std::string getAxisUnit() const;
3633 double getMeasureOfAnyCell() const;
3634 MEDCouplingCMesh *convertToCartesian() const;
3635 void refineWithFactor(const std::vector<mcIdType>& factors);
3636 MEDCouplingIMesh *asSingleCell() const;
3637 MEDCouplingIMesh *buildWithGhost(mcIdType ghostLev) const;
3642 return MEDCouplingIMesh::New();
3644 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
3646 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3647 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3648 const mcIdType *nodeStrctPtr(0);
3649 const double *originPtr(0),*dxyzPtr(0);
3650 mcIdType sw,sz,val0;
3651 std::vector<mcIdType> bb0;
3652 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
3655 std::vector<double> bb,bb2;
3657 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3658 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3660 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3663 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
3665 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3668 void setNodeStruct(PyObject *nodeStrct)
3670 mcIdType sw,sz,val0;
3671 std::vector<mcIdType> bb0;
3672 const mcIdType *nodeStrctPtr(convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0));
3673 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3676 void setOrigin(PyObject *origin)
3678 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3680 std::vector<double> bb;
3681 mcIdType sw,nbTuples;
3682 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3683 self->setOrigin(originPtr,originPtr+nbTuples);
3686 void setDXYZ(PyObject *dxyz)
3688 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3690 std::vector<double> bb;
3691 mcIdType sw,nbTuples;
3692 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3693 self->setDXYZ(originPtr,originPtr+nbTuples);
3696 static void CondenseFineToCoarse(const std::vector<mcIdType>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, DataArrayDouble *coarseDA)
3698 std::vector< std::pair<mcIdType,mcIdType> > inp;
3699 convertPyToVectorPairInt(fineLocInCoarse,inp);
3700 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3703 static void CondenseFineToCoarseGhost(const std::vector<mcIdType>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, DataArrayDouble *coarseDA, mcIdType ghostSize)
3705 std::vector< std::pair<mcIdType,mcIdType> > inp;
3706 convertPyToVectorPairInt(fineLocInCoarse,inp);
3707 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3710 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts)
3712 std::vector< std::pair<mcIdType,mcIdType> > inp;
3713 convertPyToVectorPairInt(fineLocInCoarse,inp);
3714 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3717 static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, mcIdType ghostSize)
3719 std::vector< std::pair<mcIdType,mcIdType> > inp;
3720 convertPyToVectorPairInt(fineLocInCoarse,inp);
3721 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3724 static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, mcIdType ghostSize)
3726 std::vector< std::pair<mcIdType,mcIdType> > inp;
3727 convertPyToVectorPairInt(fineLocInCoarse,inp);
3728 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3731 std::string __str__() const
3733 return self->simpleRepr();
3735 std::string __repr__() const
3737 std::ostringstream oss;
3738 self->reprQuickOverview(oss);
3744 //== MEDCouplingIMesh End
3748 namespace MEDCoupling
3750 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3753 virtual void checkConsistencyLight() const;
3754 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const;
3755 bool areStrictlyCompatible(const MEDCouplingField *other) const;
3756 bool areStrictlyCompatibleForMulDiv(const MEDCouplingField *other) const;
3757 virtual void copyTinyStringsFrom(const MEDCouplingField *other);
3758 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh);
3759 void setName(const char *name);
3760 std::string getDescription() const;
3761 void setDescription(const char *desc);
3762 std::string getName() const;
3763 TypeOfField getTypeOfField() const;
3764 NatureOfField getNature() const;
3765 virtual void setNature(NatureOfField nat);
3766 DataArrayDouble *getLocalizationOfDiscr() const;
3767 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const;
3768 mcIdType getNumberOfTuplesExpected() const;
3769 mcIdType getNumberOfMeshPlacesExpected() const;
3770 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3771 const std::vector<double>& gsCoo, const std::vector<double>& wg);
3772 void clearGaussLocalizations();
3773 MEDCouplingGaussLocalization& getGaussLocalization(int locId);
3774 mcIdType getNbOfGaussLocalization() const;
3775 mcIdType getGaussLocalizationIdOfOneCell(mcIdType cellId) const;
3776 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const;
3777 mcIdType getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const;
3778 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3780 PyObject *getMesh() const
3782 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3785 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3788 PyObject *getDiscretization()
3790 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3793 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3796 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const
3798 std::set<mcIdType> ret=self->getGaussLocalizationIdsOfOneType(type);
3799 return convertIntArrToPyList3(ret);
3802 PyObject *buildSubMeshData(PyObject *li) const
3804 DataArrayIdType *ret1=0;
3805 MEDCouplingMesh *ret0=0;
3807 int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
3808 if (!SWIG_IsOK(res1))
3811 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
3812 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3816 DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
3818 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
3819 da2->checkAllocated();
3820 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3822 PyObject *res = PyList_New(2);
3823 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3824 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
3828 PyObject *buildSubMeshDataRange(mcIdType begin, mcIdType end, mcIdType step) const
3830 DataArrayIdType *ret1=0;
3832 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3833 PyObject *res=PyTuple_New(2);
3834 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3836 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
3839 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3840 PyTuple_SetItem(res,1,res1);
3845 DataArrayIdType *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3848 mcIdType v0; std::vector<mcIdType> v1;
3849 const mcIdType *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
3850 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3853 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3854 const std::vector<double>& gsCoo, const std::vector<double>& wg)
3857 int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
3858 if (!SWIG_IsOK(res1))
3861 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
3862 self->setGaussLocalizationOnCells(tmp,((mcIdType *)tmp)+size,refCoo,gsCoo,wg);
3866 DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
3868 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
3869 da2->checkAllocated();
3870 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3874 PyObject *getCellIdsHavingGaussLocalization(int locId) const
3876 std::vector<mcIdType> tmp;
3877 self->getCellIdsHavingGaussLocalization(locId,tmp);
3878 DataArrayIdType *ret=DataArrayIdType::New();
3879 ret->alloc((mcIdType)tmp.size(),1);
3880 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3881 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
3884 mcIdType getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const
3886 std::vector<mcIdType> inp0;
3887 convertPyToNewIntArr4(code,1,3,inp0);
3888 std::vector<const DataArrayIdType *> inp1;
3889 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(idsPerType,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",inp1);
3890 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3895 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3898 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f);
3899 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f);
3900 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt32& f);
3901 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt64& f);
3902 static MEDCouplingFieldTemplate *New(TypeOfField type);
3903 std::string simpleRepr() const;
3904 std::string advancedRepr() const;
3905 bool isEqual(const MEDCouplingFieldTemplate *other, double meshPrec) const;
3906 bool isEqualWithoutConsideringStr(const MEDCouplingFieldTemplate *other, double meshPrec) const;
3909 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f)
3911 return MEDCouplingFieldTemplate::New(f);
3914 MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f)
3916 return MEDCouplingFieldTemplate::New(f);
3919 MEDCouplingFieldTemplate(const MEDCouplingFieldInt32& f)
3921 return MEDCouplingFieldTemplate::New(f);
3924 MEDCouplingFieldTemplate(const MEDCouplingFieldInt64& f)
3926 return MEDCouplingFieldTemplate::New(f);
3929 MEDCouplingFieldTemplate(TypeOfField type)
3931 return MEDCouplingFieldTemplate::New(type);
3934 std::string __str__() const
3936 return self->simpleRepr();
3939 std::string __repr__() const
3941 std::ostringstream oss;
3942 self->reprQuickOverview(oss);
3946 PyObject *isEqualIfNotWhy(const MEDCouplingFieldTemplate *other, double meshPrec) const
3949 bool ret0=self->isEqualIfNotWhy(other,meshPrec,ret1);
3950 PyObject *ret=PyTuple_New(2);
3951 PyObject *ret0Py=ret0?Py_True:Py_False;
3953 PyTuple_SetItem(ret,0,ret0Py);
3954 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3961 class MEDCouplingFieldT : public MEDCoupling::MEDCouplingField
3964 TypeOfTimeDiscretization getTimeDiscretization() const;
3966 MEDCouplingFieldT();
3967 ~MEDCouplingFieldT();
3970 %template(MEDCouplingFieldTdouble) MEDCoupling::MEDCouplingFieldT<double>;
3971 %template(MEDCouplingFieldTfloat) MEDCoupling::MEDCouplingFieldT<float>;
3972 %template(MEDCouplingFieldTint) MEDCoupling::MEDCouplingFieldT<int>;
3974 class MEDCouplingFieldInt32;
3975 class MEDCouplingFieldInt64;
3976 class MEDCouplingFieldFloat;
3978 class MEDCouplingFieldDouble : public MEDCouplingFieldT<double>
3981 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3982 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3983 bool isEqual(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
3984 bool isEqualWithoutConsideringStr(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
3985 void setTimeUnit(const std::string& unit);
3986 std::string getTimeUnit() const;
3987 void synchronizeTimeWithSupport();
3988 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other);
3989 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other);
3990 std::string simpleRepr() const;
3991 std::string advancedRepr() const;
3992 std::string writeVTK(const std::string& fileName, bool isBinary=true) const;
3993 MEDCouplingFieldInt32 *convertToIntField() const;
3994 MEDCouplingFieldFloat *convertToFloatField() const;
3995 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3996 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3997 MEDCouplingFieldDouble *deepCopy() const;
3998 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const;
3999 MEDCouplingFieldDouble *nodeToCellDiscretization() const;
4000 MEDCouplingFieldDouble *cellToNodeDiscretization() const;
4001 double getIJ(int tupleId, int compoId) const;
4002 double getIJK(int cellId, int nodeIdInCell, int compoId) const;
4003 void synchronizeTimeWithMesh();
4004 void setArray(DataArrayDouble *array);
4005 void setEndArray(DataArrayDouble *array);
4006 void setTime(double val, int iteration, int order);
4007 void setStartTime(double val, int iteration, int order);
4008 void setEndTime(double val, int iteration, int order);
4009 void applyLin(double a, double b, int compoId);
4010 void applyLin(double a, double b);
4011 int getNumberOfComponents() const;
4012 int getNumberOfTuples() const;
4013 int getNumberOfValues() const;
4014 void setTimeTolerance(double val);
4015 double getTimeTolerance() const;
4016 void setIteration(int it);
4017 void setEndIteration(int it);
4018 void setOrder(int order);
4019 void setEndOrder(int order);
4020 void setTimeValue(double val);
4021 void setEndTimeValue(double val);
4022 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15);
4023 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15);
4024 bool mergeNodes(double eps, double epsOnVals=1e-15);
4025 bool mergeNodesCenter(double eps, double epsOnVals=1e-15);
4026 bool zipCoords(double epsOnVals=1e-15);
4027 bool zipConnectivity(int compType,double epsOnVals=1e-15);
4028 bool simplexize(int policy);
4029 MEDCouplingFieldDouble *doublyContractedProduct() const;
4030 MEDCouplingFieldDouble *determinant() const;
4031 MEDCouplingFieldDouble *eigenValues() const;
4032 MEDCouplingFieldDouble *eigenVectors() const;
4033 MEDCouplingFieldDouble *inverse() const;
4034 MEDCouplingFieldDouble *trace() const;
4035 MEDCouplingFieldDouble *deviator() const;
4036 MEDCouplingFieldDouble *magnitude() const;
4037 MEDCouplingFieldDouble *maxPerTuple() const;
4038 void changeNbOfComponents(std::size_t newNbOfComp, double dftValue=0.);
4039 void sortPerTuple(bool asc);
4040 MEDCouplingFieldDouble &operator=(double value);
4041 void fillFromAnalytic(int nbOfComp, const std::string& func);
4042 void fillFromAnalyticCompo(int nbOfComp, const std::string& func);
4043 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
4044 void applyFunc(int nbOfComp, const std::string& func);
4045 void applyFuncCompo(int nbOfComp, const std::string& func);
4046 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
4047 void applyFunc(int nbOfComp, double val);
4048 void applyFunc(const std::string& func);
4049 void applyFuncFast32(const std::string& func);
4050 void applyFuncFast64(const std::string& func);
4051 double accumulate(int compId) const;
4052 double getMaxValue() const;
4053 double getMinValue() const;
4054 double getAverageValue() const;
4055 double norm2() const;
4056 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4057 double getWeightedAverageValue(int compId, bool isWAbs) const;
4058 double integral(int compId, bool isWAbs) const;
4059 double normL1(int compId) const;
4060 double normL2(int compId) const;
4061 double normMax(int compId) const;
4062 DataArrayIdType *findIdsInRange(double vmin, double vmax) const;
4063 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const;
4064 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4065 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4066 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4067 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const;
4068 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4069 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const;
4070 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4071 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const;
4072 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4073 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4074 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4075 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4076 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4077 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const;
4078 MEDCouplingFieldDouble *negate() const;
4080 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4082 return MEDCouplingFieldDouble::New(type,td);
4085 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4087 return MEDCouplingFieldDouble::New(ft,td);
4090 std::string __str__() const
4092 return self->simpleRepr();
4095 std::string __repr__() const
4097 std::ostringstream oss;
4098 self->reprQuickOverview(oss);
4102 PyObject *isEqualIfNotWhy(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const
4105 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
4106 PyObject *ret=PyTuple_New(2);
4107 PyObject *ret0Py=ret0?Py_True:Py_False;
4109 PyTuple_SetItem(ret,0,ret0Py);
4110 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4114 MEDCouplingFieldDouble *voronoize(double eps) const
4116 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4120 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const
4122 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4126 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4128 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4130 DataArrayDouble *a,*a2;
4131 DataArrayDoubleTuple *aa,*aa2;
4132 std::vector<double> bb,bb2;
4134 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4135 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4136 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4139 DataArrayDouble *getArray()
4141 DataArrayDouble *ret=self->getArray();
4147 PyObject *getArrays() const
4149 std::vector<DataArrayDouble *> arrs=self->getArrays();
4150 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4153 std::size_t sz=arrs.size();
4154 PyObject *ret=PyTuple_New(sz);
4155 for(std::size_t i=0;i<sz;i++)
4158 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4160 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4165 void setArrays(PyObject *ls)
4167 std::vector<const DataArrayDouble *> tmp;
4168 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4169 std::size_t sz=tmp.size();
4170 std::vector<DataArrayDouble *> arrs(sz);
4171 for(std::size_t i=0;i<sz;i++)
4172 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4173 self->setArrays(arrs);
4176 DataArrayDouble *getEndArray()
4178 DataArrayDouble *ret=self->getEndArray();
4184 PyObject *getValueOn(PyObject *sl) const
4188 DataArrayDoubleTuple *aa;
4189 std::vector<double> bb;
4191 const MEDCouplingMesh *mesh=self->getMesh();
4193 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4194 int spaceDim=mesh->getSpaceDimension();
4195 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4196 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4198 mcIdType sz=ToIdType(self->getNumberOfComponents());
4199 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4200 self->getValueOn(spaceLoc,res);
4201 return convertDblArrToPyList<double>(res,sz);
4204 PyObject *getValueOnPos(mcIdType i, mcIdType j, mcIdType k) const
4206 mcIdType sz=ToIdType(self->getNumberOfComponents());
4207 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4208 self->getValueOnPos(i,j,k,res);
4209 return convertDblArrToPyList<double>(res,sz);
4212 DataArrayDouble *getValueOnMulti(PyObject *locs) const
4214 const MEDCouplingMesh *mesh(self->getMesh());
4216 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4219 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4220 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4221 mesh->getSpaceDimension(),true,nbPts);
4222 return self->getValueOnMulti(inp,(int)nbPts);
4225 PyObject *getValueOn(PyObject *sl, double time) const
4229 DataArrayDoubleTuple *aa;
4230 std::vector<double> bb;
4232 const MEDCouplingMesh *mesh=self->getMesh();
4234 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4235 int spaceDim=mesh->getSpaceDimension();
4236 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4237 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4240 mcIdType sz=ToIdType(self->getNumberOfComponents());
4241 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4242 self->getValueOn(spaceLoc,time,res);
4243 return convertDblArrToPyList<double>(res,sz);
4246 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
4248 if(self->getArray()!=0)
4249 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4252 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4253 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4254 self->setArray(arr);
4261 double tmp0=self->getTime(tmp1,tmp2);
4262 PyObject *res = PyList_New(3);
4263 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4264 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4265 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4269 PyObject *getStartTime()
4272 double tmp0=self->getStartTime(tmp1,tmp2);
4273 PyObject *res = PyList_New(3);
4274 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4275 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4276 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4280 PyObject *getEndTime()
4283 double tmp0=self->getEndTime(tmp1,tmp2);
4284 PyObject *res = PyList_New(3);
4285 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4286 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4287 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4290 PyObject *accumulate() const
4292 mcIdType sz=ToIdType(self->getNumberOfComponents());
4293 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4294 self->accumulate(tmp);
4295 return convertDblArrToPyList<double>(tmp,sz);
4297 PyObject *integral(bool isWAbs) const
4299 mcIdType sz=ToIdType(self->getNumberOfComponents());
4300 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4301 self->integral(isWAbs,tmp);
4302 return convertDblArrToPyList<double>(tmp,sz);
4304 PyObject *getWeightedAverageValue(bool isWAbs=true) const
4306 mcIdType sz=ToIdType(self->getNumberOfComponents());
4307 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4308 self->getWeightedAverageValue(tmp,isWAbs);
4309 return convertDblArrToPyList<double>(tmp,sz);
4311 PyObject *normL1() const
4313 mcIdType sz=ToIdType(self->getNumberOfComponents());
4314 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4316 return convertDblArrToPyList<double>(tmp,sz);
4318 PyObject *normL2() const
4320 mcIdType sz=ToIdType(self->getNumberOfComponents());
4321 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4323 return convertDblArrToPyList<double>(tmp,sz);
4325 PyObject *normMax() const
4327 mcIdType sz=ToIdType(self->getNumberOfComponents());
4328 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4330 return convertDblArrToPyList<double>(tmp,sz);
4332 void renumberCells(PyObject *li, bool check=true)
4334 mcIdType szArr,sw,iTypppArr;
4335 std::vector<mcIdType> stdvecTyyppArr;
4336 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4337 self->renumberCells(tmp,check);
4340 void renumberCellsWithoutMesh(PyObject *li, bool check=true)
4342 mcIdType szArr,sw,iTypppArr;
4343 std::vector<mcIdType> stdvecTyyppArr;
4344 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4345 self->renumberCellsWithoutMesh(tmp,check);
4348 void renumberNodes(PyObject *li, double eps=1e-15)
4350 mcIdType szArr,sw,iTypppArr;
4351 std::vector<mcIdType> stdvecTyyppArr;
4352 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4353 self->renumberNodes(tmp,eps);
4356 void renumberNodesWithoutMesh(PyObject *li, mcIdType newNbOfNodes, double eps=1e-15)
4358 mcIdType szArr,sw,iTypppArr;
4359 std::vector<mcIdType> stdvecTyyppArr;
4360 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4361 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4364 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const
4366 return fieldT_buildSubPart(self,li);
4369 MEDCouplingFieldDouble *__getitem__(PyObject *li) const
4371 return fieldT__getitem__(self,li);
4374 PyObject *getMaxValue2() const
4376 DataArrayIdType *tmp;
4377 double r1=self->getMaxValue2(tmp);
4378 PyObject *ret=PyTuple_New(2);
4379 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4380 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4384 PyObject *getMinValue2() const
4386 DataArrayIdType *tmp;
4387 double r1=self->getMinValue2(tmp);
4388 PyObject *ret=PyTuple_New(2);
4389 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4390 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4394 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const
4396 std::vector<std::size_t> tmp;
4397 convertPyToNewIntArr3(li,tmp);
4398 return self->keepSelectedComponents(tmp);
4401 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li)
4403 std::vector<std::size_t> tmp;
4404 convertPyToNewIntArr3(li,tmp);
4405 self->setSelectedComponents(f,tmp);
4408 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const
4411 DataArrayDouble *a,*a2;
4412 DataArrayDoubleTuple *aa,*aa2;
4413 std::vector<double> bb,bb2;
4416 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st parameter for origin.";
4417 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd parameter for vector.";
4418 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4419 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4421 return self->extractSlice3D(orig,vect,eps);
4424 MEDCouplingFieldDouble *__add__(PyObject *obj)
4426 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4429 MEDCouplingFieldDouble *__radd__(PyObject *obj)
4431 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4434 MEDCouplingFieldDouble *__sub__(PyObject *obj)
4436 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.";
4437 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4440 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4442 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4444 return (*self)-(*other);
4446 throw INTERP_KERNEL::Exception(msg);
4451 DataArrayDoubleTuple *aa;
4452 std::vector<double> bb;
4454 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4459 if(!self->getArray())
4460 throw INTERP_KERNEL::Exception(msg2);
4461 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4462 ret->applyLin(1.,-val);
4463 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4464 ret2->setArray(ret);
4469 if(!self->getArray())
4470 throw INTERP_KERNEL::Exception(msg2);
4471 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4472 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4473 ret2->setArray(ret);
4478 if(!self->getArray())
4479 throw INTERP_KERNEL::Exception(msg2);
4480 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4481 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4482 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4483 ret2->setArray(ret);
4488 if(!self->getArray())
4489 throw INTERP_KERNEL::Exception(msg2);
4490 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4491 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4492 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4493 ret2->setArray(ret);
4497 { throw INTERP_KERNEL::Exception(msg); }
4501 MEDCouplingFieldDouble *__rsub__(PyObject *obj)
4503 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4506 MEDCouplingFieldDouble *__mul__(PyObject *obj)
4508 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4511 MEDCouplingFieldDouble *__rmul__(PyObject *obj)
4513 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4516 MEDCouplingFieldDouble *__div__(PyObject *obj)
4518 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.";
4519 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4522 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4524 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4526 return (*self)/(*other);
4528 throw INTERP_KERNEL::Exception(msg);
4533 DataArrayDoubleTuple *aa;
4534 std::vector<double> bb;
4536 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4542 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4543 if(!self->getArray())
4544 throw INTERP_KERNEL::Exception(msg2);
4545 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4546 ret->applyLin(1./val,0);
4547 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4548 ret2->setArray(ret);
4553 if(!self->getArray())
4554 throw INTERP_KERNEL::Exception(msg2);
4555 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4556 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4557 ret2->setArray(ret);
4562 if(!self->getArray())
4563 throw INTERP_KERNEL::Exception(msg2);
4564 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4565 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4566 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4567 ret2->setArray(ret);
4572 if(!self->getArray())
4573 throw INTERP_KERNEL::Exception(msg2);
4574 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4575 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4576 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4577 ret2->setArray(ret);
4581 { throw INTERP_KERNEL::Exception(msg); }
4585 MEDCouplingFieldDouble *__rdiv__(PyObject *obj)
4587 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4590 MEDCouplingFieldDouble *__pow__(PyObject *obj)
4592 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.";
4593 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4596 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4598 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4600 return (*self)^(*other);
4602 throw INTERP_KERNEL::Exception(msg);
4607 DataArrayDoubleTuple *aa;
4608 std::vector<double> bb;
4610 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4615 if(!self->getArray())
4616 throw INTERP_KERNEL::Exception(msg2);
4617 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4619 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4620 ret2->setArray(ret);
4625 if(!self->getArray())
4626 throw INTERP_KERNEL::Exception(msg2);
4627 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4628 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4629 ret2->setArray(ret);
4634 if(!self->getArray())
4635 throw INTERP_KERNEL::Exception(msg2);
4636 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4637 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4638 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4639 ret2->setArray(ret);
4644 if(!self->getArray())
4645 throw INTERP_KERNEL::Exception(msg2);
4646 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4647 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4648 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4649 ret2->setArray(ret);
4653 { throw INTERP_KERNEL::Exception(msg); }
4657 MEDCouplingFieldDouble *__neg__() const
4659 return self->negate();
4662 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
4664 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.";
4665 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4668 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4670 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4674 Py_XINCREF(trueSelf);
4678 throw INTERP_KERNEL::Exception(msg);
4683 DataArrayDoubleTuple *aa;
4684 std::vector<double> bb;
4686 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4691 if(!self->getArray())
4692 throw INTERP_KERNEL::Exception(msg2);
4693 self->getArray()->applyLin(1.,val);
4694 Py_XINCREF(trueSelf);
4699 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4702 Py_XINCREF(trueSelf);
4707 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4708 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4709 ret2->setArray(aaa);
4711 Py_XINCREF(trueSelf);
4716 if(!self->getArray())
4717 throw INTERP_KERNEL::Exception(msg2);
4718 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4719 self->getArray()->addEqual(aaa);
4720 Py_XINCREF(trueSelf);
4724 { throw INTERP_KERNEL::Exception(msg); }
4728 PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
4730 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.";
4731 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4734 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4736 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4740 Py_XINCREF(trueSelf);
4744 throw INTERP_KERNEL::Exception(msg);
4749 DataArrayDoubleTuple *aa;
4750 std::vector<double> bb;
4752 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4757 if(!self->getArray())
4758 throw INTERP_KERNEL::Exception(msg2);
4759 self->getArray()->applyLin(1.,-val);
4760 Py_XINCREF(trueSelf);
4765 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4768 Py_XINCREF(trueSelf);
4773 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4774 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4775 ret2->setArray(aaa);
4777 Py_XINCREF(trueSelf);
4782 if(!self->getArray())
4783 throw INTERP_KERNEL::Exception(msg2);
4784 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4785 self->getArray()->substractEqual(aaa);
4786 Py_XINCREF(trueSelf);
4790 { throw INTERP_KERNEL::Exception(msg); }
4794 PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
4796 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.";
4797 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4800 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4802 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4806 Py_XINCREF(trueSelf);
4810 throw INTERP_KERNEL::Exception(msg);
4815 DataArrayDoubleTuple *aa;
4816 std::vector<double> bb;
4818 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4823 if(!self->getArray())
4824 throw INTERP_KERNEL::Exception(msg2);
4825 self->getArray()->applyLin(val,0);
4826 Py_XINCREF(trueSelf);
4831 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4834 Py_XINCREF(trueSelf);
4839 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4840 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4841 ret2->setArray(aaa);
4843 Py_XINCREF(trueSelf);
4848 if(!self->getArray())
4849 throw INTERP_KERNEL::Exception(msg2);
4850 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4851 self->getArray()->multiplyEqual(aaa);
4852 Py_XINCREF(trueSelf);
4856 { throw INTERP_KERNEL::Exception(msg); }
4860 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
4862 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.";
4863 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4866 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4868 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4872 Py_XINCREF(trueSelf);
4876 throw INTERP_KERNEL::Exception(msg);
4881 DataArrayDoubleTuple *aa;
4882 std::vector<double> bb;
4884 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4890 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4891 if(!self->getArray())
4892 throw INTERP_KERNEL::Exception(msg2);
4893 self->getArray()->applyLin(1./val,0);
4894 Py_XINCREF(trueSelf);
4899 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4902 Py_XINCREF(trueSelf);
4907 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4908 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4909 ret2->setArray(aaa);
4911 Py_XINCREF(trueSelf);
4916 if(!self->getArray())
4917 throw INTERP_KERNEL::Exception(msg2);
4918 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4919 self->getArray()->divideEqual(aaa);
4920 Py_XINCREF(trueSelf);
4924 { throw INTERP_KERNEL::Exception(msg); }
4928 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj)
4930 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.";
4931 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4934 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4936 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4940 Py_XINCREF(trueSelf);
4944 throw INTERP_KERNEL::Exception(msg);
4949 DataArrayDoubleTuple *aa;
4950 std::vector<double> bb;
4952 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4957 if(!self->getArray())
4958 throw INTERP_KERNEL::Exception(msg2);
4959 self->getArray()->applyPow(val);
4960 Py_XINCREF(trueSelf);
4965 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4968 Py_XINCREF(trueSelf);
4973 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4974 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4975 ret2->setArray(aaa);
4977 Py_XINCREF(trueSelf);
4982 if(!self->getArray())
4983 throw INTERP_KERNEL::Exception(msg2);
4984 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4985 self->getArray()->powEqual(aaa);
4986 Py_XINCREF(trueSelf);
4990 { throw INTERP_KERNEL::Exception(msg); }
4994 static MEDCouplingFieldDouble *MergeFields(PyObject *li)
4996 std::vector<const MEDCouplingFieldDouble *> tmp;
4997 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4998 return MEDCouplingFieldDouble::MergeFields(tmp);
5001 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true)
5003 std::vector<const MEDCouplingFieldDouble *> tmp;
5004 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5005 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
5008 PyObject *getTinySerializationInformation() const
5010 return field_getTinySerializationInformation<MEDCouplingFieldDouble>(self);
5013 PyObject *serialize() const
5015 return field_serialize<double>(self);
5018 PyObject *__getstate__() const
5020 return field__getstate__<MEDCouplingFieldDouble>(self,MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldDouble_serialize);
5023 void __setstate__(PyObject *inp)
5025 field__setstate__<double>(self,inp);
5030 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5033 int getNumberOfFields() const;
5034 MEDCouplingMultiFields *deepCopy() const;
5035 virtual std::string simpleRepr() const;
5036 virtual std::string advancedRepr() const;
5037 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5038 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5039 virtual void checkConsistencyLight() const;
5042 std::string __str__() const
5044 return self->simpleRepr();
5046 static MEDCouplingMultiFields *New(PyObject *li)
5048 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5049 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5050 std::size_t sz=tmp.size();
5051 std::vector<MEDCouplingFieldDouble *> fs(sz);
5052 for(std::size_t i=0;i<sz;i++)
5053 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5054 return MEDCouplingMultiFields::New(fs);
5056 MEDCouplingMultiFields(PyObject *li)
5058 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5059 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5060 std::size_t sz=tmp.size();
5061 std::vector<MEDCouplingFieldDouble *> fs(sz);
5062 for(std::size_t i=0;i<sz;i++)
5063 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5064 return MEDCouplingMultiFields::New(fs);
5066 PyObject *getFields() const
5068 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5069 std::size_t sz=fields.size();
5070 PyObject *res = PyList_New(sz);
5071 for(std::size_t i=0;i<sz;i++)
5075 fields[i]->incrRef();
5076 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5080 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5085 PyObject *getFieldAtPos(int id) const
5087 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5091 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5094 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5096 PyObject *getMeshes() const
5098 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5099 std::size_t sz=ms.size();
5100 PyObject *res = PyList_New(sz);
5101 for(std::size_t i=0;i<sz;i++)
5106 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5110 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5115 PyObject *getDifferentMeshes() const
5117 std::vector<int> refs;
5118 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5119 std::size_t sz=ms.size();
5120 PyObject *res = PyList_New(sz);
5121 for(std::size_t i=0;i<sz;i++)
5126 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5130 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5134 PyObject *ret=PyTuple_New(2);
5135 PyTuple_SetItem(ret,0,res);
5136 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5139 PyObject *getArrays() const
5141 std::vector<DataArrayDouble *> ms=self->getArrays();
5142 std::size_t sz=ms.size();
5143 PyObject *res = PyList_New(sz);
5144 for(std::size_t i=0;i<sz;i++)
5149 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5153 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5158 PyObject *getDifferentArrays() const
5160 std::vector< std::vector<int> > refs;
5161 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5162 std::size_t sz=ms.size();
5163 PyObject *res = PyList_New(sz);
5164 PyObject *res2 = PyList_New(sz);
5165 for(std::size_t i=0;i<sz;i++)
5170 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5174 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5176 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5179 PyObject *ret=PyTuple_New(2);
5180 PyTuple_SetItem(ret,0,res);
5181 PyTuple_SetItem(ret,1,res2);
5187 class MEDCouplingFieldInt32 : public MEDCouplingFieldT<int>
5190 static MEDCouplingFieldInt32 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5191 static MEDCouplingFieldInt32 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5192 bool isEqual(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const;
5193 bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const;
5194 void setTimeUnit(const std::string& unit);
5195 std::string getTimeUnit() const;
5196 void setTime(double val, int iteration, int order);
5197 void setArray(DataArrayInt32 *array);
5198 MEDCouplingFieldInt32 *deepCopy() const;
5199 MEDCouplingFieldInt32 *clone(bool recDeepCpy) const;
5200 MEDCouplingFieldInt32 *cloneWithMesh(bool recDeepCpy) const;
5201 MEDCouplingFieldDouble *convertToDblField() const;
5202 MEDCouplingFieldInt32 *buildSubPartRange(int begin, int end, int step) const;
5204 MEDCouplingFieldInt32(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5206 return MEDCouplingFieldInt32::New(type,td);
5209 MEDCouplingFieldInt32(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5211 return MEDCouplingFieldInt32::New(ft,td);
5214 PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const
5217 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5218 PyObject *ret=PyTuple_New(2);
5219 PyObject *ret0Py=ret0?Py_True:Py_False;
5221 PyTuple_SetItem(ret,0,ret0Py);
5222 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5226 std::string __str__() const
5228 return self->simpleRepr();
5231 std::string __repr__() const
5233 std::ostringstream oss;
5234 self->reprQuickOverview(oss);
5238 MEDCouplingFieldInt32 *buildSubPart(PyObject *li) const
5240 return fieldT_buildSubPart(self,li);
5243 MEDCouplingFieldInt32 *__getitem__(PyObject *li) const
5245 return fieldT__getitem__(self,li);
5248 DataArrayInt32 *getArray()
5250 DataArrayInt32 *ret=self->getArray();
5259 double tmp0=self->getTime(tmp1,tmp2);
5260 PyObject *res = PyList_New(3);
5261 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5262 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5263 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5267 PyObject *getTinySerializationInformation() const
5269 return field_getTinySerializationInformation<MEDCouplingFieldInt32>(self);
5272 PyObject *serialize() const
5274 return field_serialize<int>(self);
5277 PyObject *__getstate__() const
5279 return field__getstate__<MEDCouplingFieldInt32>(self,MEDCoupling_MEDCouplingFieldInt32_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt32_serialize);
5282 void __setstate__(PyObject *inp)
5284 field__setstate__<int>(self,inp);
5289 class MEDCouplingFieldInt64 : public MEDCouplingFieldT<int>
5292 static MEDCouplingFieldInt64 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5293 static MEDCouplingFieldInt64 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5294 bool isEqual(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
5295 bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
5296 void setTimeUnit(const std::string& unit);
5297 std::string getTimeUnit() const;
5298 void setTime(double val, int iteration, int order);
5299 void setArray(DataArrayInt64 *array);
5300 MEDCouplingFieldInt64 *deepCopy() const;
5301 MEDCouplingFieldInt64 *clone(bool recDeepCpy) const;
5302 MEDCouplingFieldInt64 *cloneWithMesh(bool recDeepCpy) const;
5303 MEDCouplingFieldDouble *convertToDblField() const;
5304 MEDCouplingFieldInt64 *buildSubPartRange(int begin, int end, int step) const;
5306 MEDCouplingFieldInt64(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5308 return MEDCouplingFieldInt64::New(type,td);
5311 MEDCouplingFieldInt64(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5313 return MEDCouplingFieldInt64::New(ft,td);
5316 PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const
5319 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5320 PyObject *ret=PyTuple_New(2);
5321 PyObject *ret0Py=ret0?Py_True:Py_False;
5323 PyTuple_SetItem(ret,0,ret0Py);
5324 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5328 std::string __str__() const
5330 return self->simpleRepr();
5333 std::string __repr__() const
5335 std::ostringstream oss;
5336 self->reprQuickOverview(oss);
5340 MEDCouplingFieldInt64 *buildSubPart(PyObject *li) const
5342 return fieldT_buildSubPart(self,li);
5345 MEDCouplingFieldInt64 *__getitem__(PyObject *li) const
5347 return fieldT__getitem__(self,li);
5350 DataArrayInt64 *getArray()
5352 DataArrayInt64 *ret=self->getArray();
5361 double tmp0=self->getTime(tmp1,tmp2);
5362 PyObject *res = PyList_New(3);
5363 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5364 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5365 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5369 PyObject *getTinySerializationInformation() const
5371 return field_getTinySerializationInformation<MEDCouplingFieldInt64>(self);
5374 PyObject *serialize() const
5376 return field_serialize<Int64>(self);
5379 PyObject *__getstate__() const
5381 return field__getstate__<MEDCouplingFieldInt64>(self,MEDCoupling_MEDCouplingFieldInt64_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt64_serialize);
5384 void __setstate__(PyObject *inp)
5386 field__setstate__<Int64>(self,inp);
5391 class MEDCouplingFieldFloat : public MEDCouplingFieldT<float>
5394 static MEDCouplingFieldFloat *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5395 static MEDCouplingFieldFloat *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5396 bool isEqual(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
5397 bool isEqualWithoutConsideringStr(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
5398 void setTimeUnit(const std::string& unit);
5399 std::string getTimeUnit() const;
5400 void setTime(double val, int iteration, int order);
5401 void setArray(DataArrayFloat *array);
5402 MEDCouplingFieldFloat *deepCopy() const;
5403 MEDCouplingFieldFloat *clone(bool recDeepCpy) const;
5404 MEDCouplingFieldFloat *cloneWithMesh(bool recDeepCpy) const;
5405 MEDCouplingFieldDouble *convertToDblField() const;
5406 MEDCouplingFieldFloat *buildSubPartRange(int begin, int end, int step) const;
5408 MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5410 return MEDCouplingFieldFloat::New(type,td);
5413 MEDCouplingFieldFloat(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5415 return MEDCouplingFieldFloat::New(ft,td);
5418 PyObject *isEqualIfNotWhy(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const
5421 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5422 PyObject *ret=PyTuple_New(2);
5423 PyObject *ret0Py=ret0?Py_True:Py_False;
5425 PyTuple_SetItem(ret,0,ret0Py);
5426 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5430 std::string __str__() const
5432 return self->simpleRepr();
5435 std::string __repr__() const
5437 std::ostringstream oss;
5438 self->reprQuickOverview(oss);
5442 MEDCouplingFieldFloat *buildSubPart(PyObject *li) const
5444 return fieldT_buildSubPart(self,li);
5447 MEDCouplingFieldFloat *__getitem__(PyObject *li) const
5449 return fieldT__getitem__(self,li);
5452 DataArrayFloat *getArray()
5454 DataArrayFloat *ret=self->getArray();
5463 double tmp0=self->getTime(tmp1,tmp2);
5464 PyObject *res = PyList_New(3);
5465 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5466 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5467 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5471 PyObject *getTinySerializationInformation() const
5473 return field_getTinySerializationInformation<MEDCouplingFieldFloat>(self);
5476 PyObject *serialize() const
5478 return field_serialize<float>(self);
5481 PyObject *__getstate__() const
5483 return field__getstate__<MEDCouplingFieldFloat>(self,MEDCoupling_MEDCouplingFieldFloat_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldFloat_serialize);
5486 void __setstate__(PyObject *inp)
5488 field__setstate__<float>(self,inp);
5493 class MEDCouplingDefinitionTime
5496 MEDCouplingDefinitionTime();
5497 void assign(const MEDCouplingDefinitionTime& other);
5498 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5499 double getTimeResolution() const;
5500 std::vector<double> getHotSpotsTime() const;
5503 std::string __str__() const
5505 std::ostringstream oss;
5506 self->appendRepr(oss);
5510 PyObject *getIdsOnTimeRight(double tm) const
5512 int meshId,arrId,arrIdInField,fieldId;
5513 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5514 PyObject *res=PyList_New(4);
5515 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5516 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5517 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5518 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5522 PyObject *getIdsOnTimeLeft(double tm) const
5524 int meshId,arrId,arrIdInField,fieldId;
5525 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5526 PyObject *res=PyList_New(4);
5527 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5528 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5529 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5530 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5536 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5539 double getTimeTolerance() const;
5540 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5544 MEDCouplingFieldOverTime(PyObject *li)
5546 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5547 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5548 std::size_t sz=tmp.size();
5549 std::vector<MEDCouplingFieldDouble *> fs(sz);
5550 for(std::size_t i=0;i<sz;i++)
5551 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5552 return MEDCouplingFieldOverTime::New(fs);
5554 std::string __str__() const
5556 return self->simpleRepr();
5558 static MEDCouplingFieldOverTime *New(PyObject *li)
5560 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5561 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5562 std::size_t sz=tmp.size();
5563 std::vector<MEDCouplingFieldDouble *> fs(sz);
5564 for(std::size_t i=0;i<sz;i++)
5565 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5566 return MEDCouplingFieldOverTime::New(fs);
5571 class MEDCouplingCartesianAMRMesh;
5573 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5576 int getNumberOfCellsRecursiveWithOverlap() const;
5577 int getNumberOfCellsRecursiveWithoutOverlap() const;
5578 int getMaxNumberOfLevelsRelativeToThis() const;
5581 MEDCouplingCartesianAMRMeshGen *getMesh() const
5583 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5591 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5594 int getNumberOfOverlapedCellsForFather() const;
5595 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const;
5596 std::vector<mcIdType> computeCellGridSt() const;
5599 PyObject *getBLTRRange() const
5601 const std::vector< std::pair<mcIdType,mcIdType> >& ret(self->getBLTRRange());
5602 return convertFromVectorPairInt(ret);
5605 PyObject *getBLTRRangeRelativeToGF() const
5607 std::vector< std::pair<mcIdType,mcIdType> > ret(self->getBLTRRangeRelativeToGF());
5608 return convertFromVectorPairInt(ret);
5611 void addPatch(PyObject *bottomLeftTopRight, const std::vector<mcIdType>& factors)
5613 std::vector< std::pair<mcIdType,mcIdType> > inp;
5614 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5615 self->addPatch(inp,factors);
5618 MEDCouplingCartesianAMRPatch *__getitem__(mcIdType patchId) const
5620 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5622 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5623 if(patchId==mesh->getNumberOfPatches())
5625 std::ostringstream oss;
5626 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5627 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5630 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5636 void __delitem__(mcIdType patchId)
5638 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5640 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5641 mesh->removePatch(patchId);
5644 mcIdType __len__() const
5646 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5648 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5649 return mesh->getNumberOfPatches();
5654 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5658 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5661 mcIdType getAbsoluteLevel() const;
5662 mcIdType getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
5663 std::vector<mcIdType> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
5664 int getSpaceDimension() const;
5665 const std::vector<mcIdType>& getFactors() const;
5666 void setFactors(const std::vector<mcIdType>& newFactors);
5667 mcIdType getMaxNumberOfLevelsRelativeToThis() const;
5668 mcIdType getNumberOfCellsAtCurrentLevel() const;
5669 mcIdType getNumberOfCellsAtCurrentLevelGhost(mcIdType ghostLev) const;
5670 mcIdType getNumberOfCellsRecursiveWithOverlap() const;
5671 mcIdType getNumberOfCellsRecursiveWithoutOverlap() const;
5672 bool isPatchInNeighborhoodOf(mcIdType patchId1, mcIdType patchId2, mcIdType ghostLev) const;
5673 virtual void detachFromFather();
5675 mcIdType getNumberOfPatches() const;
5676 mcIdType getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const;
5677 MEDCouplingUMesh *buildUnstructured() const;
5678 DataArrayDouble *extractGhostFrom(mcIdType ghostSz, const DataArrayDouble *arr) const;
5679 std::vector<mcIdType> getPatchIdsInTheNeighborhoodOf(mcIdType patchId, mcIdType ghostLev) const;
5680 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const;
5681 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const;
5682 void removeAllPatches();
5683 void removePatch(mcIdType patchId);
5684 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<mcIdType>& factors);
5685 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<mcIdType>& factors, double eps);
5686 DataArrayDouble *createCellFieldOnPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnThis) const;
5687 void fillCellFieldOnPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const;
5688 void fillCellFieldOnPatchGhost(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev, bool isConservative=true) const;
5689 void fillCellFieldOnPatchOnlyOnGhostZone(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev) const;
5690 void fillCellFieldOnPatchOnlyOnGhostZoneWith(mcIdType ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5691 void fillCellFieldComingFromPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const;
5692 void fillCellFieldComingFromPatchGhost(mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, bool isConservative=true) const;
5693 DataArrayIdType *findPatchesInTheNeighborhoodOf(mcIdType patchId, mcIdType ghostLev) const;
5694 std::string buildPythonDumpOfThis() const;
5697 void addPatch(PyObject *bottomLeftTopRight, const std::vector<mcIdType>& factors)
5699 std::vector< std::pair<mcIdType,mcIdType> > inp;
5700 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5701 self->addPatch(inp,factors);
5704 PyObject *getPatches() const
5706 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5707 std::size_t sz(ps.size());
5708 PyObject *ret = PyList_New(sz);
5709 for(std::size_t i=0;i<sz;i++)
5711 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5714 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5719 // agy : don't know why typemap fails here ??? let it in the extend section
5720 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const
5722 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5725 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<mcIdType>& pos) const
5727 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5728 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5734 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<mcIdType>& pos) const
5736 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5737 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5743 virtual PyObject *positionRelativeToGodFather() const
5745 std::vector<mcIdType> out1;
5746 std::vector< std::pair<mcIdType,mcIdType> > out0(self->positionRelativeToGodFather(out1));
5747 PyObject *ret(PyTuple_New(2));
5748 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5749 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5753 virtual PyObject *retrieveGridsAt(mcIdType absoluteLev) const
5755 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5756 std::size_t sz(ps.size());
5757 PyObject *ret = PyList_New(sz);
5758 for(std::size_t i=0;i<sz;i++)
5759 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5763 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(mcIdType ghostSz, PyObject *recurseArrs) const
5765 std::vector<const DataArrayDouble *> inp;
5766 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5767 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5770 virtual MEDCouplingCartesianAMRMeshGen *getFather() const
5772 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5778 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const
5780 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5786 MEDCouplingCartesianAMRPatch *getPatch(mcIdType patchId) const
5788 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5794 MEDCouplingIMesh *getImageMesh() const
5796 const MEDCouplingIMesh *ret(self->getImageMesh());
5799 return const_cast<MEDCouplingIMesh *>(ret);
5802 MEDCouplingCartesianAMRPatch *__getitem__(mcIdType patchId) const
5804 if(patchId==self->getNumberOfPatches())
5806 std::ostringstream oss;
5807 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5808 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5811 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5817 void fillCellFieldOnPatchGhostAdv(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const
5819 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5820 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5821 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5824 void fillCellFieldOnPatchOnlyGhostAdv(mcIdType patchId, mcIdType ghostLev, PyObject *arrsOnPatches) const
5826 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5827 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5828 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5831 void __delitem__(mcIdType patchId)
5833 self->removePatch(patchId);
5836 mcIdType __len__() const
5838 return self->getNumberOfPatches();
5843 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5847 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5850 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh);
5853 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
5855 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5856 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5857 const mcIdType *nodeStrctPtr(0);
5858 const double *originPtr(0),*dxyzPtr(0);
5859 mcIdType sw,sz,val0;
5860 std::vector<mcIdType> bb0;
5861 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
5864 std::vector<double> bb,bb2;
5866 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5867 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5869 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5872 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps)
5874 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5875 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5876 std::vector< std::vector<mcIdType> > inp2;
5877 convertPyToVectorOfVectorOfInt(factors,inp2);
5878 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5881 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
5883 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5886 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh)
5888 return MEDCouplingCartesianAMRMesh::New(mesh);
5893 class MEDCouplingDataForGodFather : public RefCountObject
5896 virtual void synchronizeFineToCoarse();
5897 virtual void synchronizeFineToCoarseBetween(mcIdType fromLev, mcIdType toLev);
5898 virtual void synchronizeCoarseToFine();
5899 virtual void synchronizeCoarseToFineBetween(mcIdType fromLev, mcIdType toLev);
5900 virtual void synchronizeAllGhostZones();
5901 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh);
5902 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(mcIdType level);
5903 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(mcIdType level);
5904 virtual void alloc();
5905 virtual void dealloc();
5908 MEDCouplingCartesianAMRMesh *getMyGodFather()
5910 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5918 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5921 mcIdType getNumberOfLevels() const;
5922 MEDCouplingAMRAttribute *deepCopy() const;
5923 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const;
5924 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5925 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5926 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5927 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf);
5928 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const;
5929 std::string writeVTHB(const std::string& fileName) const;
5932 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, mcIdType ghostLev)
5934 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5935 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5936 MEDCouplingAMRAttribute *ret(0);
5939 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5940 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5942 catch(INTERP_KERNEL::Exception&)
5944 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5945 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5950 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, mcIdType ghostLev)
5952 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5955 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const
5957 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5958 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5964 void spillInfoOnComponents(PyObject *compNames)
5966 std::vector< std::vector<std::string> > compNamesCpp;
5967 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5968 self->spillInfoOnComponents(compNamesCpp);
5971 void spillNatures(PyObject *nfs)
5973 std::vector<mcIdType> inp0;
5974 if(!fillIntVector(nfs,inp0))
5975 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5976 std::size_t sz(inp0.size());
5977 std::vector<NatureOfField> inp00(sz);
5978 for(std::size_t i=0;i<sz;i++)
5979 inp00[i]=(NatureOfField)inp0[i];
5980 self->spillNatures(inp00);
5983 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const
5985 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5986 std::size_t sz(ret.size());
5987 PyObject *retPy(PyList_New(sz));
5988 for(std::size_t i=0;i<sz;i++)
5989 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5995 class DenseMatrix : public RefCountObject, public TimeLabel
5998 static DenseMatrix *New(mcIdType nbRows, mcIdType nbCols);
5999 static DenseMatrix *New(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols);
6000 DenseMatrix *deepCopy() const;
6001 DenseMatrix *shallowCpy() const;
6003 mcIdType getNumberOfRows() const;
6004 mcIdType getNumberOfCols() const;
6005 mcIdType getNbOfElems() const;
6006 void reBuild(DataArrayDouble *array, mcIdType nbRows=-1, mcIdType nbCols=-1);
6007 void reShape(mcIdType nbRows, mcIdType nbCols);
6010 bool isEqual(const DenseMatrix& other, double eps) const;
6011 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const;
6012 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec);
6015 DenseMatrix(mcIdType nbRows, mcIdType nbCols)
6017 return DenseMatrix::New(nbRows,nbCols);
6020 DenseMatrix(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols)
6022 return DenseMatrix::New(array,nbRows,nbCols);
6025 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const
6028 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
6029 PyObject *ret=PyTuple_New(2);
6030 PyObject *ret0Py=ret0?Py_True:Py_False;
6032 PyTuple_SetItem(ret,0,ret0Py);
6033 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
6037 DataArrayDouble *getData()
6039 DataArrayDouble *ret(self->getData());
6045 DenseMatrix *__add__(const DenseMatrix *other)
6047 return MEDCoupling::DenseMatrix::Add(self,other);
6050 DenseMatrix *__sub__(const DenseMatrix *other)
6052 return MEDCoupling::DenseMatrix::Substract(self,other);
6055 DenseMatrix *__mul__(const DenseMatrix *other)
6057 return MEDCoupling::DenseMatrix::Multiply(self,other);
6060 DenseMatrix *__mul__(const DataArrayDouble *other)
6062 return MEDCoupling::DenseMatrix::Multiply(self,other);
6065 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other)
6067 self->addEqual(other);
6068 Py_XINCREF(trueSelf);
6072 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other)
6074 self->substractEqual(other);
6075 Py_XINCREF(trueSelf);
6079 PyObject *toNumPyMatrix() // not const. It is not a bug !
6081 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
6090 def MEDCouplingUMeshReduce(self):
6091 return MEDCouplingStdReduceFunct,(MEDCouplingUMesh,((),(self.__getstate__()),))
6092 def MEDCouplingCMeshReduce(self):
6093 return MEDCouplingStdReduceFunct,(MEDCouplingCMesh,((),(self.__getstate__()),))
6094 def MEDCouplingIMeshReduce(self):
6095 return MEDCouplingStdReduceFunct,(MEDCouplingIMesh,((),(self.__getstate__()),))
6096 def MEDCouplingMappedExtrudedMeshReduce(self):
6097 return MEDCouplingStdReduceFunct,(MEDCouplingMappedExtrudedMesh,((),(self.__getstate__()),))
6098 def MEDCouplingCurveLinearMeshReduce(self):
6099 return MEDCouplingStdReduceFunct,(MEDCouplingCurveLinearMesh,((),(self.__getstate__()),))
6100 def MEDCoupling1SGTUMeshReduce(self):
6101 return MEDCouplingStdReduceFunct,(MEDCoupling1SGTUMesh,((),(self.__getstate__()),))
6102 def MEDCoupling1DGTUMeshReduce(self):
6103 return MEDCouplingStdReduceFunct,(MEDCoupling1DGTUMesh,((),(self.__getstate__()),))
6104 def MEDCouplingFieldDoubleReduce(self):
6105 self.checkConsistencyLight()
6106 d=(self.getTypeOfField(),self.getTimeDiscretization())
6107 return MEDCouplingStdReduceFunct,(MEDCouplingFieldDouble,(d,(self.__getstate__()),))
6108 def MEDCouplingFieldInt32Reduce(self):
6109 self.checkConsistencyLight()
6110 d=(self.getTypeOfField(),self.getTimeDiscretization())
6111 return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt32,(d,(self.__getstate__()),))
6112 def MEDCouplingFieldInt64Reduce(self):
6113 self.checkConsistencyLight()
6114 d=(self.getTypeOfField(),self.getTimeDiscretization())
6115 return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt64,(d,(self.__getstate__()),))
6116 def MEDCouplingFieldFloatReduce(self):
6117 self.checkConsistencyLight()
6118 d=(self.getTypeOfField(),self.getTimeDiscretization())
6119 return MEDCouplingStdReduceFunct,(MEDCouplingFieldFloat,(d,(self.__getstate__()),))
6120 def MEDCouplingFTReduceFunct(cls,params):
6122 ret=object.__new__(cls)
6126 def MEDCouplingFieldTemplateReduce(self):
6127 ret = MEDCouplingFieldDouble(self)
6128 nbTuples = self.getNumberOfTuplesExpected()
6129 arr = DataArrayDouble(nbTuples) ; arr[:] = 0.
6131 return MEDCouplingFTReduceFunct,(MEDCouplingFieldTemplate,((ret,),()))
6133 # Forwarding DataArrayInt functions to MEDCouplingUMesh:
6135 MEDCouplingUMesh.ExtractFromIndexedArrays = DataArrayInt.ExtractFromIndexedArrays
6136 MEDCouplingUMesh.ExtractFromIndexedArraysSlice = DataArrayInt.ExtractFromIndexedArraysSlice
6137 MEDCouplingUMesh.SetPartOfIndexedArrays = DataArrayInt.SetPartOfIndexedArrays
6138 MEDCouplingUMesh.SetPartOfIndexedArraysSameIdx = DataArrayInt.SetPartOfIndexedArraysSameIdx
6139 MEDCouplingUMesh.RemoveIdsFromIndexedArrays = DataArrayInt.RemoveIdsFromIndexedArrays
6140 MEDCouplingFieldInt = MEDCouplingFieldInt32
6142 if MEDCouplingUse64BitIDs():
6143 MEDCouplingFieldID = MEDCouplingFieldInt64
6145 MEDCouplingFieldID = MEDCouplingFieldInt32
6151 __filename=os.environ.get('PYTHONSTARTUP')
6152 if __filename and os.path.isfile(__filename):
6153 with open(__filename) as __fp: