1 // Copyright (C) 2017-2021 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (EDF R&D)
21 #ifdef WITH_DOCSTRINGS
22 %include MEDCoupling_doc.i
29 #include "MEDCouplingMemArray.hxx"
30 #include "MEDCouplingMemArray.txx"
31 #include "MEDCouplingUMesh.hxx"
32 #include "MEDCouplingMappedExtrudedMesh.hxx"
33 #include "MEDCouplingCMesh.hxx"
34 #include "MEDCouplingIMesh.hxx"
35 #include "MEDCouplingMap.txx"
36 #include "MEDCouplingCurveLinearMesh.hxx"
37 #include "MEDCoupling1GTUMesh.hxx"
38 #include "MEDCouplingField.hxx"
39 #include "MEDCouplingFieldDouble.hxx"
40 #include "MEDCouplingFieldInt32.hxx"
41 #include "MEDCouplingFieldInt64.hxx"
42 #include "MEDCouplingFieldFloat.hxx"
43 #include "MEDCouplingFieldTemplate.hxx"
44 #include "MEDCouplingGaussLocalization.hxx"
46 #include "MEDCouplingMultiFields.hxx"
47 #include "MEDCouplingFieldOverTime.hxx"
48 #include "MEDCouplingDefinitionTime.hxx"
49 #include "MEDCouplingFieldDiscretization.hxx"
50 #include "MEDCouplingCartesianAMRMesh.hxx"
51 #include "MEDCouplingAMRAttribute.hxx"
52 #include "MEDCouplingMatrix.hxx"
53 #include "MEDCouplingPartDefinition.hxx"
54 #include "MEDCouplingSkyLineArray.hxx"
55 #include "MEDCouplingTypemaps.i"
57 #include "InterpKernelAutoPtr.hxx"
58 #include "BoxSplittingOptions.hxx"
60 using namespace MEDCoupling;
61 using namespace INTERP_KERNEL;
65 %template(dvec) std::vector<double>;
66 %template(svec) std::vector<std::string>;
70 #ifndef MEDCOUPLING_USE_64BIT_IDS
71 //typedef std::int32_t mcIdType;
73 typedef DataArrayInt32 DataArrayIdType;
74 %template(ivec) std::vector<int>;
75 %template(i64vec) std::vector<long>;
77 //typedef std::int64_t mcIdType;
78 typedef DataArrayInt64 DataArrayIdType;
80 %template(ivec) std::vector<long long>;
81 typedef long long mcIdType;
83 %template(ivec) std::vector<long>;
84 typedef long int mcIdType;
86 %template(i32vec) std::vector<int>;
91 %typemap(out) MEDCoupling::MEDCouplingMesh*
93 $result=convertMesh($1,$owner);
96 %typemap(out) MEDCouplingMesh*
98 $result=convertMesh($1,$owner);
103 %typemap(out) MEDCoupling::MEDCouplingPointSet*
105 $result=convertMesh($1,$owner);
108 %typemap(out) MEDCouplingPointSet*
110 $result=convertMesh($1,$owner);
115 %typemap(out) MEDCouplingCartesianAMRPatchGen*
117 $result=convertCartesianAMRPatch($1,$owner);
122 %typemap(out) MEDCouplingCartesianAMRMeshGen*
124 $result=convertCartesianAMRMesh($1,$owner);
129 %typemap(out) MEDCouplingDataForGodFather*
131 $result=convertDataForGodFather($1,$owner);
136 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
138 $result=convertMesh($1,$owner);
141 %typemap(out) MEDCoupling1GTUMesh*
143 $result=convertMesh($1,$owner);
148 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
150 $result=convertMesh($1,$owner);
153 %typemap(out) MEDCouplingStructuredMesh*
155 $result=convertMesh($1,$owner);
160 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
162 $result=convertFieldDiscretization($1,$owner);
165 %typemap(out) MEDCouplingFieldDiscretization*
167 $result=convertFieldDiscretization($1,$owner);
172 %typemap(out) MEDCoupling::MEDCouplingField*
174 $result=convertField($1,$owner);
177 %typemap(out) MEDCouplingField*
179 $result=convertField($1,$owner);
184 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
186 $result=convertMultiFields($1,$owner);
189 %typemap(out) MEDCouplingMultiFields*
191 $result=convertMultiFields($1,$owner);
196 %typemap(out) MEDCoupling::PartDefinition*
198 $result=convertPartDefinition($1,$owner);
201 %typemap(out) PartDefinition*
203 $result=convertPartDefinition($1,$owner);
208 %init %{ import_array(); %}
211 %init %{ initializeMe(); %}
213 %feature("autodoc", "1");
214 %feature("docstring");
216 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
217 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
218 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToFloatField;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
235 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
236 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
237 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
238 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
239 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
240 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
241 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
242 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
243 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
244 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
245 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
246 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
247 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
248 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
249 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
250 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
251 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
252 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
253 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
254 %newobject MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear;
255 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
256 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
257 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
258 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
259 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
260 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
261 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
262 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
263 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
264 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
265 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
266 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
267 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
268 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
269 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
270 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
271 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
272 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
273 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
274 %newobject MEDCoupling::MEDCouplingFieldInt32::New;
275 %newobject MEDCoupling::MEDCouplingFieldInt32::convertToDblField;
276 %newobject MEDCoupling::MEDCouplingFieldInt32::getArray;
277 %newobject MEDCoupling::MEDCouplingFieldInt32::deepCopy;
278 %newobject MEDCoupling::MEDCouplingFieldInt32::clone;
279 %newobject MEDCoupling::MEDCouplingFieldInt32::cloneWithMesh;
280 %newobject MEDCoupling::MEDCouplingFieldInt32::buildSubPart;
281 %newobject MEDCoupling::MEDCouplingFieldInt32::buildSubPartRange;
282 %newobject MEDCoupling::MEDCouplingFieldInt32::__getitem__;
283 %newobject MEDCoupling::MEDCouplingFieldInt64::New;
284 %newobject MEDCoupling::MEDCouplingFieldInt64::convertToDblField;
285 %newobject MEDCoupling::MEDCouplingFieldInt64::getArray;
286 %newobject MEDCoupling::MEDCouplingFieldInt64::deepCopy;
287 %newobject MEDCoupling::MEDCouplingFieldInt64::clone;
288 %newobject MEDCoupling::MEDCouplingFieldInt64::cloneWithMesh;
289 %newobject MEDCoupling::MEDCouplingFieldInt64::buildSubPart;
290 %newobject MEDCoupling::MEDCouplingFieldInt64::buildSubPartRange;
291 %newobject MEDCoupling::MEDCouplingFieldInt64::__getitem__;
292 %newobject MEDCoupling::MEDCouplingFieldFloat::New;
293 %newobject MEDCoupling::MEDCouplingFieldFloat::convertToDblField;
294 %newobject MEDCoupling::MEDCouplingFieldFloat::getArray;
295 %newobject MEDCoupling::MEDCouplingFieldFloat::deepCopy;
296 %newobject MEDCoupling::MEDCouplingFieldFloat::clone;
297 %newobject MEDCoupling::MEDCouplingFieldFloat::cloneWithMesh;
298 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPart;
299 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPartRange;
300 %newobject MEDCoupling::MEDCouplingFieldFloat::__getitem__;
301 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
302 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
303 %newobject MEDCoupling::MEDCouplingMesh::clone;
304 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
305 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
306 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
307 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
308 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
309 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
310 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
311 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
312 %newobject MEDCoupling::MEDCouplingMesh::computeMeshCenterOfMass;
313 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
314 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
315 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
316 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
317 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
318 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
319 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
320 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
321 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
322 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
323 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
324 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
325 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
326 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
327 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
328 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
329 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
330 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
331 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
332 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
333 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
334 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
335 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
336 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
337 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
338 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
339 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
340 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
341 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
342 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
343 %newobject MEDCoupling::MEDCouplingUMesh::New;
344 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
345 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
346 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
347 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
348 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
349 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
350 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
351 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
352 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
353 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
354 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
355 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
356 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
357 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
358 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
359 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
360 %newobject MEDCoupling::MEDCouplingUMesh::conformize3D;
361 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
362 %newobject MEDCoupling::MEDCouplingUMesh::colinearizeKeepingConform2D;
363 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
364 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
365 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
366 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
367 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
368 %newobject MEDCoupling::MEDCouplingUMesh::findNodesToDuplicate;
369 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
370 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
371 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
372 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
373 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
374 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
375 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
376 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
377 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
378 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
379 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
380 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
381 %newobject MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords;
382 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
383 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
384 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
385 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
386 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
387 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
388 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
389 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
390 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
391 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
392 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
393 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
394 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
395 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
396 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
397 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
398 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
399 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
400 %newobject MEDCoupling::MEDCouplingUMesh::convertDegeneratedCellsAndRemoveFlatOnes;
401 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
402 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
403 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
404 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
405 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
406 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
407 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
408 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
409 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
410 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
411 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
412 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
413 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
414 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
415 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
416 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
417 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
418 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
419 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
420 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
421 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
422 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
423 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
424 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
425 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
426 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
427 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
428 %newobject MEDCoupling::MEDCouplingCMesh::New;
429 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
430 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
431 %newobject MEDCoupling::MEDCouplingIMesh::New;
432 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
433 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
434 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
435 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
436 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
437 %newobject MEDCoupling::MEDCouplingMultiFields::New;
438 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
439 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
440 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
441 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
442 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
443 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
444 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
445 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
446 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
447 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
448 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
449 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
450 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
451 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
452 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
453 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
454 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
455 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
456 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
457 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
458 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
459 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
460 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
461 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
462 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
463 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
464 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
465 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
466 %newobject MEDCoupling::DenseMatrix::New;
467 %newobject MEDCoupling::DenseMatrix::deepCopy;
468 %newobject MEDCoupling::DenseMatrix::shallowCpy;
469 %newobject MEDCoupling::DenseMatrix::getData;
470 %newobject MEDCoupling::DenseMatrix::matVecMult;
471 %newobject MEDCoupling::DenseMatrix::MatVecMult;
472 %newobject MEDCoupling::DenseMatrix::__add__;
473 %newobject MEDCoupling::DenseMatrix::__sub__;
474 %newobject MEDCoupling::DenseMatrix::__mul__;
475 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
476 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
477 %newobject MEDCoupling::MEDCouplingSkyLineArray::BuildFromPolyhedronConn;
478 %newobject MEDCoupling::MEDCouplingSkyLineArray::getSuperIndexArray;
479 %newobject MEDCoupling::MEDCouplingSkyLineArray::getIndexArray;
480 %newobject MEDCoupling::MEDCouplingSkyLineArray::getValuesArray;
481 %newobject MEDCoupling::MEDCouplingSkyLineArray::groupPacks;
482 %newobject MEDCoupling::MEDCouplingSkyLineArray::uniqueNotSortedByPack;
483 %newobject MEDCoupling::MEDCouplingSkyLineArray::AggregatePacks;
484 %newobject MEDCoupling::MEDCouplingSkyLineArray::deepCopy;
486 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
487 %feature("unref") MEDCouplingMesh "$this->decrRef();"
488 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
489 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
490 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
491 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
492 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
493 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
494 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
495 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
496 %feature("unref") MEDCouplingField "$this->decrRef();"
497 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
498 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
499 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
500 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
501 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
502 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
503 %feature("unref") MEDCouplingFieldFloat "$this->decrRef();"
504 %feature("unref") MEDCouplingFieldInt32 "$this->decrRef();"
505 %feature("unref") MEDCouplingFieldInt64 "$this->decrRef();"
506 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
507 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
508 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
509 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
510 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
511 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
512 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
513 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
514 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
515 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
516 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
517 %feature("unref") DenseMatrix "$this->decrRef();"
518 %feature("unref") MEDCouplingSkyLineArray "$this->decrRef();"
520 %rename(assign) *::operator=;
521 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
522 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
523 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
524 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
528 // ABN: Instruct SWIG that INTERP_KERNEL::Exception is an exception class and that it should inherit Exception
529 // on the Python side. Must be put BEFORE the %rename clause:
530 %exceptionclass INTERP_KERNEL::Exception;
531 %rename (InterpKernelException) INTERP_KERNEL::Exception;
533 %include "MEDCouplingRefCountObject.i"
534 %include "MEDCouplingMemArray.i"
538 {// AGY : here initialization of C++ traits in MEDCouplingDataArrayTypemaps.i for code factorization. Awful, I know, but no other solutions.
539 SWIGTITraits<double>::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble;
540 SWIGTITraits<float>::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat;
541 SWIGTITraits<Int32>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt32;
542 SWIGTITraits<Int64>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt64;
543 SWIGTITraits<double>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple;
544 SWIGTITraits<float>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayFloatTuple;
545 SWIGTITraits<Int32>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayInt32Tuple;
546 SWIGTITraits<Int64>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayInt64Tuple;
552 PyObject *med2vtk_cell_types()
554 Py_ssize_t sz(sizeof(MEDCOUPLING2VTKTYPETRADUCER)/sizeof(decltype(MEDCOUPLING2VTKTYPETRADUCER[0])));
555 PyObject *ret(PyList_New(sz));
556 for(Py_ssize_t i=0;i<sz;i++)
558 mcIdType elt = MEDCOUPLING2VTKTYPETRADUCER[i]!=MEDCOUPLING2VTKTYPETRADUCER_NONE ? MEDCOUPLING2VTKTYPETRADUCER[i] : -1;
559 PyList_SetItem(ret,i,PyInt_FromLong(elt));
564 PyObject *vtk2med_cell_types()
566 Py_ssize_t sz(sizeof(MEDCOUPLING2VTKTYPETRADUCER)/sizeof(decltype(MEDCOUPLING2VTKTYPETRADUCER[0])));
567 auto maxElt(*std::max_element(MEDCOUPLING2VTKTYPETRADUCER,MEDCOUPLING2VTKTYPETRADUCER+sz,[](unsigned char a, unsigned char b) { if(b==MEDCOUPLING2VTKTYPETRADUCER_NONE) return false; else return a<b; } ));
568 auto szOut(maxElt+1);
569 std::vector< mcIdType > retCpp(szOut,-1);
571 for(const unsigned char *it=MEDCOUPLING2VTKTYPETRADUCER;it!=MEDCOUPLING2VTKTYPETRADUCER+sz;it++,id++)
573 if(*it!=MEDCOUPLING2VTKTYPETRADUCER_NONE)
577 PyObject *ret(PyList_New(szOut));
579 for(auto it=retCpp.begin();it!=retCpp.end();it++,id++)
580 PyList_SetItem(ret,id,PyInt_FromLong(*it));
584 PyObject *AllGeometricTypes()
586 Py_ssize_t sz(MEDCouplingUMesh::N_MEDMEM_ORDER);
587 PyObject *ret(PyList_New(sz));
588 for(Py_ssize_t i=0;i<sz;i++)
589 PyList_SetItem(ret,i,PyInt_FromLong(MEDCouplingUMesh::MEDMEM_ORDER[i]));
594 namespace INTERP_KERNEL
597 * \class BoxSplittingOptions
598 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
600 class BoxSplittingOptions
603 BoxSplittingOptions();
605 double getEfficiencyGoal() const;
606 void setEfficiencyGoal(double efficiency);
607 double getEfficiencyThreshold() const;
608 void setEfficiencyThreshold(double efficiencyThreshold);
609 int getMinimumPatchLength() const;
610 void setMinimumPatchLength(int minPatchLength);
611 int getMaximumPatchLength() const;
612 void setMaximumPatchLength(int maxPatchLength);
613 int getMaximumNbOfCellsInPatch() const;
614 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch);
615 void copyOptions(const BoxSplittingOptions & other);
616 std::string printOptions() const;
619 std::string __str__() const
621 return self->printOptions();
627 namespace MEDCoupling
643 CONST_ON_TIME_INTERVAL = 7
644 } TypeOfTimeDiscretization;
652 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
653 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
655 } MEDCouplingMeshType;
657 class DataArrayInt32;
658 class DataArrayInt64;
659 class DataArrayDouble;
660 class MEDCouplingUMesh;
661 class MEDCouplingCMesh;
662 class MEDCouplingFieldDouble;
664 %extend RefCountObject
666 std::string getHiddenCppPointer() const
668 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
673 %extend MEDCouplingGaussLocalization
675 std::string __str__() const
677 return self->getStringRepr();
680 std::string __repr__() const
682 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
683 oss << self->getStringRepr();
690 class MEDCouplingMesh : public RefCountObject, public TimeLabel
693 void setName(const std::string& name);
694 std::string getName() const;
695 void setDescription(const std::string& descr);
696 std::string getDescription() const;
697 void setTime(double val, int iteration, int order);
698 void setTimeUnit(const std::string& unit);
699 std::string getTimeUnit() const;
700 virtual MEDCouplingMeshType getType() const;
701 bool isStructured() const;
702 virtual MEDCouplingMesh *deepCopy() const;
703 virtual MEDCouplingMesh *clone(bool recDeepCpy) const;
704 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const;
705 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
706 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const;
707 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other);
708 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other);
709 virtual void checkConsistencyLight() const;
710 virtual void checkConsistency(double eps=1e-12) const;
711 virtual int getNumberOfCells() const;
712 virtual int getNumberOfNodes() const;
713 virtual int getSpaceDimension() const;
714 virtual int getMeshDimension() const;
715 virtual DataArrayDouble *getCoordinatesAndOwner() const;
716 virtual DataArrayDouble *computeCellCenterOfMass() const;
717 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
718 virtual DataArrayIdType *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
719 virtual DataArrayIdType *computeNbOfNodesPerCell() const;
720 virtual DataArrayIdType *computeNbOfFacesPerCell() const;
721 virtual DataArrayIdType *computeEffectiveNbOfNodesPerCell() const;
722 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const;
723 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
724 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
725 virtual std::string simpleRepr() const;
726 virtual std::string advancedRepr() const;
727 std::string writeVTK(const std::string& fileName, bool isBinary=true) const;
728 virtual std::string getVTKFileExtension() const;
729 std::string getVTKFileNameOf(const std::string& fileName) const;
731 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const;
732 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const;
733 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const;
734 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const;
735 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const;
736 virtual MEDCouplingFieldDouble *buildOrthogonalField() const;
737 virtual MEDCouplingUMesh *buildUnstructured() const;
738 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
739 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const;
740 virtual DataArrayIdType *simplexize(int policy);
741 virtual void unserialization(const std::vector<double>& tinyInfoD, const std::vector<mcIdType>& tinyInfo, const DataArrayIdType *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings);
742 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2);
743 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type);
744 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type);
745 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type);
746 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
747 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
748 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
751 std::string __str__() const
753 return self->simpleRepr();
756 DataArrayDouble *computeMeshCenterOfMass() const
758 MCAuto<DataArrayDouble> ret(self->computeMeshCenterOfMass());
765 double tmp0=self->getTime(tmp1,tmp2);
766 PyObject *res = PyList_New(3);
767 PyList_SetItem(res,0,SWIG_From_double(tmp0));
768 PyList_SetItem(res,1,SWIG_From_int(tmp1));
769 PyList_SetItem(res,2,SWIG_From_int(tmp2));
773 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const
775 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
776 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
782 mcIdType getCellContainingPoint(PyObject *p, double eps) const
786 DataArrayDoubleTuple *aa;
787 std::vector<double> bb;
789 int spaceDim=self->getSpaceDimension();
790 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
791 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
792 return self->getCellContainingPoint(pos,eps);
795 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const
799 DataArrayDoubleTuple *aa;
800 std::vector<double> bb;
802 int spaceDim=self->getSpaceDimension();
803 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
804 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
805 MCAuto<DataArrayIdType> elts,eltsIndex;
806 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
807 PyObject *ret=PyTuple_New(2);
808 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
809 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
813 PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, int nbOfPoints, double eps) const
817 DataArrayDoubleTuple *aa;
818 std::vector<double> bb;
820 int spaceDim=self->getSpaceDimension();
821 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPointsLinearPartOnlyOnNonDynType : ";
822 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
823 MCAuto<DataArrayIdType> elts,eltsIndex;
824 self->getCellsContainingPointsLinearPartOnlyOnNonDynType(pos,nbOfPoints,eps,elts,eltsIndex);
825 PyObject *ret=PyTuple_New(2);
826 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
827 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
831 PyObject *getCellsContainingPoints(PyObject *p, double eps) const
833 auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayIdType>& d, MCAuto<DataArrayIdType>& e) { self->getCellsContainingPoints(a,b,c,d,e); };
834 return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
837 PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, double eps) const
839 auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayIdType>& d, MCAuto<DataArrayIdType>& e) { self->getCellsContainingPointsLinearPartOnlyOnNonDynType(a,b,c,d,e); };
840 return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
843 PyObject *getCellsContainingPoint(PyObject *p, double eps) const
847 DataArrayDoubleTuple *aa;
848 std::vector<double> bb;
850 int spaceDim=self->getSpaceDimension();
851 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
852 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
853 std::vector<mcIdType> elts;
854 self->getCellsContainingPoint(pos,eps,elts);
855 DataArrayIdType *ret=DataArrayIdType::New();
856 ret->alloc((int)elts.size(),1);
857 std::copy(elts.begin(),elts.end(),ret->getPointer());
858 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
861 virtual PyObject *getReverseNodalConnectivity() const
863 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
864 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
865 self->getReverseNodalConnectivity(d0,d1);
866 PyObject *ret=PyTuple_New(2);
867 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
868 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
872 void renumberCells(PyObject *li, bool check=true)
875 mcIdType v0; std::vector<mcIdType> v1;
876 const mcIdType *ids(convertIntStarLikePyObjToCppIntStar(li,sw,sz,v0,v1));
877 self->renumberCells(ids,check);
880 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const
882 DataArrayIdType *cellCor, *nodeCor;
883 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
884 PyObject *res = PyList_New(2);
885 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTITraits<mcIdType>::TI, cellCor?SWIG_POINTER_OWN | 0:0 ));
886 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTITraits<mcIdType>::TI, nodeCor?SWIG_POINTER_OWN | 0:0 ));
890 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const
892 DataArrayIdType *cellCor=0,*nodeCor=0;
893 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
894 PyObject *res = PyList_New(2);
895 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTITraits<mcIdType>::TI, cellCor?SWIG_POINTER_OWN | 0:0 ));
896 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTITraits<mcIdType>::TI, nodeCor?SWIG_POINTER_OWN | 0:0 ));
900 DataArrayIdType *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const
902 DataArrayIdType *cellCor=0;
903 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
907 DataArrayIdType *getCellIdsFullyIncludedInNodeIds(PyObject *li) const
910 int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
911 if (!SWIG_IsOK(res1))
914 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
915 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const mcIdType *)tmp)+size);
919 DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
921 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
922 da2->checkAllocated();
923 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
926 PyObject *getNodeIdsOfCell(int cellId) const
928 std::vector<mcIdType> conn;
929 self->getNodeIdsOfCell(cellId,conn);
930 return convertIntArrToPyList2(conn);
933 PyObject *getCoordinatesOfNode(mcIdType nodeId) const
935 std::vector<double> coo;
936 self->getCoordinatesOfNode(nodeId,coo);
937 return convertDblArrToPyList2(coo);
940 void scale(PyObject *point, double factor)
944 DataArrayDoubleTuple *aa;
945 std::vector<double> bb;
947 int spaceDim=self->getSpaceDimension();
948 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
949 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
950 self->scale(pointPtr,factor);
953 PyObject *getBoundingBox() const
955 int spaceDim=self->getSpaceDimension();
956 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
957 self->getBoundingBox(tmp);
958 PyObject *ret=convertDblArrToPyListOfTuple<double>(tmp,2,spaceDim);
962 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const
965 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
966 PyObject *ret=PyTuple_New(2);
967 PyObject *ret0Py=ret0?Py_True:Py_False;
969 PyTuple_SetItem(ret,0,ret0Py);
970 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
974 PyObject *buildPart(PyObject *li) const
976 mcIdType szArr,sw,iTypppArr;
977 std::vector<mcIdType> stdvecTyyppArr;
978 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
979 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
980 if(sw==3)//DataArrayIdType
982 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
983 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
984 std::string name=argpt->getName();
986 ret->setName(name.c_str());
988 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
991 PyObject *buildPartAndReduceNodes(PyObject *li) const
993 mcIdType szArr,sw,iTypppArr;
994 std::vector<mcIdType> stdvecTyyppArr;
995 DataArrayIdType *arr=0;
996 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
997 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
998 if(sw==3)//DataArrayIdType
1000 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1001 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1002 std::string name=argpt->getName();
1004 ret->setName(name.c_str());
1007 PyObject *res = PyList_New(2);
1008 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
1009 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1010 PyList_SetItem(res,0,obj0);
1011 PyList_SetItem(res,1,obj1);
1015 PyObject *buildPartRangeAndReduceNodes(mcIdType beginCellIds, mcIdType endCellIds, mcIdType stepCellIds) const
1018 DataArrayIdType *arr=0;
1019 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
1020 PyObject *res = PyTuple_New(2);
1021 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
1024 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1026 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
1027 PyTuple_SetItem(res,0,obj0);
1028 PyTuple_SetItem(res,1,obj1);
1032 PyObject *getDistributionOfTypes() const
1034 std::vector<mcIdType> vals=self->getDistributionOfTypes();
1035 if(vals.size()%3!=0)
1036 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
1037 PyObject *ret=PyList_New((mcIdType)vals.size()/3);
1038 for(std::size_t j=0;j<vals.size()/3;j++)
1040 PyObject *ret1=PyList_New(3);
1041 PyList_SetItem(ret1,0,PyInt_FromLong(vals[3*j]));
1042 PyList_SetItem(ret1,1,PyInt_FromLong(vals[3*j+1]));
1043 PyList_SetItem(ret1,2,PyInt_FromLong(vals[3*j+2]));
1044 PyList_SetItem(ret,j,ret1);
1049 DataArrayIdType *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const
1051 std::vector<mcIdType> code;
1052 std::vector<const DataArrayIdType *> idsPerType;
1053 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li2,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",idsPerType);
1054 convertPyToNewIntArr4(li,1,3,code);
1055 return self->checkTypeConsistencyAndContig(code,idsPerType);
1058 PyObject *splitProfilePerType(const DataArrayIdType *profile, bool smartPflKiller=true) const
1060 std::vector<mcIdType> code;
1061 std::vector<DataArrayIdType *> idsInPflPerType;
1062 std::vector<DataArrayIdType *> idsPerType;
1063 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType,smartPflKiller);
1064 PyObject *ret=PyTuple_New(3);
1066 if(code.size()%3!=0)
1067 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
1068 PyObject *ret0=PyList_New((mcIdType)code.size()/3);
1069 for(std::size_t j=0;j<code.size()/3;j++)
1071 PyObject *ret00=PyList_New(3);
1072 PyList_SetItem(ret00,0,PyInt_FromLong(code[3*j]));
1073 PyList_SetItem(ret00,1,PyInt_FromLong(code[3*j+1]));
1074 PyList_SetItem(ret00,2,PyInt_FromLong(code[3*j+2]));
1075 PyList_SetItem(ret0,j,ret00);
1077 PyTuple_SetItem(ret,0,ret0);
1079 PyObject *ret1=PyList_New(idsInPflPerType.size());
1080 for(std::size_t j=0;j<idsInPflPerType.size();j++)
1081 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1082 PyTuple_SetItem(ret,1,ret1);
1083 std::size_t n=idsPerType.size();
1084 PyObject *ret2=PyList_New(n);
1085 for(std::size_t i=0;i<n;i++)
1086 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1087 PyTuple_SetItem(ret,2,ret2);
1091 void translate(PyObject *vector)
1095 DataArrayDoubleTuple *aa;
1096 std::vector<double> bb;
1098 int spaceDim=self->getSpaceDimension();
1099 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1100 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1101 self->translate(vectorPtr);
1104 void rotate(PyObject *center, double alpha)
1106 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1109 DataArrayDoubleTuple *aa;
1110 std::vector<double> bb;
1112 int spaceDim=self->getSpaceDimension();
1113 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1114 self->rotate(centerPtr,0,alpha);
1117 void rotate(PyObject *center, PyObject *vector, double alpha)
1119 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1121 DataArrayDouble *a,*a2;
1122 DataArrayDoubleTuple *aa,*aa2;
1123 std::vector<double> bb,bb2;
1125 int spaceDim=self->getSpaceDimension();
1126 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1127 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,spaceDim,false);//vectorPtr can be null in case of space dim 2
1128 self->rotate(centerPtr,vectorPtr,alpha);
1131 PyObject *getAllGeoTypes() const
1133 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1134 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1135 PyObject *res=PyList_New(result.size());
1136 for(int i=0;iL!=result.end(); i++, iL++)
1137 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1141 virtual PyObject *getTinySerializationInformation() const
1143 std::vector<double> a0;
1144 std::vector<mcIdType> a1;
1145 std::vector<std::string> a2;
1146 self->getTinySerializationInformation(a0,a1,a2);
1147 PyObject *ret(PyTuple_New(3));
1148 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1149 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1150 std::size_t sz(a2.size());
1151 PyObject *ret2(PyList_New(sz));
1153 for(std::size_t i=0;i<sz;i++)
1154 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1156 PyTuple_SetItem(ret,2,ret2);
1160 virtual PyObject *serialize() const
1162 DataArrayIdType *a0Tmp(0);
1163 DataArrayDouble *a1Tmp(0);
1164 self->serialize(a0Tmp,a1Tmp);
1165 PyObject *ret(PyTuple_New(2));
1166 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1167 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1171 void resizeForUnserialization(const std::vector<mcIdType>& tinyInfo, DataArrayIdType *a1, DataArrayDouble *a2) const
1173 std::vector<std::string> littleStrings;
1174 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1177 PyObject *__getstate__() const
1179 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1180 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1181 PyObject *ret(PyTuple_New(2));
1182 PyTuple_SetItem(ret,0,ret0);
1183 PyTuple_SetItem(ret,1,ret1);
1187 void __setstate__(PyObject *inp)
1189 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1190 if(!PyTuple_Check(inp))
1191 throw INTERP_KERNEL::Exception(MSG);
1192 std::size_t sz(PyTuple_Size(inp));
1194 throw INTERP_KERNEL::Exception(MSG);
1195 PyObject *elt0(PyTuple_GetItem(inp,0));
1196 PyObject *elt1(PyTuple_GetItem(inp,1));
1197 std::vector<double> a0;
1198 std::vector<mcIdType> a1;
1199 std::vector<std::string> a2;
1200 DataArrayIdType *b0(0);
1201 DataArrayDouble *b1(0);
1203 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1204 throw INTERP_KERNEL::Exception(MSG);
1205 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1207 fillArrayWithPyListDbl3(a0py,tmp,a0);
1208 convertPyToNewIntArr3(a1py,a1);
1209 fillStringVector(a2py,a2);
1212 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1213 throw INTERP_KERNEL::Exception(MSG);
1214 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1216 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTITraits<mcIdType>::TI,0|0));
1217 if(!SWIG_IsOK(status))
1218 throw INTERP_KERNEL::Exception(MSG);
1219 b0=reinterpret_cast<DataArrayIdType *>(argp);
1220 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1221 if(!SWIG_IsOK(status))
1222 throw INTERP_KERNEL::Exception(MSG);
1223 b1=reinterpret_cast<DataArrayDouble *>(argp);
1225 // useless here to call resizeForUnserialization because arrays are well resized.
1226 self->unserialization(a0,a1,b0,b1,a2);
1229 static MEDCouplingMesh *MergeMeshes(PyObject *li)
1231 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1232 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1233 return MEDCouplingMesh::MergeMeshes(tmp);
1239 //== MEDCouplingMesh End
1241 %include "NormalizedGeometricTypes"
1242 %include "MEDCouplingNatureOfFieldEnum"
1244 namespace MEDCoupling
1246 class MEDCouplingNatureOfField
1249 static const char *GetRepr(NatureOfField nat);
1250 static std::string GetReprNoThrow(NatureOfField nat);
1251 static std::string GetAllPossibilitiesStr();
1255 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1256 // include "MEDCouplingTimeDiscretization.i"
1258 namespace MEDCoupling
1260 class MEDCouplingGaussLocalization
1263 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1264 const std::vector<double>& gsCoo, const std::vector<double>& w);
1265 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ);
1266 INTERP_KERNEL::NormalizedCellType getType() const;
1267 void setType(INTERP_KERNEL::NormalizedCellType typ);
1268 int getNumberOfGaussPt() const;
1269 int getDimension() const;
1270 int getNumberOfPtsInRefCell() const;
1271 std::string getStringRepr() const;
1272 void checkConsistencyLight() const;
1273 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const;
1275 const std::vector<double>& getRefCoords() const;
1276 double getRefCoord(int ptIdInCell, int comp) const;
1277 const std::vector<double>& getGaussCoords() const;
1278 double getGaussCoord(int gaussPtIdInCell, int comp) const;
1279 const std::vector<double>& getWeights() const;
1280 double getWeight(int gaussPtIdInCell, double newVal) const;
1281 void setRefCoord(int ptIdInCell, int comp, double newVal);
1282 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal);
1283 void setWeight(int gaussPtIdInCell, double newVal);
1284 void setRefCoords(const std::vector<double>& refCoo);
1285 void setGaussCoords(const std::vector<double>& gsCoo);
1286 void setWeights(const std::vector<double>& w);
1288 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1292 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const
1294 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1298 MEDCouplingUMesh *buildRefCell() const
1300 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1306 class MEDCouplingSkyLineArray
1309 static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayIdType* c, const DataArrayIdType* cI );
1311 void set( DataArrayIdType* index, DataArrayIdType* value );
1312 void set3( DataArrayIdType* superIndex, DataArrayIdType* index, DataArrayIdType* value );
1314 int getSuperNumberOf() const;
1315 int getNumberOf() const;
1316 int getLength() const;
1318 void deletePack(const int i, const int j);
1320 void deleteSimplePack(const int i);
1321 void deleteSimplePacks(const DataArrayIdType* idx);
1323 MEDCouplingSkyLineArray *groupPacks(const DataArrayIdType *indexedPacks) const;
1324 MEDCouplingSkyLineArray *uniqueNotSortedByPack() const;
1326 MEDCouplingSkyLineArray *deepCopy() const;
1330 MEDCouplingSkyLineArray()
1332 return MEDCouplingSkyLineArray::New();
1335 MEDCouplingSkyLineArray( const std::vector<mcIdType>& index, const std::vector<mcIdType>& value)
1337 return MEDCouplingSkyLineArray::New(index, value);
1340 MEDCouplingSkyLineArray( DataArrayIdType* index, DataArrayIdType* value )
1342 return MEDCouplingSkyLineArray::New(index, value);
1345 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other )
1347 return MEDCouplingSkyLineArray::New(other);
1350 std::string __str__() const
1352 return self->simpleRepr();
1355 DataArrayIdType *getSuperIndexArray() const
1357 DataArrayIdType *ret(self->getSuperIndexArray());
1363 DataArrayIdType *getIndexArray() const
1365 DataArrayIdType *ret(self->getIndexArray());
1371 DataArrayIdType *getValuesArray() const
1373 DataArrayIdType *ret(self->getValuesArray());
1379 PyObject *getSimplePackSafe(mcIdType absolutePackId) const
1381 std::vector<mcIdType> ret;
1382 self->getSimplePackSafe(absolutePackId,ret);
1383 return convertIntArrToPyList2(ret);
1386 PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const
1388 std::vector<mcIdType> vpack, vspIdx, out;
1390 convertPyToNewIntArr3(superPackIndices,vspIdx);
1391 convertPyToNewIntArr3(pack,vpack);
1393 self->findPackIds(vspIdx, vpack.data(), vpack.data()+vpack.size(), out);
1394 return convertIntArrToPyList2(out);
1397 void pushBackPack(const mcIdType i, PyObject *pack)
1399 std::vector<mcIdType> vpack;
1400 convertPyToNewIntArr3(pack,vpack);
1401 self->pushBackPack(i,vpack.data(), vpack.data()+vpack.size());
1404 void replaceSimplePack(const mcIdType idx, PyObject *pack)
1406 std::vector<mcIdType> vpack;
1407 convertPyToNewIntArr3(pack,vpack);
1408 self->replaceSimplePack(idx, vpack.data(), vpack.data()+vpack.size());
1411 void replaceSimplePacks(const DataArrayIdType* idx, PyObject *listePacks)
1413 std::vector<const DataArrayIdType*> packs;
1414 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType*>(listePacks,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",packs);
1415 self->replaceSimplePacks(idx, packs);
1418 static MEDCouplingSkyLineArray *AggregatePacks(PyObject *sks)
1420 std::vector<const MEDCouplingSkyLineArray *> sksCpp;
1421 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingSkyLineArray*>(sks,SWIGTYPE_p_MEDCoupling__MEDCouplingSkyLineArray,"MEDCouplingSkyLineArray",sksCpp);
1422 return MEDCoupling::MEDCouplingSkyLineArray::AggregatePacks(sksCpp);
1425 void replacePack(const mcIdType superIdx, const mcIdType idx, PyObject *pack)
1427 std::vector<mcIdType> vpack;
1428 convertPyToNewIntArr3(pack,vpack);
1429 self->replacePack(superIdx, idx, vpack.data(), vpack.data()+vpack.size());
1432 PyObject *convertToPolyhedronConn() const
1434 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
1435 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
1436 self->convertToPolyhedronConn(d0,d1);
1437 PyObject *ret=PyTuple_New(2);
1438 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1439 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1443 PyObject *thresholdPerPack(mcIdType threshold) const
1445 MCAuto<MEDCouplingSkyLineArray> left, right;
1446 self->thresholdPerPack(threshold,left,right);
1447 PyObject *ret=PyTuple_New(2);
1448 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(left.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingSkyLineArray, SWIG_POINTER_OWN | 0 ));
1449 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(right.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingSkyLineArray, SWIG_POINTER_OWN | 0 ));
1456 %include "MEDCouplingFieldDiscretization.i"
1458 //== MEDCouplingPointSet
1460 namespace MEDCoupling
1462 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1465 void setCoords(const DataArrayDouble *coords);
1466 DataArrayDouble *getCoordinatesAndOwner() const;
1467 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const;
1469 double getCaracteristicDimension() const;
1470 void recenterForMaxPrecision(double eps);
1471 void changeSpaceDimension(int newSpaceDim, double dftVal=0.);
1472 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon);
1473 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other);
1474 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const;
1475 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon);
1476 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2);
1477 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type);
1478 static DataArrayIdType *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps);
1479 virtual DataArrayIdType *computeFetchedNodeIds() const;
1480 virtual int getNumberOfNodesInCell(int cellId) const;
1481 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const;
1482 virtual DataArrayIdType *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps);
1483 virtual DataArrayIdType *zipCoordsTraducer();
1484 virtual DataArrayIdType *findBoundaryNodes() const;
1485 virtual DataArrayIdType *zipConnectivityTraducer(int compType, int startCellId=0);
1486 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const;
1487 virtual void checkFullyDefined() const;
1488 virtual bool isEmptyMesh(const std::vector<mcIdType>& tinyInfo) const;
1489 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const;
1490 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const;
1491 virtual void renumberNodesWithOffsetInConn(int offset);
1492 virtual bool areAllNodesFetched() const;
1493 virtual MEDCouplingFieldDouble *computeDiameterField() const;
1494 virtual void invertOrientationOfAllCells();
1497 std::string __str__() const
1499 return self->simpleRepr();
1502 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayIdType *comm, const DataArrayIdType *commIndex) const
1504 mcIdType newNbOfNodes;
1505 DataArrayIdType *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1506 PyObject *res = PyList_New(2);
1507 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1508 PyList_SetItem(res,1,PyInt_FromLong(newNbOfNodes));
1512 PyObject *findCommonNodes(double prec, mcIdType limitTupleId=-1) const
1514 DataArrayIdType *comm, *commIndex;
1515 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1516 PyObject *res = PyList_New(2);
1517 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1518 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1522 PyObject *getCoords()
1524 DataArrayDouble *ret1=self->getCoords();
1527 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1530 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const
1532 mcIdType szArr,sw,iTypppArr;
1533 std::vector<mcIdType> stdvecTyyppArr;
1534 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1535 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1536 if(sw==3)//DataArrayIdType
1538 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1539 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1540 std::string name=argpt->getName();
1542 ret->setName(name.c_str());
1544 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1547 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const
1549 mcIdType szArr,sw,iTypppArr;
1550 std::vector<mcIdType> stdvecTyyppArr;
1551 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1552 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1553 if(sw==3)//DataArrayIdType
1555 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1556 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1557 std::string name=argpt->getName();
1559 ret->setName(name.c_str());
1561 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1564 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const
1566 mcIdType szArr,sw,iTypppArr;
1567 std::vector<mcIdType> stdvecTyyppArr;
1568 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1569 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1570 if(sw==3)//DataArrayIdType
1572 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1573 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1574 std::string name=argpt->getName();
1576 ret->setName(name.c_str());
1578 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1581 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(mcIdType start, mcIdType end, mcIdType step) const
1583 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1584 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1587 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const
1589 mcIdType szArr,sw,iTypppArr;
1590 std::vector<mcIdType> stdvecTyyppArr;
1591 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1592 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1593 if(sw==3)//DataArrayIdType
1595 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1596 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1597 std::string name=argpt->getName();
1599 ret->setName(name.c_str());
1601 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1604 void renumberNodes(PyObject *li, mcIdType newNbOfNodes)
1606 mcIdType szArr,sw,iTypppArr;
1607 std::vector<mcIdType> stdvecTyyppArr;
1608 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1609 self->renumberNodes(tmp,newNbOfNodes);
1612 void renumberNodesCenter(PyObject *li, mcIdType newNbOfNodes)
1614 mcIdType szArr,sw,iTypppArr;
1615 std::vector<mcIdType> stdvecTyyppArr;
1616 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1617 self->renumberNodesCenter(tmp,newNbOfNodes);
1620 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const
1622 int spaceDim=self->getSpaceDimension();
1624 DataArrayDouble *a,*a2;
1625 DataArrayDoubleTuple *aa,*aa2;
1626 std::vector<double> bb,bb2;
1628 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st parameter for point.";
1629 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd parameter for vector.";
1630 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1631 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1632 std::vector<mcIdType> nodes;
1633 self->findNodesOnLine(p,v,eps,nodes);
1634 DataArrayIdType *ret=DataArrayIdType::New();
1635 ret->alloc(nodes.size(),1);
1636 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1637 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1639 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const
1641 int spaceDim=self->getSpaceDimension();
1643 DataArrayDouble *a,*a2;
1644 DataArrayDoubleTuple *aa,*aa2;
1645 std::vector<double> bb,bb2;
1647 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st parameter for point.";
1648 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd parameter for vector.";
1649 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1650 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1651 std::vector<mcIdType> nodes;
1652 self->findNodesOnPlane(p,v,eps,nodes);
1653 DataArrayIdType *ret=DataArrayIdType::New();
1654 ret->alloc(nodes.size(),1);
1655 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1656 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1659 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const
1663 DataArrayDoubleTuple *aa;
1664 std::vector<double> bb;
1666 int spaceDim=self->getSpaceDimension();
1667 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1668 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1669 DataArrayIdType *ret=self->getNodeIdsNearPoint(pos,eps);
1670 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1673 PyObject *getNodeIdsNearPoints(PyObject *pt, mcIdType nbOfPoints, double eps) const
1675 DataArrayIdType *c=0,*cI=0;
1679 DataArrayDoubleTuple *aa;
1680 std::vector<double> bb;
1682 int spaceDim=self->getSpaceDimension();
1683 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1684 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1685 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1686 PyObject *ret=PyTuple_New(2);
1687 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1688 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1692 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const
1694 DataArrayIdType *c=0,*cI=0;
1695 int spaceDim=self->getSpaceDimension();
1698 DataArrayDoubleTuple *aa;
1699 std::vector<double> bb;
1701 mcIdType nbOfTuples=-1;
1702 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1703 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1705 PyObject *ret=PyTuple_New(2);
1706 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1707 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1711 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const
1715 DataArrayDoubleTuple *aa;
1716 std::vector<double> bb;
1718 int spaceDim=self->getSpaceDimension();
1719 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1720 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1722 DataArrayIdType *elems=self->getCellsInBoundingBox(tmp,eps);
1723 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1726 void duplicateNodesInCoords(PyObject *li)
1730 std::vector<mcIdType> multiVal;
1731 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
1732 MEDCoupling::DataArrayIdType *daIntTyypp=0;
1733 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1737 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1739 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1741 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1743 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
1747 virtual PyObject *findCommonCells(int compType, mcIdType startCellId=0) const
1749 DataArrayIdType *v0(nullptr),*v1(nullptr);
1750 self->findCommonCells(compType,startCellId,v0,v1);
1751 PyObject *res = PyList_New(2);
1752 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1753 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1758 virtual void renumberNodesInConn(PyObject *li)
1762 int res1(SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__MapII, 0 | 0 ));
1765 MapII *da2(reinterpret_cast<MapII *>(da));
1766 self->renumberNodesInConn(da2->data());
1770 int res1(SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 ));
1771 if (!SWIG_IsOK(res1))
1774 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
1775 self->renumberNodesInConn(tmp);
1779 DataArrayIdType *da2(reinterpret_cast< DataArrayIdType * >(da));
1781 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
1782 da2->checkAllocated();
1783 self->renumberNodesInConn(da2->getConstPointer());
1787 virtual PyObject *getNodeIdsInUse() const
1790 DataArrayIdType *ret0=self->getNodeIdsInUse(ret1);
1791 PyObject *ret=PyTuple_New(2);
1792 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1793 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1797 virtual DataArrayIdType *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1799 DataArrayIdType *ret(nullptr);
1801 mcIdType szArr,sw,iTypppArr;
1802 std::vector<mcIdType> stdvecTyyppArr;
1803 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1804 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1808 virtual PyObject *mergeNodes(double precision)
1812 DataArrayIdType *ret0=self->mergeNodes(precision,ret1,ret2);
1813 PyObject *res = PyList_New(3);
1814 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1815 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1816 PyList_SetItem(res,2,PyInt_FromLong(ret2));
1820 virtual PyObject *mergeNodesCenter(double precision)
1824 DataArrayIdType *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1825 PyObject *res = PyList_New(3);
1826 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1827 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1828 PyList_SetItem(res,2,PyInt_FromLong(ret2));
1832 DataArrayIdType *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const
1835 int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
1836 if (!SWIG_IsOK(res1))
1839 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
1840 return self->getCellIdsLyingOnNodes(tmp,((const mcIdType *)tmp)+size,fullyIn);
1844 DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
1846 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
1847 da2->checkAllocated();
1848 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1852 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI)
1856 std::vector<mcIdType> multiVal;
1857 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
1858 MEDCoupling::DataArrayIdType *daIntTyypp=0;
1859 mcIdType nbc=self->getNumberOfCells();
1860 convertIntStarOrSliceLikePyObjToCpp(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1867 std::ostringstream oss;
1868 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1869 throw INTERP_KERNEL::Exception(oss.str().c_str());
1872 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1877 mcIdType tmp=nbc+singleVal;
1878 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1882 std::ostringstream oss;
1883 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1884 throw INTERP_KERNEL::Exception(oss.str().c_str());
1890 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1894 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1899 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1900 daIntTyypp->checkAllocated();
1901 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1904 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayIdType instance !");
1908 static void Rotate2DAlg(PyObject *center, double angle, mcIdType nbNodes, PyObject *coords)
1911 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1912 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1913 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1914 for(mcIdType i=0;i<sz;i++)
1915 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1918 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords)
1921 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1922 mcIdType sw,nbNodes=0;
1923 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1924 std::vector<double> val3;
1925 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1926 "Rotate2DAlg",2,true,nbNodes);
1928 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1929 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1932 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, mcIdType nbNodes, PyObject *coords)
1935 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1936 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1937 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1938 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1939 for(mcIdType i=0;i<sz;i++)
1940 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1943 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords)
1946 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1947 mcIdType sw,nbNodes=0;
1948 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1949 std::vector<double> val3;
1950 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1951 "Rotate3DAlg",3,true,nbNodes);
1953 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1954 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1955 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1960 //== MEDCouplingPointSet End
1962 class MEDCouplingUMeshCell
1965 INTERP_KERNEL::NormalizedCellType getType() const;
1968 std::string __str__() const
1970 return self->repr();
1973 PyObject *getAllConn() const
1976 const mcIdType *r=self->getAllConn(ret2);
1977 PyObject *ret=PyTuple_New(ret2);
1978 for(mcIdType i=0;i<ret2;i++)
1979 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1985 class MEDCouplingUMeshCellIterator
1992 MEDCouplingUMeshCell *ret=self->nextt();
1994 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1997 PyErr_SetString(PyExc_StopIteration,"No more data.");
2004 class MEDCouplingUMeshCellByTypeIterator
2007 ~MEDCouplingUMeshCellByTypeIterator();
2012 MEDCouplingUMeshCellEntry *ret=self->nextt();
2014 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
2017 PyErr_SetString(PyExc_StopIteration,"No more data.");
2024 class MEDCouplingUMeshCellByTypeEntry
2027 ~MEDCouplingUMeshCellByTypeEntry();
2030 MEDCouplingUMeshCellByTypeIterator *__iter__()
2032 return self->iterator();
2037 class MEDCouplingUMeshCellEntry
2040 INTERP_KERNEL::NormalizedCellType getType() const;
2041 int getNumberOfElems() const;
2044 MEDCouplingUMeshCellIterator *__iter__()
2046 return self->iterator();
2051 //== MEDCouplingUMesh
2053 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
2056 static MEDCouplingUMesh *New();
2057 static MEDCouplingUMesh *New(const char *meshName, int meshDim);
2058 void checkConsistencyLight() const;
2059 void checkGeomConsistency(double eps=1e-12) const;
2060 void setMeshDimension(int meshDim);
2061 void allocateCells(int nbOfCells=0);
2062 void finishInsertingCells();
2063 MEDCouplingUMeshCellByTypeEntry *cellsByType();
2064 void setConnectivity(DataArrayIdType *conn, DataArrayIdType *connIndex, bool isComputingTypes=true);
2065 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
2066 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis);
2067 int getNodalConnectivityArrayLen() const;
2068 void computeTypes();
2069 std::string reprConnectivityOfThis() const;
2070 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const;
2072 DataArrayIdType *conformize2D(double eps);
2073 DataArrayIdType *conformize3D(double eps);
2074 DataArrayIdType *colinearize2D(double eps);
2075 DataArrayIdType *colinearizeKeepingConform2D(double eps);
2076 void shiftNodeNumbersInConn(int delta);
2077 std::vector<bool> getQuadraticStatus() const;
2078 DataArrayIdType *findCellIdsOnBoundary() const;
2079 MEDCouplingUMesh *computeSkin() const;
2080 bool checkConsecutiveCellTypes() const;
2081 bool checkConsecutiveCellTypesForMEDFileFrmt() const;
2082 DataArrayIdType *rearrange2ConsecutiveCellTypes();
2083 DataArrayIdType *sortCellsInMEDFileFrmt();
2084 DataArrayIdType *getRenumArrForMEDFileFrmt() const;
2085 DataArrayIdType *convertCellArrayPerGeoType(const DataArrayIdType *da) const;
2086 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2087 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2088 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2089 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2090 void orientCorrectlyPolyhedrons();
2091 bool isPresenceOfQuadratic() const;
2092 bool isFullyQuadratic() const;
2093 MEDCouplingFieldDouble *buildDirectionVectorField() const;
2094 bool isContiguous1D() const;
2095 void tessellate2D(double eps);
2096 void convertQuadraticCellsToLinear();
2097 DataArrayIdType *convertLinearCellsToQuadratic(int conversionType=0);
2098 void convertDegeneratedCells();
2099 DataArrayIdType *convertDegeneratedCellsAndRemoveFlatOnes();
2100 bool removeDegenerated1DCells();
2101 bool areOnlySimplexCells() const;
2102 MEDCouplingFieldDouble *getEdgeRatioField() const;
2103 MEDCouplingFieldDouble *getAspectRatioField() const;
2104 MEDCouplingFieldDouble *getWarpField() const;
2105 MEDCouplingFieldDouble *getSkewField() const;
2106 DataArrayDouble *computePlaneEquationOf3DFaces() const;
2107 DataArrayIdType *convexEnvelop2D();
2108 std::string cppRepr() const;
2109 DataArrayIdType *findAndCorrectBadOriented3DExtrudedCells();
2110 DataArrayIdType *findAndCorrectBadOriented3DCells();
2111 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const;
2112 MEDCouplingSkyLineArray *generateGraph() const;
2113 DataArrayIdType *convertNodalConnectivityToStaticGeoTypeMesh() const;
2114 DataArrayIdType *buildUnionOf2DMesh() const;
2115 DataArrayIdType *buildUnionOf3DMesh() const;
2116 DataArrayIdType *orderConsecutiveCells1D() const;
2117 DataArrayDouble *getBoundingBoxForBBTreeFast() const;
2118 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const;
2119 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const;
2120 void changeOrientationOfCells();
2121 DataArrayDouble *computeCellCenterOfMassWithPrecision(double eps);
2122 int split2DCells(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *subNodesInSeg, const DataArrayIdType *subNodesInSegI, const DataArrayIdType *midOpt=0, const DataArrayIdType *midOptI=0);
2123 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da);
2124 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
2125 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
2126 static DataArrayIdType *ComputeSpreadZoneGradually(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn);
2127 static DataArrayIdType *ComputeRangesFromTypeDistribution(const std::vector<mcIdType>& code);
2131 return MEDCouplingUMesh::New();
2134 MEDCouplingUMesh(const char *meshName, int meshDim)
2136 return MEDCouplingUMesh::New(meshName,meshDim);
2139 std::string __str__() const
2141 return self->simpleRepr();
2144 std::string __repr__() const
2146 std::ostringstream oss;
2147 self->reprQuickOverview(oss);
2151 MEDCouplingUMeshCellIterator *__iter__()
2153 return self->cellIterator();
2156 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da)
2158 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
2162 PyObject *getAllGeoTypesSorted() const
2164 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
2165 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2166 PyObject *res=PyList_New(result.size());
2167 for(int i=0;iL!=result.end(); i++, iL++)
2168 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2172 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
2176 std::vector<mcIdType> multiVal;
2177 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2178 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2179 mcIdType nbc=self->getNumberOfCells();
2180 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2187 std::ostringstream oss;
2188 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2189 throw INTERP_KERNEL::Exception(oss.str().c_str());
2193 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2200 mcIdType tmp=nbc+singleVal;
2201 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2206 std::ostringstream oss;
2207 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2208 throw INTERP_KERNEL::Exception(oss.str().c_str());
2214 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2220 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2221 daIntTyypp->checkAllocated();
2222 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2226 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayIdType instance !");
2230 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
2234 std::vector<mcIdType> multiVal;
2235 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2236 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2237 mcIdType nbc=self->getNumberOfCells();
2238 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2245 std::ostringstream oss;
2246 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2247 throw INTERP_KERNEL::Exception(oss.str().c_str());
2251 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2258 mcIdType tmp=nbc+singleVal;
2259 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2264 std::ostringstream oss;
2265 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2266 throw INTERP_KERNEL::Exception(oss.str().c_str());
2272 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2277 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2283 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2284 daIntTyypp->checkAllocated();
2285 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2289 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayIdType instance !");
2293 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, mcIdType size, PyObject *li)
2295 mcIdType szArr,sw,iTypppArr;
2296 std::vector<mcIdType> stdvecTyyppArr;
2297 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2300 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2301 throw INTERP_KERNEL::Exception(oss.str().c_str());
2303 self->insertNextCell(type,size,tmp);
2306 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li)
2308 mcIdType szArr,sw,iTypppArr;
2309 std::vector<mcIdType> stdvecTyyppArr;
2310 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2311 self->insertNextCell(type,szArr,tmp);
2314 DataArrayIdType *getNodalConnectivity()
2316 DataArrayIdType *ret=self->getNodalConnectivity();
2321 DataArrayIdType *getNodalConnectivityIndex()
2323 DataArrayIdType *ret=self->getNodalConnectivityIndex();
2329 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn, mcIdType nbOfDepthPeeling=-1)
2331 mcIdType szArr,sw,iTypppArr;
2332 std::vector<mcIdType> stdvecTyyppArr;
2333 const mcIdType *seedPtr=convertIntStarLikePyObjToCppIntStar(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2334 mcIdType nbOfDepthPeelingPerformed=0;
2335 DataArrayIdType *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2336 PyObject *res=PyTuple_New(2);
2337 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2338 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2342 static PyObject *FindCommonCellsAlg(int compType, mcIdType startCellId, const DataArrayIdType *nodal, const DataArrayIdType *nodalI, const DataArrayIdType *revNodal, const DataArrayIdType *revNodalI)
2344 DataArrayIdType *v0=0,*v1=0;
2345 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2346 PyObject *res = PyList_New(2);
2347 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2348 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2352 PyObject *distanceToPoint(PyObject *point) const
2356 DataArrayDoubleTuple *aa;
2357 std::vector<double> bb;
2359 int nbOfCompo=self->getSpaceDimension();
2360 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2363 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2364 PyObject *ret=PyTuple_New(2);
2365 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2366 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2370 PyObject *distanceToPoints(const DataArrayDouble *pts) const
2372 DataArrayIdType *ret1=0;
2373 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2374 PyObject *ret=PyTuple_New(2);
2375 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2376 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2380 PyObject *tetrahedrize(int policy)
2383 DataArrayIdType *ret1(0);
2384 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2385 PyObject *ret=PyTuple_New(3);
2386 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2387 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2388 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2392 PyObject *checkButterflyCells(double eps=1e-12)
2394 std::vector<mcIdType> cells;
2395 self->checkButterflyCells(cells,eps);
2396 DataArrayIdType *ret=DataArrayIdType::New();
2397 ret->alloc(cells.size(),1);
2398 std::copy(cells.begin(),cells.end(),ret->getPointer());
2399 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2402 PyObject *splitByType() const
2404 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2405 std::size_t sz=ms.size();
2406 PyObject *ret = PyList_New(sz);
2407 for(std::size_t i=0;i<sz;i++)
2408 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2412 PyObject *partitionBySpreadZone() const
2414 std::vector<DataArrayIdType *> retCpp=self->partitionBySpreadZone();
2415 std::size_t sz=retCpp.size();
2416 PyObject *ret=PyList_New(sz);
2417 for(std::size_t i=0;i<sz;i++)
2418 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2422 static PyObject *PartitionBySpreadZone(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn)
2424 std::vector<DataArrayIdType *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2425 std::size_t sz=retCpp.size();
2426 PyObject *ret=PyList_New(sz);
2427 for(std::size_t i=0;i<sz;i++)
2428 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2432 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const
2435 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(ids,&size);
2436 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2437 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2440 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const
2443 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2444 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2448 DataArrayIdType *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const
2451 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2452 DataArrayIdType *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2456 DataArrayIdType *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
2458 DataArrayIdType *ret=self->findNodesToDuplicate(otherDimM1OnSameCoords);
2462 PyObject *findCellsToRenumber(const MEDCouplingUMesh& otherDimM1OnSameCoords, const DataArrayIdType *dupNodes) const
2464 DataArrayIdType *tmp0=0,*tmp1=0;
2465 self->findCellsToRenumber(otherDimM1OnSameCoords,dupNodes->begin(), dupNodes->end(), tmp0,tmp1);
2466 PyObject *ret=PyTuple_New(2);
2467 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2468 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2472 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
2474 DataArrayIdType *tmp0=0,*tmp1=0;
2475 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2476 PyObject *ret=PyTuple_New(2);
2477 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2478 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2482 void duplicateNodes(PyObject *li)
2486 std::vector<mcIdType> multiVal;
2487 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2488 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2489 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2493 return self->duplicateNodes(&singleVal,&singleVal+1);
2495 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2497 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2499 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
2503 void duplicateNodesInConn(PyObject *li, mcIdType offset)
2507 std::vector<mcIdType> multiVal;
2508 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2509 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2510 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2514 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2516 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2518 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2520 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
2524 void attractSeg3MidPtsAroundNodes(double ratio, PyObject *nodeIds)
2526 mcIdType szArr,sw,iTypppArr;
2527 std::vector<mcIdType> stdvecTyyppArr;
2528 const mcIdType *nodeIdsPtr(convertIntStarLikePyObjToCppIntStar(nodeIds,sw,szArr,iTypppArr,stdvecTyyppArr));
2529 self->attractSeg3MidPtsAroundNodes(ratio,nodeIdsPtr,nodeIdsPtr+szArr);
2532 PyObject *getLevArrPerCellTypes(PyObject *li) const
2535 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2536 DataArrayIdType *tmp0,*tmp1=0;
2537 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2538 PyObject *ret=PyTuple_New(2);
2539 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2540 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2544 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const
2546 DataArrayIdType *ret0=0,*ret1=0;
2547 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2548 PyObject *ret=PyTuple_New(2);
2549 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2550 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2554 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms)
2556 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2557 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2558 DataArrayIdType *ret1=0,*ret2=0;
2559 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2560 PyObject *ret=PyTuple_New(3);
2561 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2562 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2563 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2567 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms)
2569 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2570 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2571 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2572 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2575 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType)
2578 std::vector<const MEDCouplingUMesh *> meshes;
2579 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2580 std::vector<DataArrayIdType *> corr;
2581 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2583 PyObject *ret1=PyList_New(sz);
2584 for(std::size_t i=0;i<sz;i++)
2585 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2586 PyObject *ret=PyList_New(2);
2587 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2588 PyList_SetItem(ret,1,ret1);
2592 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms)
2594 std::vector<MEDCouplingUMesh *> meshes;
2595 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2596 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2599 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps)
2601 std::vector<MEDCouplingUMesh *> meshes;
2602 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2603 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2606 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const
2610 DataArrayDoubleTuple *aa;
2611 std::vector<double> bb;
2613 int spaceDim=self->getSpaceDimension();
2614 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2615 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2617 std::vector<mcIdType> cells;
2618 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2619 DataArrayIdType *ret=DataArrayIdType::New();
2620 ret->alloc(cells.size(),1);
2621 std::copy(cells.begin(),cells.end(),ret->getPointer());
2622 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2625 void orientCorrectly2DCells(PyObject *vec, bool polyOnly)
2629 DataArrayDoubleTuple *aa;
2630 std::vector<double> bb;
2632 int spaceDim=self->getSpaceDimension();
2633 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2634 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2635 self->orientCorrectly2DCells(v,polyOnly);
2638 PyObject *arePolyhedronsNotCorrectlyOriented() const
2640 std::vector<mcIdType> cells;
2641 self->arePolyhedronsNotCorrectlyOriented(cells);
2642 DataArrayIdType *ret=DataArrayIdType::New();
2643 ret->alloc(cells.size(),1);
2644 std::copy(cells.begin(),cells.end(),ret->getPointer());
2645 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2648 PyObject *getFastAveragePlaneOfThis() const
2652 self->getFastAveragePlaneOfThis(vec,pos);
2654 std::copy(vec,vec+3,vals);
2655 std::copy(pos,pos+3,vals+3);
2656 return convertDblArrToPyListOfTuple<double>(vals,3,2);
2659 static MEDCouplingUMesh *MergeUMeshes(PyObject *li)
2661 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2662 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2663 return MEDCouplingUMesh::MergeUMeshes(tmp);
2666 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const
2668 DataArrayIdType *ret1;
2669 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2670 PyObject *ret=PyTuple_New(2);
2671 PyObject *ret0Py=ret0?Py_True:Py_False;
2673 PyTuple_SetItem(ret,0,ret0Py);
2674 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2678 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const
2680 DataArrayIdType *ret1;
2681 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2682 PyObject *ret=PyTuple_New(2);
2683 PyObject *ret0Py=ret0?Py_True:Py_False;
2685 PyTuple_SetItem(ret,0,ret0Py);
2686 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2690 PyObject *explode3DMeshTo1D() const
2692 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2693 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2694 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2695 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2696 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2697 PyObject *ret=PyTuple_New(5);
2698 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2699 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2700 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2701 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2702 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2706 PyObject *explodeIntoEdges() const
2708 MCAuto<DataArrayIdType> desc,descIndex,revDesc,revDescIndx;
2709 MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2710 PyObject *ret=PyTuple_New(5);
2711 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2712 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2713 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2714 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2715 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2719 PyObject *explodeMeshIntoMicroEdges() const
2721 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2722 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2723 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2724 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2725 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2726 PyObject *ret=PyTuple_New(5);
2727 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2728 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2729 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2730 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2731 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2735 PyObject *buildDescendingConnectivity() const
2737 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2738 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2739 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2740 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2741 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2742 PyObject *ret=PyTuple_New(5);
2743 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2744 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2745 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2746 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2747 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2751 PyObject *buildDescendingConnectivity2() const
2753 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2754 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2755 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2756 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2757 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2758 PyObject *ret=PyTuple_New(5);
2759 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2760 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2761 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2762 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2763 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2767 PyObject *computeNeighborsOfCells() const
2769 DataArrayIdType *neighbors=0,*neighborsIdx=0;
2770 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2771 PyObject *ret=PyTuple_New(2);
2772 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2773 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2777 PyObject *computeNeighborsOfNodes() const
2779 DataArrayIdType *neighbors=0,*neighborsIdx=0;
2780 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2781 PyObject *ret=PyTuple_New(2);
2782 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2783 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2787 PyObject *computeEnlargedNeighborsOfNodes() const
2789 MCAuto<DataArrayIdType> neighbors,neighborsIdx;
2790 self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2791 PyObject *ret=PyTuple_New(2);
2792 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2793 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2797 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayIdType *nodeNeigh, const DataArrayIdType *nodeNeighI) const
2799 MCAuto<DataArrayIdType> cellNeigh,cellNeighIndex;
2800 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2801 PyObject *ret=PyTuple_New(2);
2802 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2803 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2807 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *revDesc, const DataArrayIdType *revDescI)
2809 DataArrayIdType *neighbors=0,*neighborsIdx=0;
2810 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2811 PyObject *ret=PyTuple_New(2);
2812 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2813 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2817 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2819 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2820 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2821 DataArrayIdType *d2,*d3,*d4,*dd5;
2822 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2823 PyObject *ret=PyTuple_New(7);
2824 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2825 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2826 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2827 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2828 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2829 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2830 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2834 DataArrayDouble *getPartBarycenterAndOwner(DataArrayIdType *da) const
2837 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2838 da->checkAllocated();
2839 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2842 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayIdType *da) const
2845 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2846 da->checkAllocated();
2847 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2850 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayIdType *da) const
2853 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2854 da->checkAllocated();
2855 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2858 PyObject *getTypesOfPart(DataArrayIdType *da) const
2861 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2862 da->checkAllocated();
2863 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2864 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2865 PyObject *res = PyList_New(result.size());
2866 for (int i=0;iL!=result.end(); i++, iL++)
2867 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2871 DataArrayIdType *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayIdType *da) const
2874 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2875 da->checkAllocated();
2876 DataArrayIdType *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2877 ret->setName(da->getName().c_str());
2881 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps)
2883 DataArrayIdType *cellNb1=0,*cellNb2=0;
2884 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2885 PyObject *ret=PyTuple_New(3);
2886 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2887 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2888 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2892 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps)
2894 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2895 DataArrayIdType *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2896 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2897 PyObject *ret(PyTuple_New(4));
2898 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2899 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2900 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2901 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2905 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const
2907 int spaceDim=self->getSpaceDimension();
2909 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2911 DataArrayDouble *a,*a2;
2912 DataArrayDoubleTuple *aa,*aa2;
2913 std::vector<double> bb,bb2;
2915 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st parameter for origin.";
2916 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd parameter for vector.";
2917 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2918 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2920 DataArrayIdType *cellIds=0;
2921 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2922 PyObject *ret=PyTuple_New(2);
2923 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2924 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2928 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const
2930 int spaceDim=self->getSpaceDimension();
2932 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2934 DataArrayDouble *a,*a2;
2935 DataArrayDoubleTuple *aa,*aa2;
2936 std::vector<double> bb,bb2;
2938 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st parameter for origin.";
2939 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd parameter for vector.";
2940 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2941 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2943 DataArrayIdType *cellIds=0;
2944 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2945 PyObject *ret=PyTuple_New(2);
2946 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2947 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2951 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const
2954 DataArrayDouble *a,*a2;
2955 DataArrayDoubleTuple *aa,*aa2;
2956 std::vector<double> bb,bb2;
2958 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st parameter for origin.";
2959 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd parameter for vector.";
2960 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2961 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2962 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2966 DataArrayIdType *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const
2968 int spaceDim=self->getSpaceDimension();
2970 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2972 DataArrayDouble *a,*a2;
2973 DataArrayDoubleTuple *aa,*aa2;
2974 std::vector<double> bb,bb2;
2976 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st parameter for origin.";
2977 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd parameter for vector.";
2978 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2979 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2980 return self->getCellIdsCrossingPlane(orig,vect,eps);
2983 void convertToPolyTypes(PyObject *li)
2987 std::vector<mcIdType> pos2;
2988 DataArrayIdType *pos3=0;
2989 DataArrayIdTypeTuple *pos4=0;
2990 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2995 self->convertToPolyTypes(&pos1,&pos1+1);
3002 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
3007 self->convertToPolyTypes(pos3->begin(),pos3->end());
3011 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
3015 void convertAllToPoly();
3016 void convertExtrudedPolyhedra();
3018 void simplifyPolyhedra(double eps);
3019 MEDCouplingUMesh *buildSpreadZonesWithPoly() const;
3020 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy);
3023 //== MEDCouplingUMesh End
3025 //== MEDCouplingMappedExtrudedMesh
3027 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
3030 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
3031 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D);
3032 MEDCouplingUMesh *build3DUnstructuredMesh() const;
3033 int get2DCellIdForExtrusion() const;
3035 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, mcIdType cell2DId)
3037 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3040 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D)
3042 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3045 MEDCouplingMappedExtrudedMesh()
3047 return MEDCouplingMappedExtrudedMesh::New();
3050 std::string __str__() const
3052 return self->simpleRepr();
3055 std::string __repr__() const
3057 std::ostringstream oss;
3058 self->reprQuickOverview(oss);
3062 PyObject *getMesh2D() const
3064 MEDCouplingUMesh *ret=self->getMesh2D();
3067 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3069 PyObject *getMesh1D() const
3071 MEDCouplingUMesh *ret=self->getMesh1D();
3074 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3076 PyObject *getMesh3DIds() const
3078 DataArrayIdType *ret=self->getMesh3DIds();
3081 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
3086 //== MEDCouplingMappedExtrudedMesh End
3088 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3091 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3092 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m);
3093 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const;
3094 int getNodalConnectivityLength() const;
3095 virtual void allocateCells(int nbOfCells=0);
3096 virtual void checkConsistencyOfConnectivity() const;
3099 virtual void insertNextCell(PyObject *li)
3101 mcIdType szArr,sw,iTypppArr;
3102 std::vector<mcIdType> stdvecTyyppArr;
3103 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3104 self->insertNextCell(tmp,tmp+szArr);
3107 virtual DataArrayIdType *getNodalConnectivity() const
3109 DataArrayIdType *ret=self->getNodalConnectivity();
3110 if(ret) ret->incrRef();
3114 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li)
3116 std::vector< const MEDCoupling1GTUMesh *> parts;
3117 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3118 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3123 //== MEDCoupling1SGTUMesh
3125 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3128 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3129 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m);
3130 void setNodalConnectivity(DataArrayIdType *nodalConn);
3131 int getNumberOfNodesPerCell() const;
3132 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2);
3133 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
3134 MEDCoupling1GTUMesh *computeDualMesh() const;
3135 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const;
3136 DataArrayIdType *sortHexa8EachOther();
3139 MEDCoupling1SGTUMesh()
3141 return MEDCoupling1SGTUMesh::New();
3144 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
3146 return MEDCoupling1SGTUMesh::New(name,type);
3149 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m)
3151 return MEDCoupling1SGTUMesh::New(m);
3154 std::string __str__() const
3156 return self->simpleRepr();
3159 std::string __repr__() const
3161 std::ostringstream oss;
3162 self->reprQuickOverview(oss);
3166 PyObject *structurizeMe(double eps=1e-12) const
3168 DataArrayIdType *cellPerm(0),*nodePerm(0);
3169 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3170 PyObject *ret(PyTuple_New(3));
3171 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3172 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3173 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3177 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li)
3179 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3180 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3181 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3184 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li)
3186 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3187 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3188 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3193 //== MEDCoupling1SGTUMesh End
3195 //== MEDCoupling1DGTUMesh
3197 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3200 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3201 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m);
3202 void setNodalConnectivity(DataArrayIdType *nodalConn, DataArrayIdType *nodalConnIndex);
3203 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
3204 bool isPacked() const;
3207 MEDCoupling1DGTUMesh()
3209 return MEDCoupling1DGTUMesh::New();
3211 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
3213 return MEDCoupling1DGTUMesh::New(name,type);
3216 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m)
3218 return MEDCoupling1DGTUMesh::New(m);
3221 std::string __str__() const
3223 return self->simpleRepr();
3226 std::string __repr__() const
3228 std::ostringstream oss;
3229 self->reprQuickOverview(oss);
3233 DataArrayIdType *getNodalConnectivityIndex() const
3235 DataArrayIdType *ret=self->getNodalConnectivityIndex();
3236 if(ret) ret->incrRef();
3240 PyObject *retrievePackedNodalConnectivity() const
3242 DataArrayIdType *ret1=0,*ret2=0;
3243 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3244 PyObject *ret0Py=ret0?Py_True:Py_False;
3246 PyObject *ret=PyTuple_New(3);
3247 PyTuple_SetItem(ret,0,ret0Py);
3248 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3249 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3253 PyObject *copyWithNodalConnectivityPacked() const
3256 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3257 PyObject *ret=PyTuple_New(2);
3258 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3259 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3260 PyTuple_SetItem(ret,1,ret1Py);
3264 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li)
3266 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3267 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3268 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3271 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li)
3273 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3274 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3275 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3278 static DataArrayIdType *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<mcIdType>& offsetInNodeIdsPerElt)
3280 std::vector<const MEDCoupling::DataArrayIdType *> tmp;
3281 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",tmp);
3282 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3287 //== MEDCoupling1DGTUMeshEnd
3289 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3292 mcIdType getCellIdFromPos(mcIdType i, mcIdType j, mcIdType k) const;
3293 mcIdType getNodeIdFromPos(mcIdType i, mcIdType j, mcIdType k) const;
3294 mcIdType getNumberOfCellsOfSubLevelMesh() const;
3295 int getSpaceDimensionOnNodeStruct() const;
3296 double computeSquareness() const;
3297 virtual std::vector<mcIdType> getNodeGridStructure() const;
3298 std::vector<mcIdType> getCellGridStructure() const;
3299 MEDCoupling1SGTUMesh *build1SGTUnstructured() const;
3300 std::vector<mcIdType> getLocationFromCellId(mcIdType cellId) const;
3301 std::vector<mcIdType> getLocationFromNodeId(mcIdType cellId) const;
3302 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim);
3303 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const;
3304 static mcIdType DeduceNumberOfGivenStructure(const std::vector<mcIdType>& st);
3305 static DataArrayIdType *ComputeCornersGhost(const std::vector<mcIdType>& st, mcIdType ghostLev);
3306 static std::vector<mcIdType> GetSplitVectFromStruct(const std::vector<mcIdType>& strct);
3309 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const
3311 mcIdType tmpp1=-1,tmpp2=-1;
3312 std::vector<mcIdType> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3313 std::vector< std::pair<mcIdType,mcIdType> > inp;
3317 for(mcIdType i=0;i<tmpp1;i++)
3318 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3323 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3324 inp.resize(tmpp1/2);
3325 for(mcIdType i=0;i<tmpp1/2;i++)
3326 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3329 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3330 return self->buildStructuredSubPart(inp);
3333 static DataArrayIdType *BuildExplicitIdsFrom(PyObject *st, PyObject *part)
3335 std::vector< std::pair<mcIdType,mcIdType> > inp;
3336 convertPyToVectorPairInt(part,inp);
3338 mcIdType szArr,sw,iTypppArr;
3339 std::vector<mcIdType> stdvecTyyppArr;
3340 const mcIdType *tmp4=convertIntStarLikePyObjToCppIntStar(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3341 std::vector<mcIdType> tmp5(tmp4,tmp4+szArr);
3343 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3346 static void MultiplyPartOf(const std::vector<mcIdType>& st, PyObject *part, double factor, DataArrayDouble *da)
3348 std::vector< std::pair<mcIdType,mcIdType> > inp;
3349 convertPyToVectorPairInt(part,inp);
3350 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3353 static void MultiplyPartOfByGhost(const std::vector<mcIdType>& st, PyObject *part, mcIdType ghostSize, double factor, DataArrayDouble *da)
3355 std::vector< std::pair<mcIdType,mcIdType> > inp;
3356 convertPyToVectorPairInt(part,inp);
3357 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3360 static PyObject *PutInGhostFormat(mcIdType ghostSize, const std::vector<mcIdType>& st, PyObject *part)
3362 std::vector< std::pair<mcIdType,mcIdType> > inp;
3363 convertPyToVectorPairInt(part,inp);
3364 std::vector<mcIdType> stWithGhost;
3365 std::vector< std::pair<mcIdType,mcIdType> > partWithGhost;
3366 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3367 PyObject *ret(PyTuple_New(2));
3368 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3369 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3373 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<mcIdType>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat)
3375 std::vector< std::pair<mcIdType,mcIdType> > inp;
3376 convertPyToVectorPairInt(partCompactFormat,inp);
3377 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3380 static void AssignPartOfFieldOfDoubleUsing(const std::vector<mcIdType>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other)
3382 std::vector< std::pair<mcIdType,mcIdType> > inp;
3383 convertPyToVectorPairInt(partCompactFormat,inp);
3384 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3387 static mcIdType DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part)
3389 std::vector< std::pair<mcIdType,mcIdType> > inp;
3390 convertPyToVectorPairInt(part,inp);
3391 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3394 static DataArrayIdType *Build1GTNodalConnectivity(PyObject *li)
3396 mcIdType szArr,sw,iTypppArr;
3397 std::vector<mcIdType> stdvecTyyppArr;
3398 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3399 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3402 static DataArrayIdType *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li)
3404 mcIdType szArr,sw,iTypppArr;
3405 std::vector<mcIdType> stdvecTyyppArr;
3406 const mcIdType *tmp(convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3407 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3410 static std::vector<mcIdType> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat)
3412 std::vector< std::pair<mcIdType,mcIdType> > inp;
3413 convertPyToVectorPairInt(partCompactFormat,inp);
3414 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3417 static PyObject *GetCompactFrmtFromDimensions(const std::vector<mcIdType>& dims)
3419 std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3420 PyObject *retPy=PyList_New(ret.size());
3421 for(std::size_t i=0;i<ret.size();i++)
3423 PyObject *tmp=PyTuple_New(2);
3424 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3425 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3426 PyList_SetItem(retPy,i,tmp);
3431 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2)
3433 std::vector< std::pair<mcIdType,mcIdType> > r1Cpp,r2Cpp;
3434 convertPyToVectorPairInt(r1,r1Cpp);
3435 convertPyToVectorPairInt(r2,r2Cpp);
3436 std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3437 PyObject *retPy=PyList_New(ret.size());
3438 for(std::size_t i=0;i<ret.size();i++)
3440 PyObject *tmp=PyTuple_New(2);
3441 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3442 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3443 PyList_SetItem(retPy,i,tmp);
3448 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3450 std::vector< std::pair<mcIdType,mcIdType> > r1Cpp,r2Cpp;
3451 convertPyToVectorPairInt(r1,r1Cpp);
3452 convertPyToVectorPairInt(r2,r2Cpp);
3453 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3456 static PyObject *IsPartStructured(PyObject *li, PyObject *st)
3458 mcIdType szArr,sw,iTypppArr;
3459 std::vector<mcIdType> stdvecTyyppArr;
3460 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3461 mcIdType szArr2,sw2,iTypppArr2;
3462 std::vector<mcIdType> stdvecTyyppArr2;
3463 const mcIdType *tmp2=convertIntStarLikePyObjToCppIntStar(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3464 std::vector<mcIdType> tmp3(tmp2,tmp2+szArr2);
3465 std::vector< std::pair<mcIdType,mcIdType> > partCompactFormat;
3466 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3467 PyObject *ret=PyTuple_New(2);
3468 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3469 PyTuple_SetItem(ret,0,ret0Py);
3470 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3471 for(std::size_t i=0;i<partCompactFormat.size();i++)
3473 PyObject *tmp4=PyTuple_New(2);
3474 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3475 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3476 PyList_SetItem(ret1Py,i,tmp4);
3478 PyTuple_SetItem(ret,1,ret1Py);
3482 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true)
3484 std::vector< std::pair<mcIdType,mcIdType> > param0,param1,ret;
3485 convertPyToVectorPairInt(bigInAbs,param0);
3486 convertPyToVectorPairInt(partOfBigInAbs,param1);
3487 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3488 PyObject *retPy(PyList_New(ret.size()));
3489 for(std::size_t i=0;i<ret.size();i++)
3491 PyObject *tmp(PyTuple_New(2));
3492 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3493 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3494 PyList_SetItem(retPy,i,tmp);
3499 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<mcIdType>& translation)
3501 std::vector< std::pair<mcIdType,mcIdType> > param0;
3502 convertPyToVectorPairInt(part,param0);
3503 std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3504 PyObject *retPy(PyList_New(ret.size()));
3505 for(std::size_t i=0;i<ret.size();i++)
3507 PyObject *tmp(PyTuple_New(2));
3508 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3509 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3510 PyList_SetItem(retPy,i,tmp);
3515 static std::vector<mcIdType> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo)
3517 std::vector< std::pair<mcIdType,mcIdType> > param0,param1;
3518 convertPyToVectorPairInt(startingFrom,param0);
3519 convertPyToVectorPairInt(goingTo,param1);
3520 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3523 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true)
3525 std::vector< std::pair<mcIdType,mcIdType> > param0,param1,ret;
3526 convertPyToVectorPairInt(bigInAbs,param0);
3527 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3528 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3529 PyObject *retPy(PyList_New(ret.size()));
3530 for(std::size_t i=0;i<ret.size();i++)
3532 PyObject *tmp(PyTuple_New(2));
3533 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3534 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3535 PyList_SetItem(retPy,i,tmp);
3542 class MEDCouplingCurveLinearMesh;
3544 //== MEDCouplingCMesh
3546 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3549 static MEDCouplingCMesh *New();
3550 static MEDCouplingCMesh *New(const std::string& meshName);
3551 void setCoords(const DataArrayDouble *coordsX,
3552 const DataArrayDouble *coordsY=0,
3553 const DataArrayDouble *coordsZ=0);
3554 void setCoordsAt(int i, const DataArrayDouble *arr);
3555 MEDCouplingCurveLinearMesh *buildCurveLinear() const;
3559 return MEDCouplingCMesh::New();
3561 MEDCouplingCMesh(const std::string& meshName)
3563 return MEDCouplingCMesh::New(meshName);
3565 std::string __str__() const
3567 return self->simpleRepr();
3569 std::string __repr__() const
3571 std::ostringstream oss;
3572 self->reprQuickOverview(oss);
3575 DataArrayDouble *getCoordsAt(int i)
3577 DataArrayDouble *ret=self->getCoordsAt(i);
3585 //== MEDCouplingCMesh End
3587 //== MEDCouplingCurveLinearMesh
3589 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3592 static MEDCouplingCurveLinearMesh *New();
3593 static MEDCouplingCurveLinearMesh *New(const std::string& meshName);
3594 void setCoords(const DataArrayDouble *coords);
3596 MEDCouplingCurveLinearMesh()
3598 return MEDCouplingCurveLinearMesh::New();
3600 MEDCouplingCurveLinearMesh(const std::string& meshName)
3602 return MEDCouplingCurveLinearMesh::New(meshName);
3604 std::string __str__() const
3606 return self->simpleRepr();
3608 std::string __repr__() const
3610 std::ostringstream oss;
3611 self->reprQuickOverview(oss);
3614 DataArrayDouble *getCoords()
3616 DataArrayDouble *ret=self->getCoords();
3621 void setNodeGridStructure(PyObject *gridStruct)
3623 mcIdType szArr,sw,iTypppArr;
3624 std::vector<mcIdType> stdvecTyyppArr;
3625 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3626 self->setNodeGridStructure(tmp,tmp+szArr);
3631 //== MEDCouplingCurveLinearMesh End
3633 //== MEDCouplingIMesh
3635 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3638 static MEDCouplingIMesh *New();
3640 void setSpaceDimension(int spaceDim);
3641 std::vector<mcIdType> getNodeStruct() const;
3642 std::vector<double> getOrigin() const;
3643 std::vector<double> getDXYZ() const;
3644 void setAxisUnit(const std::string& unitName);
3645 std::string getAxisUnit() const;
3646 double getMeasureOfAnyCell() const;
3647 MEDCouplingCMesh *convertToCartesian() const;
3648 void refineWithFactor(const std::vector<mcIdType>& factors);
3649 MEDCouplingIMesh *asSingleCell() const;
3650 MEDCouplingIMesh *buildWithGhost(mcIdType ghostLev) const;
3655 return MEDCouplingIMesh::New();
3657 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
3659 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3660 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3661 const mcIdType *nodeStrctPtr(0);
3662 const double *originPtr(0),*dxyzPtr(0);
3663 mcIdType sw,sz,val0;
3664 std::vector<mcIdType> bb0;
3665 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
3668 std::vector<double> bb,bb2;
3670 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3671 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3673 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3676 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
3678 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3681 void setNodeStruct(PyObject *nodeStrct)
3683 mcIdType sw,sz,val0;
3684 std::vector<mcIdType> bb0;
3685 const mcIdType *nodeStrctPtr(convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0));
3686 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3689 void setOrigin(PyObject *origin)
3691 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3693 std::vector<double> bb;
3694 mcIdType sw,nbTuples;
3695 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3696 self->setOrigin(originPtr,originPtr+nbTuples);
3699 void setDXYZ(PyObject *dxyz)
3701 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3703 std::vector<double> bb;
3704 mcIdType sw,nbTuples;
3705 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3706 self->setDXYZ(originPtr,originPtr+nbTuples);
3709 static void CondenseFineToCoarse(const std::vector<mcIdType>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, DataArrayDouble *coarseDA)
3711 std::vector< std::pair<mcIdType,mcIdType> > inp;
3712 convertPyToVectorPairInt(fineLocInCoarse,inp);
3713 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3716 static void CondenseFineToCoarseGhost(const std::vector<mcIdType>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, DataArrayDouble *coarseDA, mcIdType ghostSize)
3718 std::vector< std::pair<mcIdType,mcIdType> > inp;
3719 convertPyToVectorPairInt(fineLocInCoarse,inp);
3720 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3723 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts)
3725 std::vector< std::pair<mcIdType,mcIdType> > inp;
3726 convertPyToVectorPairInt(fineLocInCoarse,inp);
3727 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3730 static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, mcIdType ghostSize)
3732 std::vector< std::pair<mcIdType,mcIdType> > inp;
3733 convertPyToVectorPairInt(fineLocInCoarse,inp);
3734 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3737 static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, mcIdType ghostSize)
3739 std::vector< std::pair<mcIdType,mcIdType> > inp;
3740 convertPyToVectorPairInt(fineLocInCoarse,inp);
3741 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3744 std::string __str__() const
3746 return self->simpleRepr();
3748 std::string __repr__() const
3750 std::ostringstream oss;
3751 self->reprQuickOverview(oss);
3757 //== MEDCouplingIMesh End
3761 namespace MEDCoupling
3763 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3766 virtual void checkConsistencyLight() const;
3767 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const;
3768 bool areStrictlyCompatible(const MEDCouplingField *other) const;
3769 bool areStrictlyCompatibleForMulDiv(const MEDCouplingField *other) const;
3770 virtual void copyTinyStringsFrom(const MEDCouplingField *other);
3771 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh);
3772 void setName(const char *name);
3773 std::string getDescription() const;
3774 void setDescription(const char *desc);
3775 std::string getName() const;
3776 TypeOfField getTypeOfField() const;
3777 NatureOfField getNature() const;
3778 virtual void setNature(NatureOfField nat);
3779 DataArrayDouble *getLocalizationOfDiscr() const;
3780 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const;
3781 mcIdType getNumberOfTuplesExpected() const;
3782 mcIdType getNumberOfMeshPlacesExpected() const;
3783 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3784 const std::vector<double>& gsCoo, const std::vector<double>& wg);
3785 void clearGaussLocalizations();
3786 MEDCouplingGaussLocalization& getGaussLocalization(int locId);
3787 mcIdType getNbOfGaussLocalization() const;
3788 mcIdType getGaussLocalizationIdOfOneCell(mcIdType cellId) const;
3789 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const;
3790 mcIdType getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const;
3791 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3793 PyObject *getMesh() const
3795 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3798 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3801 PyObject *getDiscretization()
3803 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3806 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3809 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const
3811 std::set<mcIdType> ret=self->getGaussLocalizationIdsOfOneType(type);
3812 return convertIntArrToPyList3(ret);
3815 PyObject *buildSubMeshData(PyObject *li) const
3817 DataArrayIdType *ret1=0;
3818 MEDCouplingMesh *ret0=0;
3820 int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
3821 if (!SWIG_IsOK(res1))
3824 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
3825 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3829 DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
3831 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
3832 da2->checkAllocated();
3833 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3835 PyObject *res = PyList_New(2);
3836 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3837 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
3841 PyObject *buildSubMeshDataRange(mcIdType begin, mcIdType end, mcIdType step) const
3843 DataArrayIdType *ret1=0;
3845 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3846 PyObject *res=PyTuple_New(2);
3847 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3849 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
3852 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3853 PyTuple_SetItem(res,1,res1);
3858 DataArrayIdType *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3861 mcIdType v0; std::vector<mcIdType> v1;
3862 const mcIdType *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
3863 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3866 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3867 const std::vector<double>& gsCoo, const std::vector<double>& wg)
3870 int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
3871 if (!SWIG_IsOK(res1))
3874 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
3875 self->setGaussLocalizationOnCells(tmp,((mcIdType *)tmp)+size,refCoo,gsCoo,wg);
3879 DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
3881 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
3882 da2->checkAllocated();
3883 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3887 PyObject *getCellIdsHavingGaussLocalization(int locId) const
3889 std::vector<mcIdType> tmp;
3890 self->getCellIdsHavingGaussLocalization(locId,tmp);
3891 DataArrayIdType *ret=DataArrayIdType::New();
3892 ret->alloc((mcIdType)tmp.size(),1);
3893 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3894 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
3897 mcIdType getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const
3899 std::vector<mcIdType> inp0;
3900 convertPyToNewIntArr4(code,1,3,inp0);
3901 std::vector<const DataArrayIdType *> inp1;
3902 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(idsPerType,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",inp1);
3903 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3908 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3911 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f);
3912 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f);
3913 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt32& f);
3914 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt64& f);
3915 static MEDCouplingFieldTemplate *New(TypeOfField type);
3916 std::string simpleRepr() const;
3917 std::string advancedRepr() const;
3918 bool isEqual(const MEDCouplingFieldTemplate *other, double meshPrec) const;
3919 bool isEqualWithoutConsideringStr(const MEDCouplingFieldTemplate *other, double meshPrec) const;
3922 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f)
3924 return MEDCouplingFieldTemplate::New(f);
3927 MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f)
3929 return MEDCouplingFieldTemplate::New(f);
3932 MEDCouplingFieldTemplate(const MEDCouplingFieldInt32& f)
3934 return MEDCouplingFieldTemplate::New(f);
3937 MEDCouplingFieldTemplate(const MEDCouplingFieldInt64& f)
3939 return MEDCouplingFieldTemplate::New(f);
3942 MEDCouplingFieldTemplate(TypeOfField type)
3944 return MEDCouplingFieldTemplate::New(type);
3947 std::string __str__() const
3949 return self->simpleRepr();
3952 std::string __repr__() const
3954 std::ostringstream oss;
3955 self->reprQuickOverview(oss);
3959 PyObject *isEqualIfNotWhy(const MEDCouplingFieldTemplate *other, double meshPrec) const
3962 bool ret0=self->isEqualIfNotWhy(other,meshPrec,ret1);
3963 PyObject *ret=PyTuple_New(2);
3964 PyObject *ret0Py=ret0?Py_True:Py_False;
3966 PyTuple_SetItem(ret,0,ret0Py);
3967 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3974 class MEDCouplingFieldT : public MEDCoupling::MEDCouplingField
3977 TypeOfTimeDiscretization getTimeDiscretization() const;
3979 MEDCouplingFieldT();
3980 ~MEDCouplingFieldT();
3983 %template(MEDCouplingFieldTdouble) MEDCoupling::MEDCouplingFieldT<double>;
3984 %template(MEDCouplingFieldTfloat) MEDCoupling::MEDCouplingFieldT<float>;
3985 %template(MEDCouplingFieldTint) MEDCoupling::MEDCouplingFieldT<int>;
3987 class MEDCouplingFieldInt32;
3988 class MEDCouplingFieldInt64;
3989 class MEDCouplingFieldFloat;
3991 class MEDCouplingFieldDouble : public MEDCouplingFieldT<double>
3994 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3995 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3996 bool isEqual(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
3997 bool isEqualWithoutConsideringStr(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
3998 void setTimeUnit(const std::string& unit);
3999 std::string getTimeUnit() const;
4000 void synchronizeTimeWithSupport();
4001 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other);
4002 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other);
4003 std::string simpleRepr() const;
4004 std::string advancedRepr() const;
4005 std::string writeVTK(const std::string& fileName, bool isBinary=true) const;
4006 MEDCouplingFieldInt32 *convertToIntField() const;
4007 MEDCouplingFieldFloat *convertToFloatField() const;
4008 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
4009 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
4010 MEDCouplingFieldDouble *deepCopy() const;
4011 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const;
4012 MEDCouplingFieldDouble *nodeToCellDiscretization() const;
4013 MEDCouplingFieldDouble *cellToNodeDiscretization() const;
4014 double getIJ(int tupleId, int compoId) const;
4015 double getIJK(int cellId, int nodeIdInCell, int compoId) const;
4016 void synchronizeTimeWithMesh();
4017 void setArray(DataArrayDouble *array);
4018 void setEndArray(DataArrayDouble *array);
4019 void setTime(double val, int iteration, int order);
4020 void setStartTime(double val, int iteration, int order);
4021 void setEndTime(double val, int iteration, int order);
4022 void applyLin(double a, double b, int compoId);
4023 void applyLin(double a, double b);
4024 int getNumberOfComponents() const;
4025 int getNumberOfTuples() const;
4026 int getNumberOfValues() const;
4027 void setTimeTolerance(double val);
4028 double getTimeTolerance() const;
4029 void setIteration(int it);
4030 void setEndIteration(int it);
4031 void setOrder(int order);
4032 void setEndOrder(int order);
4033 void setTimeValue(double val);
4034 void setEndTimeValue(double val);
4035 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15);
4036 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15);
4037 bool mergeNodes(double eps, double epsOnVals=1e-15);
4038 bool mergeNodesCenter(double eps, double epsOnVals=1e-15);
4039 bool zipCoords(double epsOnVals=1e-15);
4040 bool zipConnectivity(int compType,double epsOnVals=1e-15);
4041 bool simplexize(int policy);
4042 MEDCouplingFieldDouble *doublyContractedProduct() const;
4043 MEDCouplingFieldDouble *determinant() const;
4044 MEDCouplingFieldDouble *eigenValues() const;
4045 MEDCouplingFieldDouble *eigenVectors() const;
4046 MEDCouplingFieldDouble *inverse() const;
4047 MEDCouplingFieldDouble *trace() const;
4048 MEDCouplingFieldDouble *deviator() const;
4049 MEDCouplingFieldDouble *magnitude() const;
4050 MEDCouplingFieldDouble *maxPerTuple() const;
4051 void changeNbOfComponents(std::size_t newNbOfComp, double dftValue=0.);
4052 void sortPerTuple(bool asc);
4053 MEDCouplingFieldDouble &operator=(double value);
4054 void fillFromAnalytic(int nbOfComp, const std::string& func);
4055 void fillFromAnalyticCompo(int nbOfComp, const std::string& func);
4056 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
4057 void applyFunc(int nbOfComp, const std::string& func);
4058 void applyFuncCompo(int nbOfComp, const std::string& func);
4059 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
4060 void applyFunc(int nbOfComp, double val);
4061 void applyFunc(const std::string& func);
4062 void applyFuncFast32(const std::string& func);
4063 void applyFuncFast64(const std::string& func);
4064 double accumulate(int compId) const;
4065 double getMaxValue() const;
4066 double getMinValue() const;
4067 double getAverageValue() const;
4068 double norm2() const;
4069 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4070 double getWeightedAverageValue(int compId, bool isWAbs) const;
4071 double integral(int compId, bool isWAbs) const;
4072 double normL1(int compId) const;
4073 double normL2(int compId) const;
4074 double normMax(int compId) const;
4075 DataArrayIdType *findIdsInRange(double vmin, double vmax) const;
4076 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const;
4077 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4078 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4079 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4080 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const;
4081 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4082 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const;
4083 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4084 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const;
4085 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4086 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4087 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4088 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4089 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4090 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const;
4091 MEDCouplingFieldDouble *negate() const;
4093 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4095 return MEDCouplingFieldDouble::New(type,td);
4098 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4100 return MEDCouplingFieldDouble::New(ft,td);
4103 std::string __str__() const
4105 return self->simpleRepr();
4108 std::string __repr__() const
4110 std::ostringstream oss;
4111 self->reprQuickOverview(oss);
4115 PyObject *isEqualIfNotWhy(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const
4118 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
4119 PyObject *ret=PyTuple_New(2);
4120 PyObject *ret0Py=ret0?Py_True:Py_False;
4122 PyTuple_SetItem(ret,0,ret0Py);
4123 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4127 MEDCouplingFieldDouble *voronoize(double eps) const
4129 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4133 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const
4135 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4139 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4141 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4143 DataArrayDouble *a,*a2;
4144 DataArrayDoubleTuple *aa,*aa2;
4145 std::vector<double> bb,bb2;
4147 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4148 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4149 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4152 DataArrayDouble *getArray()
4154 DataArrayDouble *ret=self->getArray();
4160 PyObject *getArrays() const
4162 std::vector<DataArrayDouble *> arrs=self->getArrays();
4163 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4166 std::size_t sz=arrs.size();
4167 PyObject *ret=PyTuple_New(sz);
4168 for(std::size_t i=0;i<sz;i++)
4171 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4173 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4178 void setArrays(PyObject *ls)
4180 std::vector<const DataArrayDouble *> tmp;
4181 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4182 std::size_t sz=tmp.size();
4183 std::vector<DataArrayDouble *> arrs(sz);
4184 for(std::size_t i=0;i<sz;i++)
4185 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4186 self->setArrays(arrs);
4189 DataArrayDouble *getEndArray()
4191 DataArrayDouble *ret=self->getEndArray();
4197 PyObject *getValueOn(PyObject *sl) const
4201 DataArrayDoubleTuple *aa;
4202 std::vector<double> bb;
4204 const MEDCouplingMesh *mesh=self->getMesh();
4206 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4207 int spaceDim=mesh->getSpaceDimension();
4208 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4209 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4211 mcIdType sz=ToIdType(self->getNumberOfComponents());
4212 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4213 self->getValueOn(spaceLoc,res);
4214 return convertDblArrToPyList<double>(res,sz);
4217 PyObject *getValueOnPos(mcIdType i, mcIdType j, mcIdType k) const
4219 mcIdType sz=ToIdType(self->getNumberOfComponents());
4220 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4221 self->getValueOnPos(i,j,k,res);
4222 return convertDblArrToPyList<double>(res,sz);
4225 DataArrayDouble *getValueOnMulti(PyObject *locs) const
4227 const MEDCouplingMesh *mesh(self->getMesh());
4229 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4232 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4233 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4234 mesh->getSpaceDimension(),true,nbPts);
4235 return self->getValueOnMulti(inp,(int)nbPts);
4238 PyObject *getValueOn(PyObject *sl, double time) const
4242 DataArrayDoubleTuple *aa;
4243 std::vector<double> bb;
4245 const MEDCouplingMesh *mesh=self->getMesh();
4247 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4248 int spaceDim=mesh->getSpaceDimension();
4249 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4250 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4253 mcIdType sz=ToIdType(self->getNumberOfComponents());
4254 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4255 self->getValueOn(spaceLoc,time,res);
4256 return convertDblArrToPyList<double>(res,sz);
4259 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
4261 if(self->getArray()!=0)
4262 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4265 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4266 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4267 self->setArray(arr);
4274 double tmp0=self->getTime(tmp1,tmp2);
4275 PyObject *res = PyList_New(3);
4276 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4277 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4278 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4282 PyObject *getStartTime()
4285 double tmp0=self->getStartTime(tmp1,tmp2);
4286 PyObject *res = PyList_New(3);
4287 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4288 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4289 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4293 PyObject *getEndTime()
4296 double tmp0=self->getEndTime(tmp1,tmp2);
4297 PyObject *res = PyList_New(3);
4298 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4299 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4300 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4303 PyObject *accumulate() const
4305 mcIdType sz=ToIdType(self->getNumberOfComponents());
4306 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4307 self->accumulate(tmp);
4308 return convertDblArrToPyList<double>(tmp,sz);
4310 PyObject *integral(bool isWAbs) const
4312 mcIdType sz=ToIdType(self->getNumberOfComponents());
4313 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4314 self->integral(isWAbs,tmp);
4315 return convertDblArrToPyList<double>(tmp,sz);
4317 PyObject *getWeightedAverageValue(bool isWAbs=true) const
4319 mcIdType sz=ToIdType(self->getNumberOfComponents());
4320 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4321 self->getWeightedAverageValue(tmp,isWAbs);
4322 return convertDblArrToPyList<double>(tmp,sz);
4324 PyObject *normL1() const
4326 mcIdType sz=ToIdType(self->getNumberOfComponents());
4327 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4329 return convertDblArrToPyList<double>(tmp,sz);
4331 PyObject *normL2() const
4333 mcIdType sz=ToIdType(self->getNumberOfComponents());
4334 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4336 return convertDblArrToPyList<double>(tmp,sz);
4338 PyObject *normMax() const
4340 mcIdType sz=ToIdType(self->getNumberOfComponents());
4341 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4343 return convertDblArrToPyList<double>(tmp,sz);
4345 void renumberCells(PyObject *li, bool check=true)
4347 mcIdType szArr,sw,iTypppArr;
4348 std::vector<mcIdType> stdvecTyyppArr;
4349 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4350 self->renumberCells(tmp,check);
4353 void renumberCellsWithoutMesh(PyObject *li, bool check=true)
4355 mcIdType szArr,sw,iTypppArr;
4356 std::vector<mcIdType> stdvecTyyppArr;
4357 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4358 self->renumberCellsWithoutMesh(tmp,check);
4361 void renumberNodes(PyObject *li, double eps=1e-15)
4363 mcIdType szArr,sw,iTypppArr;
4364 std::vector<mcIdType> stdvecTyyppArr;
4365 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4366 self->renumberNodes(tmp,eps);
4369 void renumberNodesWithoutMesh(PyObject *li, mcIdType newNbOfNodes, double eps=1e-15)
4371 mcIdType szArr,sw,iTypppArr;
4372 std::vector<mcIdType> stdvecTyyppArr;
4373 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4374 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4377 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const
4379 return fieldT_buildSubPart(self,li);
4382 MEDCouplingFieldDouble *__getitem__(PyObject *li) const
4384 return fieldT__getitem__(self,li);
4387 PyObject *getMaxValue2() const
4389 DataArrayIdType *tmp;
4390 double r1=self->getMaxValue2(tmp);
4391 PyObject *ret=PyTuple_New(2);
4392 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4393 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4397 PyObject *getMinValue2() const
4399 DataArrayIdType *tmp;
4400 double r1=self->getMinValue2(tmp);
4401 PyObject *ret=PyTuple_New(2);
4402 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4403 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4407 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const
4409 std::vector<std::size_t> tmp;
4410 convertPyToNewIntArr3(li,tmp);
4411 return self->keepSelectedComponents(tmp);
4414 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li)
4416 std::vector<std::size_t> tmp;
4417 convertPyToNewIntArr3(li,tmp);
4418 self->setSelectedComponents(f,tmp);
4421 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const
4424 DataArrayDouble *a,*a2;
4425 DataArrayDoubleTuple *aa,*aa2;
4426 std::vector<double> bb,bb2;
4429 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st parameter for origin.";
4430 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd parameter for vector.";
4431 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4432 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4434 return self->extractSlice3D(orig,vect,eps);
4437 MEDCouplingFieldDouble *__add__(PyObject *obj)
4439 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4442 MEDCouplingFieldDouble *__radd__(PyObject *obj)
4444 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4447 MEDCouplingFieldDouble *__sub__(PyObject *obj)
4449 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.";
4450 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4453 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4455 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4457 return (*self)-(*other);
4459 throw INTERP_KERNEL::Exception(msg);
4464 DataArrayDoubleTuple *aa;
4465 std::vector<double> bb;
4467 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4472 if(!self->getArray())
4473 throw INTERP_KERNEL::Exception(msg2);
4474 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4475 ret->applyLin(1.,-val);
4476 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4477 ret2->setArray(ret);
4482 if(!self->getArray())
4483 throw INTERP_KERNEL::Exception(msg2);
4484 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4485 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4486 ret2->setArray(ret);
4491 if(!self->getArray())
4492 throw INTERP_KERNEL::Exception(msg2);
4493 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4494 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4495 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4496 ret2->setArray(ret);
4501 if(!self->getArray())
4502 throw INTERP_KERNEL::Exception(msg2);
4503 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4504 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4505 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4506 ret2->setArray(ret);
4510 { throw INTERP_KERNEL::Exception(msg); }
4514 MEDCouplingFieldDouble *__rsub__(PyObject *obj)
4516 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4519 MEDCouplingFieldDouble *__mul__(PyObject *obj)
4521 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4524 MEDCouplingFieldDouble *__rmul__(PyObject *obj)
4526 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4529 MEDCouplingFieldDouble *__div__(PyObject *obj)
4531 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.";
4532 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4535 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4537 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4539 return (*self)/(*other);
4541 throw INTERP_KERNEL::Exception(msg);
4546 DataArrayDoubleTuple *aa;
4547 std::vector<double> bb;
4549 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4555 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4556 if(!self->getArray())
4557 throw INTERP_KERNEL::Exception(msg2);
4558 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4559 ret->applyLin(1./val,0);
4560 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4561 ret2->setArray(ret);
4566 if(!self->getArray())
4567 throw INTERP_KERNEL::Exception(msg2);
4568 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4569 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4570 ret2->setArray(ret);
4575 if(!self->getArray())
4576 throw INTERP_KERNEL::Exception(msg2);
4577 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4578 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4579 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4580 ret2->setArray(ret);
4585 if(!self->getArray())
4586 throw INTERP_KERNEL::Exception(msg2);
4587 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4588 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4589 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4590 ret2->setArray(ret);
4594 { throw INTERP_KERNEL::Exception(msg); }
4598 MEDCouplingFieldDouble *__rdiv__(PyObject *obj)
4600 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4603 MEDCouplingFieldDouble *__pow__(PyObject *obj)
4605 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.";
4606 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4609 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4611 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4613 return (*self)^(*other);
4615 throw INTERP_KERNEL::Exception(msg);
4620 DataArrayDoubleTuple *aa;
4621 std::vector<double> bb;
4623 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4628 if(!self->getArray())
4629 throw INTERP_KERNEL::Exception(msg2);
4630 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4632 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4633 ret2->setArray(ret);
4638 if(!self->getArray())
4639 throw INTERP_KERNEL::Exception(msg2);
4640 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4641 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4642 ret2->setArray(ret);
4647 if(!self->getArray())
4648 throw INTERP_KERNEL::Exception(msg2);
4649 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4650 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4651 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4652 ret2->setArray(ret);
4657 if(!self->getArray())
4658 throw INTERP_KERNEL::Exception(msg2);
4659 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4660 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4661 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4662 ret2->setArray(ret);
4666 { throw INTERP_KERNEL::Exception(msg); }
4670 MEDCouplingFieldDouble *__neg__() const
4672 return self->negate();
4675 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
4677 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.";
4678 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4681 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4683 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4687 Py_XINCREF(trueSelf);
4691 throw INTERP_KERNEL::Exception(msg);
4696 DataArrayDoubleTuple *aa;
4697 std::vector<double> bb;
4699 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4704 if(!self->getArray())
4705 throw INTERP_KERNEL::Exception(msg2);
4706 self->getArray()->applyLin(1.,val);
4707 Py_XINCREF(trueSelf);
4712 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4715 Py_XINCREF(trueSelf);
4720 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4721 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4722 ret2->setArray(aaa);
4724 Py_XINCREF(trueSelf);
4729 if(!self->getArray())
4730 throw INTERP_KERNEL::Exception(msg2);
4731 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4732 self->getArray()->addEqual(aaa);
4733 Py_XINCREF(trueSelf);
4737 { throw INTERP_KERNEL::Exception(msg); }
4741 PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
4743 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.";
4744 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4747 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4749 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4753 Py_XINCREF(trueSelf);
4757 throw INTERP_KERNEL::Exception(msg);
4762 DataArrayDoubleTuple *aa;
4763 std::vector<double> bb;
4765 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4770 if(!self->getArray())
4771 throw INTERP_KERNEL::Exception(msg2);
4772 self->getArray()->applyLin(1.,-val);
4773 Py_XINCREF(trueSelf);
4778 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4781 Py_XINCREF(trueSelf);
4786 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4787 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4788 ret2->setArray(aaa);
4790 Py_XINCREF(trueSelf);
4795 if(!self->getArray())
4796 throw INTERP_KERNEL::Exception(msg2);
4797 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4798 self->getArray()->substractEqual(aaa);
4799 Py_XINCREF(trueSelf);
4803 { throw INTERP_KERNEL::Exception(msg); }
4807 PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
4809 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.";
4810 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4813 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4815 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4819 Py_XINCREF(trueSelf);
4823 throw INTERP_KERNEL::Exception(msg);
4828 DataArrayDoubleTuple *aa;
4829 std::vector<double> bb;
4831 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4836 if(!self->getArray())
4837 throw INTERP_KERNEL::Exception(msg2);
4838 self->getArray()->applyLin(val,0);
4839 Py_XINCREF(trueSelf);
4844 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4847 Py_XINCREF(trueSelf);
4852 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4853 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4854 ret2->setArray(aaa);
4856 Py_XINCREF(trueSelf);
4861 if(!self->getArray())
4862 throw INTERP_KERNEL::Exception(msg2);
4863 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4864 self->getArray()->multiplyEqual(aaa);
4865 Py_XINCREF(trueSelf);
4869 { throw INTERP_KERNEL::Exception(msg); }
4873 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
4875 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.";
4876 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4879 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4881 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4885 Py_XINCREF(trueSelf);
4889 throw INTERP_KERNEL::Exception(msg);
4894 DataArrayDoubleTuple *aa;
4895 std::vector<double> bb;
4897 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4903 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4904 if(!self->getArray())
4905 throw INTERP_KERNEL::Exception(msg2);
4906 self->getArray()->applyLin(1./val,0);
4907 Py_XINCREF(trueSelf);
4912 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4915 Py_XINCREF(trueSelf);
4920 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4921 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4922 ret2->setArray(aaa);
4924 Py_XINCREF(trueSelf);
4929 if(!self->getArray())
4930 throw INTERP_KERNEL::Exception(msg2);
4931 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4932 self->getArray()->divideEqual(aaa);
4933 Py_XINCREF(trueSelf);
4937 { throw INTERP_KERNEL::Exception(msg); }
4941 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj)
4943 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.";
4944 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4947 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4949 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4953 Py_XINCREF(trueSelf);
4957 throw INTERP_KERNEL::Exception(msg);
4962 DataArrayDoubleTuple *aa;
4963 std::vector<double> bb;
4965 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4970 if(!self->getArray())
4971 throw INTERP_KERNEL::Exception(msg2);
4972 self->getArray()->applyPow(val);
4973 Py_XINCREF(trueSelf);
4978 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4981 Py_XINCREF(trueSelf);
4986 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4987 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4988 ret2->setArray(aaa);
4990 Py_XINCREF(trueSelf);
4995 if(!self->getArray())
4996 throw INTERP_KERNEL::Exception(msg2);
4997 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4998 self->getArray()->powEqual(aaa);
4999 Py_XINCREF(trueSelf);
5003 { throw INTERP_KERNEL::Exception(msg); }
5007 static MEDCouplingFieldDouble *MergeFields(PyObject *li)
5009 std::vector<const MEDCouplingFieldDouble *> tmp;
5010 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5011 return MEDCouplingFieldDouble::MergeFields(tmp);
5014 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true)
5016 std::vector<const MEDCouplingFieldDouble *> tmp;
5017 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5018 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
5021 PyObject *getTinySerializationInformation() const
5023 return field_getTinySerializationInformation<MEDCouplingFieldDouble>(self);
5026 PyObject *serialize() const
5028 return field_serialize<double>(self);
5031 PyObject *__getstate__() const
5033 return field__getstate__<MEDCouplingFieldDouble>(self,MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldDouble_serialize);
5036 void __setstate__(PyObject *inp)
5038 field__setstate__<double>(self,inp);
5043 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5046 int getNumberOfFields() const;
5047 MEDCouplingMultiFields *deepCopy() const;
5048 virtual std::string simpleRepr() const;
5049 virtual std::string advancedRepr() const;
5050 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5051 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5052 virtual void checkConsistencyLight() const;
5055 std::string __str__() const
5057 return self->simpleRepr();
5059 static MEDCouplingMultiFields *New(PyObject *li)
5061 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5062 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5063 std::size_t sz=tmp.size();
5064 std::vector<MEDCouplingFieldDouble *> fs(sz);
5065 for(std::size_t i=0;i<sz;i++)
5066 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5067 return MEDCouplingMultiFields::New(fs);
5069 MEDCouplingMultiFields(PyObject *li)
5071 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5072 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5073 std::size_t sz=tmp.size();
5074 std::vector<MEDCouplingFieldDouble *> fs(sz);
5075 for(std::size_t i=0;i<sz;i++)
5076 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5077 return MEDCouplingMultiFields::New(fs);
5079 PyObject *getFields() const
5081 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5082 std::size_t sz=fields.size();
5083 PyObject *res = PyList_New(sz);
5084 for(std::size_t i=0;i<sz;i++)
5088 fields[i]->incrRef();
5089 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5093 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5098 PyObject *getFieldAtPos(int id) const
5100 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5104 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5107 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5109 PyObject *getMeshes() const
5111 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5112 std::size_t sz=ms.size();
5113 PyObject *res = PyList_New(sz);
5114 for(std::size_t i=0;i<sz;i++)
5119 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5123 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5128 PyObject *getDifferentMeshes() const
5130 std::vector<int> refs;
5131 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5132 std::size_t sz=ms.size();
5133 PyObject *res = PyList_New(sz);
5134 for(std::size_t i=0;i<sz;i++)
5139 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5143 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5147 PyObject *ret=PyTuple_New(2);
5148 PyTuple_SetItem(ret,0,res);
5149 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5152 PyObject *getArrays() const
5154 std::vector<DataArrayDouble *> ms=self->getArrays();
5155 std::size_t sz=ms.size();
5156 PyObject *res = PyList_New(sz);
5157 for(std::size_t i=0;i<sz;i++)
5162 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5166 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5171 PyObject *getDifferentArrays() const
5173 std::vector< std::vector<int> > refs;
5174 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5175 std::size_t sz=ms.size();
5176 PyObject *res = PyList_New(sz);
5177 PyObject *res2 = PyList_New(sz);
5178 for(std::size_t i=0;i<sz;i++)
5183 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5187 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5189 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5192 PyObject *ret=PyTuple_New(2);
5193 PyTuple_SetItem(ret,0,res);
5194 PyTuple_SetItem(ret,1,res2);
5200 class MEDCouplingFieldInt32 : public MEDCouplingFieldT<int>
5203 static MEDCouplingFieldInt32 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5204 static MEDCouplingFieldInt32 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5205 bool isEqual(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const;
5206 bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const;
5207 void setTimeUnit(const std::string& unit);
5208 std::string getTimeUnit() const;
5209 void setTime(double val, int iteration, int order);
5210 void setArray(DataArrayInt32 *array);
5211 MEDCouplingFieldInt32 *deepCopy() const;
5212 MEDCouplingFieldInt32 *clone(bool recDeepCpy) const;
5213 MEDCouplingFieldInt32 *cloneWithMesh(bool recDeepCpy) const;
5214 MEDCouplingFieldDouble *convertToDblField() const;
5215 MEDCouplingFieldInt32 *buildSubPartRange(int begin, int end, int step) const;
5217 MEDCouplingFieldInt32(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5219 return MEDCouplingFieldInt32::New(type,td);
5222 MEDCouplingFieldInt32(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5224 return MEDCouplingFieldInt32::New(ft,td);
5227 PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const
5230 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5231 PyObject *ret=PyTuple_New(2);
5232 PyObject *ret0Py=ret0?Py_True:Py_False;
5234 PyTuple_SetItem(ret,0,ret0Py);
5235 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5239 std::string __str__() const
5241 return self->simpleRepr();
5244 std::string __repr__() const
5246 std::ostringstream oss;
5247 self->reprQuickOverview(oss);
5251 MEDCouplingFieldInt32 *buildSubPart(PyObject *li) const
5253 return fieldT_buildSubPart(self,li);
5256 MEDCouplingFieldInt32 *__getitem__(PyObject *li) const
5258 return fieldT__getitem__(self,li);
5261 DataArrayInt32 *getArray()
5263 DataArrayInt32 *ret=self->getArray();
5272 double tmp0=self->getTime(tmp1,tmp2);
5273 PyObject *res = PyList_New(3);
5274 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5275 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5276 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5280 PyObject *getTinySerializationInformation() const
5282 return field_getTinySerializationInformation<MEDCouplingFieldInt32>(self);
5285 PyObject *serialize() const
5287 return field_serialize<int>(self);
5290 PyObject *__getstate__() const
5292 return field__getstate__<MEDCouplingFieldInt32>(self,MEDCoupling_MEDCouplingFieldInt32_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt32_serialize);
5295 void __setstate__(PyObject *inp)
5297 field__setstate__<int>(self,inp);
5302 class MEDCouplingFieldInt64 : public MEDCouplingFieldT<int>
5305 static MEDCouplingFieldInt64 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5306 static MEDCouplingFieldInt64 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5307 bool isEqual(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
5308 bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
5309 void setTimeUnit(const std::string& unit);
5310 std::string getTimeUnit() const;
5311 void setTime(double val, int iteration, int order);
5312 void setArray(DataArrayInt64 *array);
5313 MEDCouplingFieldInt64 *deepCopy() const;
5314 MEDCouplingFieldInt64 *clone(bool recDeepCpy) const;
5315 MEDCouplingFieldInt64 *cloneWithMesh(bool recDeepCpy) const;
5316 MEDCouplingFieldDouble *convertToDblField() const;
5317 MEDCouplingFieldInt64 *buildSubPartRange(int begin, int end, int step) const;
5319 MEDCouplingFieldInt64(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5321 return MEDCouplingFieldInt64::New(type,td);
5324 MEDCouplingFieldInt64(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5326 return MEDCouplingFieldInt64::New(ft,td);
5329 PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const
5332 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5333 PyObject *ret=PyTuple_New(2);
5334 PyObject *ret0Py=ret0?Py_True:Py_False;
5336 PyTuple_SetItem(ret,0,ret0Py);
5337 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5341 std::string __str__() const
5343 return self->simpleRepr();
5346 std::string __repr__() const
5348 std::ostringstream oss;
5349 self->reprQuickOverview(oss);
5353 MEDCouplingFieldInt64 *buildSubPart(PyObject *li) const
5355 return fieldT_buildSubPart(self,li);
5358 MEDCouplingFieldInt64 *__getitem__(PyObject *li) const
5360 return fieldT__getitem__(self,li);
5363 DataArrayInt64 *getArray()
5365 DataArrayInt64 *ret=self->getArray();
5374 double tmp0=self->getTime(tmp1,tmp2);
5375 PyObject *res = PyList_New(3);
5376 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5377 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5378 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5382 PyObject *getTinySerializationInformation() const
5384 return field_getTinySerializationInformation<MEDCouplingFieldInt64>(self);
5387 PyObject *serialize() const
5389 return field_serialize<Int64>(self);
5392 PyObject *__getstate__() const
5394 return field__getstate__<MEDCouplingFieldInt64>(self,MEDCoupling_MEDCouplingFieldInt64_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt64_serialize);
5397 void __setstate__(PyObject *inp)
5399 field__setstate__<Int64>(self,inp);
5404 class MEDCouplingFieldFloat : public MEDCouplingFieldT<float>
5407 static MEDCouplingFieldFloat *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5408 static MEDCouplingFieldFloat *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5409 bool isEqual(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
5410 bool isEqualWithoutConsideringStr(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
5411 void setTimeUnit(const std::string& unit);
5412 std::string getTimeUnit() const;
5413 void setTime(double val, int iteration, int order);
5414 void setArray(DataArrayFloat *array);
5415 MEDCouplingFieldFloat *deepCopy() const;
5416 MEDCouplingFieldFloat *clone(bool recDeepCpy) const;
5417 MEDCouplingFieldFloat *cloneWithMesh(bool recDeepCpy) const;
5418 MEDCouplingFieldDouble *convertToDblField() const;
5419 MEDCouplingFieldFloat *buildSubPartRange(int begin, int end, int step) const;
5421 MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5423 return MEDCouplingFieldFloat::New(type,td);
5426 MEDCouplingFieldFloat(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5428 return MEDCouplingFieldFloat::New(ft,td);
5431 PyObject *isEqualIfNotWhy(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const
5434 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5435 PyObject *ret=PyTuple_New(2);
5436 PyObject *ret0Py=ret0?Py_True:Py_False;
5438 PyTuple_SetItem(ret,0,ret0Py);
5439 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5443 std::string __str__() const
5445 return self->simpleRepr();
5448 std::string __repr__() const
5450 std::ostringstream oss;
5451 self->reprQuickOverview(oss);
5455 MEDCouplingFieldFloat *buildSubPart(PyObject *li) const
5457 return fieldT_buildSubPart(self,li);
5460 MEDCouplingFieldFloat *__getitem__(PyObject *li) const
5462 return fieldT__getitem__(self,li);
5465 DataArrayFloat *getArray()
5467 DataArrayFloat *ret=self->getArray();
5476 double tmp0=self->getTime(tmp1,tmp2);
5477 PyObject *res = PyList_New(3);
5478 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5479 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5480 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5484 PyObject *getTinySerializationInformation() const
5486 return field_getTinySerializationInformation<MEDCouplingFieldFloat>(self);
5489 PyObject *serialize() const
5491 return field_serialize<float>(self);
5494 PyObject *__getstate__() const
5496 return field__getstate__<MEDCouplingFieldFloat>(self,MEDCoupling_MEDCouplingFieldFloat_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldFloat_serialize);
5499 void __setstate__(PyObject *inp)
5501 field__setstate__<float>(self,inp);
5506 class MEDCouplingDefinitionTime
5509 MEDCouplingDefinitionTime();
5510 void assign(const MEDCouplingDefinitionTime& other);
5511 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5512 double getTimeResolution() const;
5513 std::vector<double> getHotSpotsTime() const;
5516 std::string __str__() const
5518 std::ostringstream oss;
5519 self->appendRepr(oss);
5523 PyObject *getIdsOnTimeRight(double tm) const
5525 int meshId,arrId,arrIdInField,fieldId;
5526 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5527 PyObject *res=PyList_New(4);
5528 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5529 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5530 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5531 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5535 PyObject *getIdsOnTimeLeft(double tm) const
5537 int meshId,arrId,arrIdInField,fieldId;
5538 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5539 PyObject *res=PyList_New(4);
5540 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5541 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5542 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5543 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5549 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5552 double getTimeTolerance() const;
5553 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5557 MEDCouplingFieldOverTime(PyObject *li)
5559 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5560 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5561 std::size_t sz=tmp.size();
5562 std::vector<MEDCouplingFieldDouble *> fs(sz);
5563 for(std::size_t i=0;i<sz;i++)
5564 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5565 return MEDCouplingFieldOverTime::New(fs);
5567 std::string __str__() const
5569 return self->simpleRepr();
5571 static MEDCouplingFieldOverTime *New(PyObject *li)
5573 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5574 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5575 std::size_t sz=tmp.size();
5576 std::vector<MEDCouplingFieldDouble *> fs(sz);
5577 for(std::size_t i=0;i<sz;i++)
5578 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5579 return MEDCouplingFieldOverTime::New(fs);
5584 class MEDCouplingCartesianAMRMesh;
5586 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5589 int getNumberOfCellsRecursiveWithOverlap() const;
5590 int getNumberOfCellsRecursiveWithoutOverlap() const;
5591 int getMaxNumberOfLevelsRelativeToThis() const;
5594 MEDCouplingCartesianAMRMeshGen *getMesh() const
5596 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5604 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5607 int getNumberOfOverlapedCellsForFather() const;
5608 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const;
5609 std::vector<mcIdType> computeCellGridSt() const;
5612 PyObject *getBLTRRange() const
5614 const std::vector< std::pair<mcIdType,mcIdType> >& ret(self->getBLTRRange());
5615 return convertFromVectorPairInt(ret);
5618 PyObject *getBLTRRangeRelativeToGF() const
5620 std::vector< std::pair<mcIdType,mcIdType> > ret(self->getBLTRRangeRelativeToGF());
5621 return convertFromVectorPairInt(ret);
5624 void addPatch(PyObject *bottomLeftTopRight, const std::vector<mcIdType>& factors)
5626 std::vector< std::pair<mcIdType,mcIdType> > inp;
5627 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5628 self->addPatch(inp,factors);
5631 MEDCouplingCartesianAMRPatch *__getitem__(mcIdType patchId) const
5633 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5635 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5636 if(patchId==mesh->getNumberOfPatches())
5638 std::ostringstream oss;
5639 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5640 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5643 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5649 void __delitem__(mcIdType patchId)
5651 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5653 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5654 mesh->removePatch(patchId);
5657 mcIdType __len__() const
5659 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5661 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5662 return mesh->getNumberOfPatches();
5667 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5671 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5674 mcIdType getAbsoluteLevel() const;
5675 mcIdType getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
5676 std::vector<mcIdType> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
5677 int getSpaceDimension() const;
5678 const std::vector<mcIdType>& getFactors() const;
5679 void setFactors(const std::vector<mcIdType>& newFactors);
5680 mcIdType getMaxNumberOfLevelsRelativeToThis() const;
5681 mcIdType getNumberOfCellsAtCurrentLevel() const;
5682 mcIdType getNumberOfCellsAtCurrentLevelGhost(mcIdType ghostLev) const;
5683 mcIdType getNumberOfCellsRecursiveWithOverlap() const;
5684 mcIdType getNumberOfCellsRecursiveWithoutOverlap() const;
5685 bool isPatchInNeighborhoodOf(mcIdType patchId1, mcIdType patchId2, mcIdType ghostLev) const;
5686 virtual void detachFromFather();
5688 mcIdType getNumberOfPatches() const;
5689 mcIdType getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const;
5690 MEDCouplingUMesh *buildUnstructured() const;
5691 DataArrayDouble *extractGhostFrom(mcIdType ghostSz, const DataArrayDouble *arr) const;
5692 std::vector<mcIdType> getPatchIdsInTheNeighborhoodOf(mcIdType patchId, mcIdType ghostLev) const;
5693 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const;
5694 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const;
5695 void removeAllPatches();
5696 void removePatch(mcIdType patchId);
5697 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<mcIdType>& factors);
5698 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<mcIdType>& factors, double eps);
5699 DataArrayDouble *createCellFieldOnPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnThis) const;
5700 void fillCellFieldOnPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const;
5701 void fillCellFieldOnPatchGhost(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev, bool isConservative=true) const;
5702 void fillCellFieldOnPatchOnlyOnGhostZone(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev) const;
5703 void fillCellFieldOnPatchOnlyOnGhostZoneWith(mcIdType ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5704 void fillCellFieldComingFromPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const;
5705 void fillCellFieldComingFromPatchGhost(mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, bool isConservative=true) const;
5706 DataArrayIdType *findPatchesInTheNeighborhoodOf(mcIdType patchId, mcIdType ghostLev) const;
5707 std::string buildPythonDumpOfThis() const;
5710 void addPatch(PyObject *bottomLeftTopRight, const std::vector<mcIdType>& factors)
5712 std::vector< std::pair<mcIdType,mcIdType> > inp;
5713 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5714 self->addPatch(inp,factors);
5717 PyObject *getPatches() const
5719 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5720 std::size_t sz(ps.size());
5721 PyObject *ret = PyList_New(sz);
5722 for(std::size_t i=0;i<sz;i++)
5724 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5727 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5732 // agy : don't know why typemap fails here ??? let it in the extend section
5733 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const
5735 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5738 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<mcIdType>& pos) const
5740 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5741 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5747 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<mcIdType>& pos) const
5749 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5750 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5756 virtual PyObject *positionRelativeToGodFather() const
5758 std::vector<mcIdType> out1;
5759 std::vector< std::pair<mcIdType,mcIdType> > out0(self->positionRelativeToGodFather(out1));
5760 PyObject *ret(PyTuple_New(2));
5761 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5762 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5766 virtual PyObject *retrieveGridsAt(mcIdType absoluteLev) const
5768 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5769 std::size_t sz(ps.size());
5770 PyObject *ret = PyList_New(sz);
5771 for(std::size_t i=0;i<sz;i++)
5772 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5776 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(mcIdType ghostSz, PyObject *recurseArrs) const
5778 std::vector<const DataArrayDouble *> inp;
5779 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5780 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5783 virtual MEDCouplingCartesianAMRMeshGen *getFather() const
5785 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5791 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const
5793 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5799 MEDCouplingCartesianAMRPatch *getPatch(mcIdType patchId) const
5801 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5807 MEDCouplingIMesh *getImageMesh() const
5809 const MEDCouplingIMesh *ret(self->getImageMesh());
5812 return const_cast<MEDCouplingIMesh *>(ret);
5815 MEDCouplingCartesianAMRPatch *__getitem__(mcIdType patchId) const
5817 if(patchId==self->getNumberOfPatches())
5819 std::ostringstream oss;
5820 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5821 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5824 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5830 void fillCellFieldOnPatchGhostAdv(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const
5832 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5833 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5834 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5837 void fillCellFieldOnPatchOnlyGhostAdv(mcIdType patchId, mcIdType ghostLev, PyObject *arrsOnPatches) const
5839 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5840 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5841 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5844 void __delitem__(mcIdType patchId)
5846 self->removePatch(patchId);
5849 mcIdType __len__() const
5851 return self->getNumberOfPatches();
5856 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5860 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5863 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh);
5866 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
5868 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5869 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5870 const mcIdType *nodeStrctPtr(0);
5871 const double *originPtr(0),*dxyzPtr(0);
5872 mcIdType sw,sz,val0;
5873 std::vector<mcIdType> bb0;
5874 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
5877 std::vector<double> bb,bb2;
5879 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5880 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5882 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5885 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps)
5887 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5888 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5889 std::vector< std::vector<mcIdType> > inp2;
5890 convertPyToVectorOfVectorOfInt(factors,inp2);
5891 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5894 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
5896 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5899 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh)
5901 return MEDCouplingCartesianAMRMesh::New(mesh);
5906 class MEDCouplingDataForGodFather : public RefCountObject
5909 virtual void synchronizeFineToCoarse();
5910 virtual void synchronizeFineToCoarseBetween(mcIdType fromLev, mcIdType toLev);
5911 virtual void synchronizeCoarseToFine();
5912 virtual void synchronizeCoarseToFineBetween(mcIdType fromLev, mcIdType toLev);
5913 virtual void synchronizeAllGhostZones();
5914 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh);
5915 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(mcIdType level);
5916 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(mcIdType level);
5917 virtual void alloc();
5918 virtual void dealloc();
5921 MEDCouplingCartesianAMRMesh *getMyGodFather()
5923 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5931 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5934 mcIdType getNumberOfLevels() const;
5935 MEDCouplingAMRAttribute *deepCopy() const;
5936 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const;
5937 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5938 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5939 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5940 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf);
5941 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const;
5942 std::string writeVTHB(const std::string& fileName) const;
5945 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, mcIdType ghostLev)
5947 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5948 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5949 MEDCouplingAMRAttribute *ret(0);
5952 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5953 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5955 catch(INTERP_KERNEL::Exception&)
5957 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5958 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5963 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, mcIdType ghostLev)
5965 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5968 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const
5970 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5971 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5977 void spillInfoOnComponents(PyObject *compNames)
5979 std::vector< std::vector<std::string> > compNamesCpp;
5980 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5981 self->spillInfoOnComponents(compNamesCpp);
5984 void spillNatures(PyObject *nfs)
5986 std::vector<mcIdType> inp0;
5987 if(!fillIntVector(nfs,inp0))
5988 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5989 std::size_t sz(inp0.size());
5990 std::vector<NatureOfField> inp00(sz);
5991 for(std::size_t i=0;i<sz;i++)
5992 inp00[i]=(NatureOfField)inp0[i];
5993 self->spillNatures(inp00);
5996 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const
5998 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5999 std::size_t sz(ret.size());
6000 PyObject *retPy(PyList_New(sz));
6001 for(std::size_t i=0;i<sz;i++)
6002 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
6008 class DenseMatrix : public RefCountObject, public TimeLabel
6011 static DenseMatrix *New(mcIdType nbRows, mcIdType nbCols);
6012 static DenseMatrix *New(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols);
6013 DenseMatrix *deepCopy() const;
6014 DenseMatrix *shallowCpy() const;
6016 mcIdType getNumberOfRows() const;
6017 mcIdType getNumberOfCols() const;
6018 mcIdType getNbOfElems() const;
6019 void reBuild(DataArrayDouble *array, mcIdType nbRows=-1, mcIdType nbCols=-1);
6020 void reShape(mcIdType nbRows, mcIdType nbCols);
6023 bool isEqual(const DenseMatrix& other, double eps) const;
6024 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const;
6025 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec);
6028 DenseMatrix(mcIdType nbRows, mcIdType nbCols)
6030 return DenseMatrix::New(nbRows,nbCols);
6033 DenseMatrix(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols)
6035 return DenseMatrix::New(array,nbRows,nbCols);
6038 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const
6041 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
6042 PyObject *ret=PyTuple_New(2);
6043 PyObject *ret0Py=ret0?Py_True:Py_False;
6045 PyTuple_SetItem(ret,0,ret0Py);
6046 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
6050 DataArrayDouble *getData()
6052 DataArrayDouble *ret(self->getData());
6058 DenseMatrix *__add__(const DenseMatrix *other)
6060 return MEDCoupling::DenseMatrix::Add(self,other);
6063 DenseMatrix *__sub__(const DenseMatrix *other)
6065 return MEDCoupling::DenseMatrix::Substract(self,other);
6068 DenseMatrix *__mul__(const DenseMatrix *other)
6070 return MEDCoupling::DenseMatrix::Multiply(self,other);
6073 DenseMatrix *__mul__(const DataArrayDouble *other)
6075 return MEDCoupling::DenseMatrix::Multiply(self,other);
6078 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other)
6080 self->addEqual(other);
6081 Py_XINCREF(trueSelf);
6085 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other)
6087 self->substractEqual(other);
6088 Py_XINCREF(trueSelf);
6092 PyObject *toNumPyMatrix() // not const. It is not a bug !
6094 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
6103 def MEDCouplingUMeshReduce(self):
6104 return MEDCouplingStdReduceFunct,(MEDCouplingUMesh,((),(self.__getstate__()),))
6105 def MEDCouplingCMeshReduce(self):
6106 return MEDCouplingStdReduceFunct,(MEDCouplingCMesh,((),(self.__getstate__()),))
6107 def MEDCouplingIMeshReduce(self):
6108 return MEDCouplingStdReduceFunct,(MEDCouplingIMesh,((),(self.__getstate__()),))
6109 def MEDCouplingMappedExtrudedMeshReduce(self):
6110 return MEDCouplingStdReduceFunct,(MEDCouplingMappedExtrudedMesh,((),(self.__getstate__()),))
6111 def MEDCouplingCurveLinearMeshReduce(self):
6112 return MEDCouplingStdReduceFunct,(MEDCouplingCurveLinearMesh,((),(self.__getstate__()),))
6113 def MEDCoupling1SGTUMeshReduce(self):
6114 return MEDCouplingStdReduceFunct,(MEDCoupling1SGTUMesh,((),(self.__getstate__()),))
6115 def MEDCoupling1DGTUMeshReduce(self):
6116 return MEDCouplingStdReduceFunct,(MEDCoupling1DGTUMesh,((),(self.__getstate__()),))
6117 def MEDCouplingFieldDoubleReduce(self):
6118 self.checkConsistencyLight()
6119 d=(self.getTypeOfField(),self.getTimeDiscretization())
6120 return MEDCouplingStdReduceFunct,(MEDCouplingFieldDouble,(d,(self.__getstate__()),))
6121 def MEDCouplingFieldInt32Reduce(self):
6122 self.checkConsistencyLight()
6123 d=(self.getTypeOfField(),self.getTimeDiscretization())
6124 return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt32,(d,(self.__getstate__()),))
6125 def MEDCouplingFieldInt64Reduce(self):
6126 self.checkConsistencyLight()
6127 d=(self.getTypeOfField(),self.getTimeDiscretization())
6128 return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt64,(d,(self.__getstate__()),))
6129 def MEDCouplingFieldFloatReduce(self):
6130 self.checkConsistencyLight()
6131 d=(self.getTypeOfField(),self.getTimeDiscretization())
6132 return MEDCouplingStdReduceFunct,(MEDCouplingFieldFloat,(d,(self.__getstate__()),))
6133 def MEDCouplingFTReduceFunct(cls,params):
6135 ret=object.__new__(cls)
6139 def MEDCouplingFieldTemplateReduce(self):
6140 ret = MEDCouplingFieldDouble(self)
6141 nbTuples = self.getNumberOfTuplesExpected()
6142 arr = DataArrayDouble(nbTuples) ; arr[:] = 0.
6144 return MEDCouplingFTReduceFunct,(MEDCouplingFieldTemplate,((ret,),()))
6146 # Forwarding DataArrayInt functions to MEDCouplingUMesh:
6148 MEDCouplingUMesh.ExtractFromIndexedArrays = DataArrayInt.ExtractFromIndexedArrays
6149 MEDCouplingUMesh.ExtractFromIndexedArraysSlice = DataArrayInt.ExtractFromIndexedArraysSlice
6150 MEDCouplingUMesh.SetPartOfIndexedArrays = DataArrayInt.SetPartOfIndexedArrays
6151 MEDCouplingUMesh.SetPartOfIndexedArraysSameIdx = DataArrayInt.SetPartOfIndexedArraysSameIdx
6152 MEDCouplingUMesh.RemoveIdsFromIndexedArrays = DataArrayInt.RemoveIdsFromIndexedArrays
6153 MEDCouplingFieldInt = MEDCouplingFieldInt32
6155 if MEDCouplingUse64BitIDs():
6156 MEDCouplingFieldID = MEDCouplingFieldInt64
6158 MEDCouplingFieldID = MEDCouplingFieldInt32
6164 __filename=os.environ.get('PYTHONSTARTUP')
6165 if __filename and os.path.isfile(__filename):
6166 with open(__filename) as __fp: