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>;
89 typedef long long mcPyPtrType;
91 typedef long mcPyPtrType;
95 %typemap(out) MEDCoupling::MEDCouplingMesh*
97 $result=convertMesh($1,$owner);
100 %typemap(out) MEDCouplingMesh*
102 $result=convertMesh($1,$owner);
107 %typemap(out) MEDCoupling::MEDCouplingPointSet*
109 $result=convertMesh($1,$owner);
112 %typemap(out) MEDCouplingPointSet*
114 $result=convertMesh($1,$owner);
119 %typemap(out) MEDCouplingCartesianAMRPatchGen*
121 $result=convertCartesianAMRPatch($1,$owner);
126 %typemap(out) MEDCouplingCartesianAMRMeshGen*
128 $result=convertCartesianAMRMesh($1,$owner);
133 %typemap(out) MEDCouplingDataForGodFather*
135 $result=convertDataForGodFather($1,$owner);
140 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
142 $result=convertMesh($1,$owner);
145 %typemap(out) MEDCoupling1GTUMesh*
147 $result=convertMesh($1,$owner);
152 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
154 $result=convertMesh($1,$owner);
157 %typemap(out) MEDCouplingStructuredMesh*
159 $result=convertMesh($1,$owner);
164 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
166 $result=convertFieldDiscretization($1,$owner);
169 %typemap(out) MEDCouplingFieldDiscretization*
171 $result=convertFieldDiscretization($1,$owner);
176 %typemap(out) MEDCoupling::MEDCouplingField*
178 $result=convertField($1,$owner);
181 %typemap(out) MEDCouplingField*
183 $result=convertField($1,$owner);
188 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
190 $result=convertMultiFields($1,$owner);
193 %typemap(out) MEDCouplingMultiFields*
195 $result=convertMultiFields($1,$owner);
200 %typemap(out) MEDCoupling::PartDefinition*
202 $result=convertPartDefinition($1,$owner);
205 %typemap(out) PartDefinition*
207 $result=convertPartDefinition($1,$owner);
212 %init %{ import_array(); %}
215 %init %{ initializeMe(); %}
217 %feature("autodoc", "1");
218 %feature("docstring");
220 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
221 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
222 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToFloatField;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
235 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
236 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
237 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
238 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
239 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
240 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
241 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
242 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
243 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
244 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
245 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
246 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
247 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
248 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
249 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
250 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
251 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
252 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
253 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
254 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
255 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
256 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
257 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
258 %newobject MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear;
259 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
260 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
261 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
262 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
263 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
264 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
265 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
266 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
267 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
268 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
269 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
270 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
271 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
272 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
273 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
274 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
275 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
276 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
277 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
278 %newobject MEDCoupling::MEDCouplingFieldInt32::New;
279 %newobject MEDCoupling::MEDCouplingFieldInt32::convertToDblField;
280 %newobject MEDCoupling::MEDCouplingFieldInt32::getArray;
281 %newobject MEDCoupling::MEDCouplingFieldInt32::deepCopy;
282 %newobject MEDCoupling::MEDCouplingFieldInt32::clone;
283 %newobject MEDCoupling::MEDCouplingFieldInt32::cloneWithMesh;
284 %newobject MEDCoupling::MEDCouplingFieldInt32::buildSubPart;
285 %newobject MEDCoupling::MEDCouplingFieldInt32::buildSubPartRange;
286 %newobject MEDCoupling::MEDCouplingFieldInt32::__getitem__;
287 %newobject MEDCoupling::MEDCouplingFieldInt64::New;
288 %newobject MEDCoupling::MEDCouplingFieldInt64::convertToDblField;
289 %newobject MEDCoupling::MEDCouplingFieldInt64::getArray;
290 %newobject MEDCoupling::MEDCouplingFieldInt64::deepCopy;
291 %newobject MEDCoupling::MEDCouplingFieldInt64::clone;
292 %newobject MEDCoupling::MEDCouplingFieldInt64::cloneWithMesh;
293 %newobject MEDCoupling::MEDCouplingFieldInt64::buildSubPart;
294 %newobject MEDCoupling::MEDCouplingFieldInt64::buildSubPartRange;
295 %newobject MEDCoupling::MEDCouplingFieldInt64::__getitem__;
296 %newobject MEDCoupling::MEDCouplingFieldFloat::New;
297 %newobject MEDCoupling::MEDCouplingFieldFloat::convertToDblField;
298 %newobject MEDCoupling::MEDCouplingFieldFloat::getArray;
299 %newobject MEDCoupling::MEDCouplingFieldFloat::deepCopy;
300 %newobject MEDCoupling::MEDCouplingFieldFloat::clone;
301 %newobject MEDCoupling::MEDCouplingFieldFloat::cloneWithMesh;
302 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPart;
303 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPartRange;
304 %newobject MEDCoupling::MEDCouplingFieldFloat::__getitem__;
305 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
306 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
307 %newobject MEDCoupling::MEDCouplingMesh::clone;
308 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
309 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
310 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
311 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
312 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
313 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
314 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
315 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
316 %newobject MEDCoupling::MEDCouplingMesh::computeMeshCenterOfMass;
317 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
318 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
319 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
320 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
321 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
322 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
323 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
324 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
325 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
326 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
327 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
328 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
329 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
330 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
331 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
332 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
333 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
334 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
335 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
336 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
337 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
338 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
339 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
340 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
341 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
342 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
343 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
344 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
345 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
346 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
347 %newobject MEDCoupling::MEDCouplingUMesh::New;
348 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
349 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
350 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
351 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
352 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
353 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
354 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
355 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
356 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
357 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
358 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
359 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
360 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
361 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
362 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
363 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
364 %newobject MEDCoupling::MEDCouplingUMesh::conformize3D;
365 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
366 %newobject MEDCoupling::MEDCouplingUMesh::colinearizeKeepingConform2D;
367 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
368 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
369 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
370 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
371 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
372 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
373 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
374 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
375 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
376 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
377 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
378 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
379 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
380 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
381 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
382 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
383 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
384 %newobject MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords;
385 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
386 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
387 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
388 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
389 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
390 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
391 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
392 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
393 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
394 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
395 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
396 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
397 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
398 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
399 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
400 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
401 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
402 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
403 %newobject MEDCoupling::MEDCouplingUMesh::convertDegeneratedCellsAndRemoveFlatOnes;
404 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
405 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
406 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
407 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
408 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
409 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
410 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
411 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
412 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
413 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
414 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
415 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
416 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
417 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
418 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
419 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
420 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
421 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
422 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
423 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
424 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
425 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
426 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
427 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
428 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
429 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
430 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
431 %newobject MEDCoupling::MEDCouplingCMesh::New;
432 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
433 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
434 %newobject MEDCoupling::MEDCouplingIMesh::New;
435 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
436 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
437 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
438 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
439 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
440 %newobject MEDCoupling::MEDCouplingMultiFields::New;
441 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
442 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
443 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
444 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
445 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
446 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
447 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
448 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
449 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
450 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
451 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
452 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
453 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
454 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
455 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
456 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
457 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
458 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
459 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
460 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
461 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
462 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
463 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
464 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
465 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
466 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
467 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
468 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
469 %newobject MEDCoupling::DenseMatrix::New;
470 %newobject MEDCoupling::DenseMatrix::deepCopy;
471 %newobject MEDCoupling::DenseMatrix::shallowCpy;
472 %newobject MEDCoupling::DenseMatrix::getData;
473 %newobject MEDCoupling::DenseMatrix::matVecMult;
474 %newobject MEDCoupling::DenseMatrix::MatVecMult;
475 %newobject MEDCoupling::DenseMatrix::__add__;
476 %newobject MEDCoupling::DenseMatrix::__sub__;
477 %newobject MEDCoupling::DenseMatrix::__mul__;
478 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
479 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
480 %newobject MEDCoupling::MEDCouplingSkyLineArray::BuildFromPolyhedronConn;
481 %newobject MEDCoupling::MEDCouplingSkyLineArray::getSuperIndexArray;
482 %newobject MEDCoupling::MEDCouplingSkyLineArray::getIndexArray;
483 %newobject MEDCoupling::MEDCouplingSkyLineArray::getValuesArray;
484 %newobject MEDCoupling::MEDCouplingSkyLineArray::groupPacks;
485 %newobject MEDCoupling::MEDCouplingSkyLineArray::uniqueNotSortedByPack;
486 %newobject MEDCoupling::MEDCouplingSkyLineArray::AggregatePacks;
487 %newobject MEDCoupling::MEDCouplingSkyLineArray::deepCopy;
489 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
490 %feature("unref") MEDCouplingMesh "$this->decrRef();"
491 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
492 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
493 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
494 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
495 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
496 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
497 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
498 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
499 %feature("unref") MEDCouplingField "$this->decrRef();"
500 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
501 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
502 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
503 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
504 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
505 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
506 %feature("unref") MEDCouplingFieldFloat "$this->decrRef();"
507 %feature("unref") MEDCouplingFieldInt32 "$this->decrRef();"
508 %feature("unref") MEDCouplingFieldInt64 "$this->decrRef();"
509 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
510 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
511 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
512 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
513 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
514 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
515 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
516 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
517 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
518 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
519 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
520 %feature("unref") DenseMatrix "$this->decrRef();"
521 %feature("unref") MEDCouplingSkyLineArray "$this->decrRef();"
523 %rename(assign) *::operator=;
524 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
525 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
526 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
527 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
531 // ABN: Instruct SWIG that INTERP_KERNEL::Exception is an exception class and that it should inherit Exception
532 // on the Python side. Must be put BEFORE the %rename clause:
533 %exceptionclass INTERP_KERNEL::Exception;
534 %rename (InterpKernelException) INTERP_KERNEL::Exception;
536 %include "MEDCouplingRefCountObject.i"
537 %include "MEDCouplingMemArray.i"
541 {// AGY : here initialization of C++ traits in MEDCouplingDataArrayTypemaps.i for code factorization. Awful, I know, but no other solutions.
542 SWIGTITraits<double>::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble;
543 SWIGTITraits<float>::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat;
544 SWIGTITraits<Int32>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt32;
545 SWIGTITraits<Int64>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt64;
546 SWIGTITraits<double>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple;
547 SWIGTITraits<float>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayFloatTuple;
548 SWIGTITraits<Int32>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayInt32Tuple;
549 SWIGTITraits<Int64>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayInt64Tuple;
555 PyObject *med2vtk_cell_types()
557 Py_ssize_t sz(sizeof(MEDCOUPLING2VTKTYPETRADUCER)/sizeof(decltype(MEDCOUPLING2VTKTYPETRADUCER[0])));
558 PyObject *ret(PyList_New(sz));
559 for(Py_ssize_t i=0;i<sz;i++)
561 mcIdType elt = MEDCOUPLING2VTKTYPETRADUCER[i]!=MEDCOUPLING2VTKTYPETRADUCER_NONE ? MEDCOUPLING2VTKTYPETRADUCER[i] : -1;
562 PyList_SetItem(ret,i,PyInt_FromLong(elt));
567 PyObject *vtk2med_cell_types()
569 Py_ssize_t sz(sizeof(MEDCOUPLING2VTKTYPETRADUCER)/sizeof(decltype(MEDCOUPLING2VTKTYPETRADUCER[0])));
570 auto maxElt(*std::max_element(MEDCOUPLING2VTKTYPETRADUCER,MEDCOUPLING2VTKTYPETRADUCER+sz,[](unsigned char a, unsigned char b) { if(b==MEDCOUPLING2VTKTYPETRADUCER_NONE) return false; else return a<b; } ));
571 auto szOut(maxElt+1);
572 std::vector< mcIdType > retCpp(szOut,-1);
574 for(const unsigned char *it=MEDCOUPLING2VTKTYPETRADUCER;it!=MEDCOUPLING2VTKTYPETRADUCER+sz;it++,id++)
576 if(*it!=MEDCOUPLING2VTKTYPETRADUCER_NONE)
580 PyObject *ret(PyList_New(szOut));
582 for(auto it=retCpp.begin();it!=retCpp.end();it++,id++)
583 PyList_SetItem(ret,id,PyInt_FromLong(*it));
587 PyObject *AllGeometricTypes()
589 Py_ssize_t sz(MEDCouplingUMesh::N_MEDMEM_ORDER);
590 PyObject *ret(PyList_New(sz));
591 for(Py_ssize_t i=0;i<sz;i++)
592 PyList_SetItem(ret,i,PyInt_FromLong(MEDCouplingUMesh::MEDMEM_ORDER[i]));
597 namespace INTERP_KERNEL
600 * \class BoxSplittingOptions
601 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
603 class BoxSplittingOptions
606 BoxSplittingOptions();
608 double getEfficiencyGoal() const;
609 void setEfficiencyGoal(double efficiency);
610 double getEfficiencyThreshold() const;
611 void setEfficiencyThreshold(double efficiencyThreshold);
612 int getMinimumPatchLength() const;
613 void setMinimumPatchLength(int minPatchLength);
614 int getMaximumPatchLength() const;
615 void setMaximumPatchLength(int maxPatchLength);
616 int getMaximumNbOfCellsInPatch() const;
617 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch);
618 void copyOptions(const BoxSplittingOptions & other);
619 std::string printOptions() const;
622 std::string __str__() const
624 return self->printOptions();
630 namespace MEDCoupling
646 CONST_ON_TIME_INTERVAL = 7
647 } TypeOfTimeDiscretization;
655 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
656 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
658 } MEDCouplingMeshType;
660 class DataArrayInt32;
661 class DataArrayInt64;
662 class DataArrayDouble;
663 class MEDCouplingUMesh;
664 class MEDCouplingCMesh;
665 class MEDCouplingFieldDouble;
667 %extend RefCountObject
669 std::string getHiddenCppPointer() const
671 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
676 %extend MEDCouplingGaussLocalization
678 std::string __str__() const
680 return self->getStringRepr();
683 std::string __repr__() const
685 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
686 oss << self->getStringRepr();
693 class MEDCouplingMesh : public RefCountObject, public TimeLabel
696 void setName(const std::string& name);
697 std::string getName() const;
698 void setDescription(const std::string& descr);
699 std::string getDescription() const;
700 void setTime(double val, int iteration, int order);
701 void setTimeUnit(const std::string& unit);
702 std::string getTimeUnit() const;
703 virtual MEDCouplingMeshType getType() const;
704 bool isStructured() const;
705 virtual MEDCouplingMesh *deepCopy() const;
706 virtual MEDCouplingMesh *clone(bool recDeepCpy) const;
707 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const;
708 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
709 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const;
710 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other);
711 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other);
712 virtual void checkConsistencyLight() const;
713 virtual void checkConsistency(double eps=1e-12) const;
714 virtual int getNumberOfCells() const;
715 virtual int getNumberOfNodes() const;
716 virtual int getSpaceDimension() const;
717 virtual int getMeshDimension() const;
718 virtual DataArrayDouble *getCoordinatesAndOwner() const;
719 virtual DataArrayDouble *computeCellCenterOfMass() const;
720 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
721 virtual DataArrayIdType *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
722 virtual DataArrayIdType *computeNbOfNodesPerCell() const;
723 virtual DataArrayIdType *computeNbOfFacesPerCell() const;
724 virtual DataArrayIdType *computeEffectiveNbOfNodesPerCell() const;
725 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const;
726 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
727 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
728 virtual std::string simpleRepr() const;
729 virtual std::string advancedRepr() const;
730 std::string writeVTK(const std::string& fileName, bool isBinary=true) const;
731 virtual std::string getVTKFileExtension() const;
732 std::string getVTKFileNameOf(const std::string& fileName) const;
734 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const;
735 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const;
736 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const;
737 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const;
738 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const;
739 virtual MEDCouplingFieldDouble *buildOrthogonalField() const;
740 virtual MEDCouplingUMesh *buildUnstructured() const;
741 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
742 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const;
743 virtual DataArrayIdType *simplexize(int policy);
744 virtual void unserialization(const std::vector<double>& tinyInfoD, const std::vector<mcIdType>& tinyInfo, const DataArrayIdType *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings);
745 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2);
746 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type);
747 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type);
748 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type);
749 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
750 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
751 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
754 std::string __str__() const
756 return self->simpleRepr();
759 DataArrayDouble *computeMeshCenterOfMass() const
761 MCAuto<DataArrayDouble> ret(self->computeMeshCenterOfMass());
768 double tmp0=self->getTime(tmp1,tmp2);
769 PyObject *res = PyList_New(3);
770 PyList_SetItem(res,0,SWIG_From_double(tmp0));
771 PyList_SetItem(res,1,SWIG_From_int(tmp1));
772 PyList_SetItem(res,2,SWIG_From_int(tmp2));
776 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const
778 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
779 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
785 mcIdType getCellContainingPoint(PyObject *p, double eps) const
789 DataArrayDoubleTuple *aa;
790 std::vector<double> bb;
792 int spaceDim=self->getSpaceDimension();
793 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
794 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
795 return self->getCellContainingPoint(pos,eps);
798 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const
802 DataArrayDoubleTuple *aa;
803 std::vector<double> bb;
805 int spaceDim=self->getSpaceDimension();
806 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
807 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
808 MCAuto<DataArrayIdType> elts,eltsIndex;
809 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
810 PyObject *ret=PyTuple_New(2);
811 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
812 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
816 PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, int nbOfPoints, double eps) const
820 DataArrayDoubleTuple *aa;
821 std::vector<double> bb;
823 int spaceDim=self->getSpaceDimension();
824 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPointsLinearPartOnlyOnNonDynType : ";
825 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
826 MCAuto<DataArrayIdType> elts,eltsIndex;
827 self->getCellsContainingPointsLinearPartOnlyOnNonDynType(pos,nbOfPoints,eps,elts,eltsIndex);
828 PyObject *ret=PyTuple_New(2);
829 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
830 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
834 PyObject *getCellsContainingPoints(PyObject *p, double eps) const
836 auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayIdType>& d, MCAuto<DataArrayIdType>& e) { self->getCellsContainingPoints(a,b,c,d,e); };
837 return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
840 PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, double eps) const
842 auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayIdType>& d, MCAuto<DataArrayIdType>& e) { self->getCellsContainingPointsLinearPartOnlyOnNonDynType(a,b,c,d,e); };
843 return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
846 PyObject *getCellsContainingPoint(PyObject *p, double eps) const
850 DataArrayDoubleTuple *aa;
851 std::vector<double> bb;
853 int spaceDim=self->getSpaceDimension();
854 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
855 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
856 std::vector<mcIdType> elts;
857 self->getCellsContainingPoint(pos,eps,elts);
858 DataArrayIdType *ret=DataArrayIdType::New();
859 ret->alloc((int)elts.size(),1);
860 std::copy(elts.begin(),elts.end(),ret->getPointer());
861 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
864 virtual PyObject *getReverseNodalConnectivity() const
866 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
867 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
868 self->getReverseNodalConnectivity(d0,d1);
869 PyObject *ret=PyTuple_New(2);
870 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
871 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
875 void renumberCells(PyObject *li, bool check=true)
878 mcIdType v0; std::vector<mcIdType> v1;
879 const mcIdType *ids(convertIntStarLikePyObjToCppIntStar(li,sw,sz,v0,v1));
880 self->renumberCells(ids,check);
883 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const
885 DataArrayIdType *cellCor, *nodeCor;
886 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
887 PyObject *res = PyList_New(2);
888 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTITraits<mcIdType>::TI, cellCor?SWIG_POINTER_OWN | 0:0 ));
889 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTITraits<mcIdType>::TI, nodeCor?SWIG_POINTER_OWN | 0:0 ));
893 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const
895 DataArrayIdType *cellCor=0,*nodeCor=0;
896 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
897 PyObject *res = PyList_New(2);
898 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTITraits<mcIdType>::TI, cellCor?SWIG_POINTER_OWN | 0:0 ));
899 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTITraits<mcIdType>::TI, nodeCor?SWIG_POINTER_OWN | 0:0 ));
903 DataArrayIdType *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const
905 DataArrayIdType *cellCor=0;
906 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
910 DataArrayIdType *getCellIdsFullyIncludedInNodeIds(PyObject *li) const
913 int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
914 if (!SWIG_IsOK(res1))
917 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
918 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const mcIdType *)tmp)+size);
922 DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
924 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
925 da2->checkAllocated();
926 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
929 PyObject *getNodeIdsOfCell(int cellId) const
931 std::vector<mcIdType> conn;
932 self->getNodeIdsOfCell(cellId,conn);
933 return convertIntArrToPyList2(conn);
936 PyObject *getCoordinatesOfNode(mcIdType nodeId) const
938 std::vector<double> coo;
939 self->getCoordinatesOfNode(nodeId,coo);
940 return convertDblArrToPyList2(coo);
943 void scale(PyObject *point, double factor)
947 DataArrayDoubleTuple *aa;
948 std::vector<double> bb;
950 int spaceDim=self->getSpaceDimension();
951 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
952 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
953 self->scale(pointPtr,factor);
956 PyObject *getBoundingBox() const
958 int spaceDim=self->getSpaceDimension();
959 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
960 self->getBoundingBox(tmp);
961 PyObject *ret=convertDblArrToPyListOfTuple<double>(tmp,2,spaceDim);
965 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const
968 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
969 PyObject *ret=PyTuple_New(2);
970 PyObject *ret0Py=ret0?Py_True:Py_False;
972 PyTuple_SetItem(ret,0,ret0Py);
973 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
977 PyObject *buildPart(PyObject *li) const
979 mcIdType szArr,sw,iTypppArr;
980 std::vector<mcIdType> stdvecTyyppArr;
981 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
982 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
983 if(sw==3)//DataArrayIdType
985 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
986 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
987 std::string name=argpt->getName();
989 ret->setName(name.c_str());
991 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
994 PyObject *buildPartAndReduceNodes(PyObject *li) const
996 mcIdType szArr,sw,iTypppArr;
997 std::vector<mcIdType> stdvecTyyppArr;
998 DataArrayIdType *arr=0;
999 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1000 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
1001 if(sw==3)//DataArrayIdType
1003 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1004 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1005 std::string name=argpt->getName();
1007 ret->setName(name.c_str());
1010 PyObject *res = PyList_New(2);
1011 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
1012 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1013 PyList_SetItem(res,0,obj0);
1014 PyList_SetItem(res,1,obj1);
1018 PyObject *buildPartRangeAndReduceNodes(mcIdType beginCellIds, mcIdType endCellIds, mcIdType stepCellIds) const
1021 DataArrayIdType *arr=0;
1022 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
1023 PyObject *res = PyTuple_New(2);
1024 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
1027 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1029 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
1030 PyTuple_SetItem(res,0,obj0);
1031 PyTuple_SetItem(res,1,obj1);
1035 PyObject *getDistributionOfTypes() const
1037 std::vector<mcIdType> vals=self->getDistributionOfTypes();
1038 if(vals.size()%3!=0)
1039 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
1040 PyObject *ret=PyList_New((mcIdType)vals.size()/3);
1041 for(std::size_t j=0;j<vals.size()/3;j++)
1043 PyObject *ret1=PyList_New(3);
1044 PyList_SetItem(ret1,0,PyInt_FromLong(vals[3*j]));
1045 PyList_SetItem(ret1,1,PyInt_FromLong(vals[3*j+1]));
1046 PyList_SetItem(ret1,2,PyInt_FromLong(vals[3*j+2]));
1047 PyList_SetItem(ret,j,ret1);
1052 DataArrayIdType *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const
1054 std::vector<mcIdType> code;
1055 std::vector<const DataArrayIdType *> idsPerType;
1056 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li2,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",idsPerType);
1057 convertPyToNewIntArr4(li,1,3,code);
1058 return self->checkTypeConsistencyAndContig(code,idsPerType);
1061 PyObject *splitProfilePerType(const DataArrayIdType *profile, bool smartPflKiller=true) const
1063 std::vector<mcIdType> code;
1064 std::vector<DataArrayIdType *> idsInPflPerType;
1065 std::vector<DataArrayIdType *> idsPerType;
1066 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType,smartPflKiller);
1067 PyObject *ret=PyTuple_New(3);
1069 if(code.size()%3!=0)
1070 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
1071 PyObject *ret0=PyList_New((mcIdType)code.size()/3);
1072 for(std::size_t j=0;j<code.size()/3;j++)
1074 PyObject *ret00=PyList_New(3);
1075 PyList_SetItem(ret00,0,PyInt_FromLong(code[3*j]));
1076 PyList_SetItem(ret00,1,PyInt_FromLong(code[3*j+1]));
1077 PyList_SetItem(ret00,2,PyInt_FromLong(code[3*j+2]));
1078 PyList_SetItem(ret0,j,ret00);
1080 PyTuple_SetItem(ret,0,ret0);
1082 PyObject *ret1=PyList_New(idsInPflPerType.size());
1083 for(std::size_t j=0;j<idsInPflPerType.size();j++)
1084 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1085 PyTuple_SetItem(ret,1,ret1);
1086 std::size_t n=idsPerType.size();
1087 PyObject *ret2=PyList_New(n);
1088 for(std::size_t i=0;i<n;i++)
1089 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1090 PyTuple_SetItem(ret,2,ret2);
1094 void translate(PyObject *vector)
1098 DataArrayDoubleTuple *aa;
1099 std::vector<double> bb;
1101 int spaceDim=self->getSpaceDimension();
1102 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1103 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1104 self->translate(vectorPtr);
1107 void rotate(PyObject *center, double alpha)
1109 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1112 DataArrayDoubleTuple *aa;
1113 std::vector<double> bb;
1115 int spaceDim=self->getSpaceDimension();
1116 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1117 self->rotate(centerPtr,0,alpha);
1120 void rotate(PyObject *center, PyObject *vector, double alpha)
1122 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1124 DataArrayDouble *a,*a2;
1125 DataArrayDoubleTuple *aa,*aa2;
1126 std::vector<double> bb,bb2;
1128 int spaceDim=self->getSpaceDimension();
1129 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1130 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
1131 self->rotate(centerPtr,vectorPtr,alpha);
1134 PyObject *getAllGeoTypes() const
1136 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1137 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1138 PyObject *res=PyList_New(result.size());
1139 for(int i=0;iL!=result.end(); i++, iL++)
1140 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1144 virtual PyObject *getTinySerializationInformation() const
1146 std::vector<double> a0;
1147 std::vector<mcIdType> a1;
1148 std::vector<std::string> a2;
1149 self->getTinySerializationInformation(a0,a1,a2);
1150 PyObject *ret(PyTuple_New(3));
1151 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1152 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1153 std::size_t sz(a2.size());
1154 PyObject *ret2(PyList_New(sz));
1156 for(std::size_t i=0;i<sz;i++)
1157 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1159 PyTuple_SetItem(ret,2,ret2);
1163 virtual PyObject *serialize() const
1165 DataArrayIdType *a0Tmp(0);
1166 DataArrayDouble *a1Tmp(0);
1167 self->serialize(a0Tmp,a1Tmp);
1168 PyObject *ret(PyTuple_New(2));
1169 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1170 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1174 void resizeForUnserialization(const std::vector<mcIdType>& tinyInfo, DataArrayIdType *a1, DataArrayDouble *a2) const
1176 std::vector<std::string> littleStrings;
1177 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1180 PyObject *__getstate__() const
1182 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1183 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1184 PyObject *ret(PyTuple_New(2));
1185 PyTuple_SetItem(ret,0,ret0);
1186 PyTuple_SetItem(ret,1,ret1);
1190 void __setstate__(PyObject *inp)
1192 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1193 if(!PyTuple_Check(inp))
1194 throw INTERP_KERNEL::Exception(MSG);
1195 std::size_t sz(PyTuple_Size(inp));
1197 throw INTERP_KERNEL::Exception(MSG);
1198 PyObject *elt0(PyTuple_GetItem(inp,0));
1199 PyObject *elt1(PyTuple_GetItem(inp,1));
1200 std::vector<double> a0;
1201 std::vector<mcIdType> a1;
1202 std::vector<std::string> a2;
1203 DataArrayIdType *b0(0);
1204 DataArrayDouble *b1(0);
1206 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1207 throw INTERP_KERNEL::Exception(MSG);
1208 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1210 fillArrayWithPyListDbl3(a0py,tmp,a0);
1211 convertPyToNewIntArr3(a1py,a1);
1212 fillStringVector(a2py,a2);
1215 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1216 throw INTERP_KERNEL::Exception(MSG);
1217 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1219 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTITraits<mcIdType>::TI,0|0));
1220 if(!SWIG_IsOK(status))
1221 throw INTERP_KERNEL::Exception(MSG);
1222 b0=reinterpret_cast<DataArrayIdType *>(argp);
1223 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1224 if(!SWIG_IsOK(status))
1225 throw INTERP_KERNEL::Exception(MSG);
1226 b1=reinterpret_cast<DataArrayDouble *>(argp);
1228 // useless here to call resizeForUnserialization because arrays are well resized.
1229 self->unserialization(a0,a1,b0,b1,a2);
1232 static MEDCouplingMesh *MergeMeshes(PyObject *li)
1234 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1235 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1236 return MEDCouplingMesh::MergeMeshes(tmp);
1242 //== MEDCouplingMesh End
1244 %include "NormalizedGeometricTypes"
1245 %include "MEDCouplingNatureOfFieldEnum"
1247 namespace MEDCoupling
1249 class MEDCouplingNatureOfField
1252 static const char *GetRepr(NatureOfField nat);
1253 static std::string GetReprNoThrow(NatureOfField nat);
1254 static std::string GetAllPossibilitiesStr();
1258 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1259 // include "MEDCouplingTimeDiscretization.i"
1261 namespace MEDCoupling
1263 class MEDCouplingGaussLocalization
1266 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1267 const std::vector<double>& gsCoo, const std::vector<double>& w);
1268 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ);
1269 INTERP_KERNEL::NormalizedCellType getType() const;
1270 void setType(INTERP_KERNEL::NormalizedCellType typ);
1271 int getNumberOfGaussPt() const;
1272 int getDimension() const;
1273 int getNumberOfPtsInRefCell() const;
1274 std::string getStringRepr() const;
1275 void checkConsistencyLight() const;
1276 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const;
1278 const std::vector<double>& getRefCoords() const;
1279 double getRefCoord(int ptIdInCell, int comp) const;
1280 const std::vector<double>& getGaussCoords() const;
1281 double getGaussCoord(int gaussPtIdInCell, int comp) const;
1282 const std::vector<double>& getWeights() const;
1283 double getWeight(int gaussPtIdInCell, double newVal) const;
1284 void setRefCoord(int ptIdInCell, int comp, double newVal);
1285 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal);
1286 void setWeight(int gaussPtIdInCell, double newVal);
1287 void setRefCoords(const std::vector<double>& refCoo);
1288 void setGaussCoords(const std::vector<double>& gsCoo);
1289 void setWeights(const std::vector<double>& w);
1291 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1295 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const
1297 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1301 MEDCouplingUMesh *buildRefCell() const
1303 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1309 class MEDCouplingSkyLineArray
1312 static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayIdType* c, const DataArrayIdType* cI );
1314 void set( DataArrayIdType* index, DataArrayIdType* value );
1315 void set3( DataArrayIdType* superIndex, DataArrayIdType* index, DataArrayIdType* value );
1317 int getSuperNumberOf() const;
1318 int getNumberOf() const;
1319 int getLength() const;
1321 void deletePack(const int i, const int j);
1323 void deleteSimplePack(const int i);
1324 void deleteSimplePacks(const DataArrayIdType* idx);
1326 MEDCouplingSkyLineArray *groupPacks(const DataArrayIdType *indexedPacks) const;
1327 MEDCouplingSkyLineArray *uniqueNotSortedByPack() const;
1329 MEDCouplingSkyLineArray *deepCopy() const;
1333 MEDCouplingSkyLineArray()
1335 return MEDCouplingSkyLineArray::New();
1338 MEDCouplingSkyLineArray( const std::vector<mcIdType>& index, const std::vector<mcIdType>& value)
1340 return MEDCouplingSkyLineArray::New(index, value);
1343 MEDCouplingSkyLineArray( DataArrayIdType* index, DataArrayIdType* value )
1345 return MEDCouplingSkyLineArray::New(index, value);
1348 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other )
1350 return MEDCouplingSkyLineArray::New(other);
1353 std::string __str__() const
1355 return self->simpleRepr();
1358 DataArrayIdType *getSuperIndexArray() const
1360 DataArrayIdType *ret(self->getSuperIndexArray());
1366 DataArrayIdType *getIndexArray() const
1368 DataArrayIdType *ret(self->getIndexArray());
1374 DataArrayIdType *getValuesArray() const
1376 DataArrayIdType *ret(self->getValuesArray());
1382 PyObject *getSimplePackSafe(mcIdType absolutePackId) const
1384 std::vector<mcIdType> ret;
1385 self->getSimplePackSafe(absolutePackId,ret);
1386 return convertIntArrToPyList2(ret);
1389 PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const
1391 std::vector<mcIdType> vpack, vspIdx, out;
1393 convertPyToNewIntArr3(superPackIndices,vspIdx);
1394 convertPyToNewIntArr3(pack,vpack);
1396 self->findPackIds(vspIdx, vpack.data(), vpack.data()+vpack.size(), out);
1397 return convertIntArrToPyList2(out);
1400 void pushBackPack(const mcIdType i, PyObject *pack)
1402 std::vector<mcIdType> vpack;
1403 convertPyToNewIntArr3(pack,vpack);
1404 self->pushBackPack(i,vpack.data(), vpack.data()+vpack.size());
1407 void replaceSimplePack(const mcIdType idx, PyObject *pack)
1409 std::vector<mcIdType> vpack;
1410 convertPyToNewIntArr3(pack,vpack);
1411 self->replaceSimplePack(idx, vpack.data(), vpack.data()+vpack.size());
1414 void replaceSimplePacks(const DataArrayIdType* idx, PyObject *listePacks)
1416 std::vector<const DataArrayIdType*> packs;
1417 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType*>(listePacks,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",packs);
1418 self->replaceSimplePacks(idx, packs);
1421 static MEDCouplingSkyLineArray *AggregatePacks(PyObject *sks)
1423 std::vector<const MEDCouplingSkyLineArray *> sksCpp;
1424 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingSkyLineArray*>(sks,SWIGTYPE_p_MEDCoupling__MEDCouplingSkyLineArray,"MEDCouplingSkyLineArray",sksCpp);
1425 return MEDCoupling::MEDCouplingSkyLineArray::AggregatePacks(sksCpp);
1428 void replacePack(const mcIdType superIdx, const mcIdType idx, PyObject *pack)
1430 std::vector<mcIdType> vpack;
1431 convertPyToNewIntArr3(pack,vpack);
1432 self->replacePack(superIdx, idx, vpack.data(), vpack.data()+vpack.size());
1435 PyObject *convertToPolyhedronConn() const
1437 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
1438 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
1439 self->convertToPolyhedronConn(d0,d1);
1440 PyObject *ret=PyTuple_New(2);
1441 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1442 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1446 PyObject *thresholdPerPack(mcIdType threshold) const
1448 MCAuto<MEDCouplingSkyLineArray> left, right;
1449 self->thresholdPerPack(threshold,left,right);
1450 PyObject *ret=PyTuple_New(2);
1451 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(left.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingSkyLineArray, SWIG_POINTER_OWN | 0 ));
1452 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(right.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingSkyLineArray, SWIG_POINTER_OWN | 0 ));
1459 %include "MEDCouplingFieldDiscretization.i"
1461 //== MEDCouplingPointSet
1463 namespace MEDCoupling
1465 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1468 void setCoords(const DataArrayDouble *coords);
1469 DataArrayDouble *getCoordinatesAndOwner() const;
1470 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const;
1472 double getCaracteristicDimension() const;
1473 void recenterForMaxPrecision(double eps);
1474 void changeSpaceDimension(int newSpaceDim, double dftVal=0.);
1475 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon);
1476 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other);
1477 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const;
1478 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon);
1479 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2);
1480 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type);
1481 static DataArrayIdType *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps);
1482 virtual DataArrayIdType *computeFetchedNodeIds() const;
1483 virtual int getNumberOfNodesInCell(int cellId) const;
1484 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const;
1485 virtual DataArrayIdType *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps);
1486 virtual DataArrayIdType *zipCoordsTraducer();
1487 virtual DataArrayIdType *findBoundaryNodes() const;
1488 virtual DataArrayIdType *zipConnectivityTraducer(int compType, int startCellId=0);
1489 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const;
1490 virtual void checkFullyDefined() const;
1491 virtual bool isEmptyMesh(const std::vector<mcIdType>& tinyInfo) const;
1492 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const;
1493 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const;
1494 virtual void renumberNodesWithOffsetInConn(int offset);
1495 virtual bool areAllNodesFetched() const;
1496 virtual MEDCouplingFieldDouble *computeDiameterField() const;
1497 virtual void invertOrientationOfAllCells();
1500 std::string __str__() const
1502 return self->simpleRepr();
1505 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayIdType *comm, const DataArrayIdType *commIndex) const
1507 mcIdType newNbOfNodes;
1508 DataArrayIdType *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1509 PyObject *res = PyList_New(2);
1510 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1511 PyList_SetItem(res,1,PyInt_FromLong(newNbOfNodes));
1515 PyObject *findCommonNodes(double prec, mcIdType limitTupleId=-1) const
1517 DataArrayIdType *comm, *commIndex;
1518 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1519 PyObject *res = PyList_New(2);
1520 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1521 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1525 PyObject *getCoords()
1527 DataArrayDouble *ret1=self->getCoords();
1530 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1533 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const
1535 mcIdType szArr,sw,iTypppArr;
1536 std::vector<mcIdType> stdvecTyyppArr;
1537 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1538 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1539 if(sw==3)//DataArrayIdType
1541 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1542 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1543 std::string name=argpt->getName();
1545 ret->setName(name.c_str());
1547 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1550 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const
1552 mcIdType szArr,sw,iTypppArr;
1553 std::vector<mcIdType> stdvecTyyppArr;
1554 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1555 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1556 if(sw==3)//DataArrayIdType
1558 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1559 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1560 std::string name=argpt->getName();
1562 ret->setName(name.c_str());
1564 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1567 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const
1569 mcIdType szArr,sw,iTypppArr;
1570 std::vector<mcIdType> stdvecTyyppArr;
1571 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1572 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1573 if(sw==3)//DataArrayIdType
1575 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1576 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1577 std::string name=argpt->getName();
1579 ret->setName(name.c_str());
1581 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1584 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(mcIdType start, mcIdType end, mcIdType step) const
1586 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1587 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1590 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const
1592 mcIdType szArr,sw,iTypppArr;
1593 std::vector<mcIdType> stdvecTyyppArr;
1594 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1595 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1596 if(sw==3)//DataArrayIdType
1598 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1599 DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1600 std::string name=argpt->getName();
1602 ret->setName(name.c_str());
1604 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1607 void renumberNodes(PyObject *li, mcIdType newNbOfNodes)
1609 mcIdType szArr,sw,iTypppArr;
1610 std::vector<mcIdType> stdvecTyyppArr;
1611 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1612 self->renumberNodes(tmp,newNbOfNodes);
1615 void renumberNodesCenter(PyObject *li, mcIdType newNbOfNodes)
1617 mcIdType szArr,sw,iTypppArr;
1618 std::vector<mcIdType> stdvecTyyppArr;
1619 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1620 self->renumberNodesCenter(tmp,newNbOfNodes);
1623 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const
1625 int spaceDim=self->getSpaceDimension();
1627 DataArrayDouble *a,*a2;
1628 DataArrayDoubleTuple *aa,*aa2;
1629 std::vector<double> bb,bb2;
1631 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st parameter for point.";
1632 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd parameter for vector.";
1633 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1634 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1635 std::vector<mcIdType> nodes;
1636 self->findNodesOnLine(p,v,eps,nodes);
1637 DataArrayIdType *ret=DataArrayIdType::New();
1638 ret->alloc(nodes.size(),1);
1639 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1640 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1642 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const
1644 int spaceDim=self->getSpaceDimension();
1646 DataArrayDouble *a,*a2;
1647 DataArrayDoubleTuple *aa,*aa2;
1648 std::vector<double> bb,bb2;
1650 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st parameter for point.";
1651 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd parameter for vector.";
1652 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1653 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1654 std::vector<mcIdType> nodes;
1655 self->findNodesOnPlane(p,v,eps,nodes);
1656 DataArrayIdType *ret=DataArrayIdType::New();
1657 ret->alloc(nodes.size(),1);
1658 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1659 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1662 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const
1666 DataArrayDoubleTuple *aa;
1667 std::vector<double> bb;
1669 int spaceDim=self->getSpaceDimension();
1670 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1671 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1672 DataArrayIdType *ret=self->getNodeIdsNearPoint(pos,eps);
1673 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1676 PyObject *getNodeIdsNearPoints(PyObject *pt, mcIdType nbOfPoints, double eps) const
1678 DataArrayIdType *c=0,*cI=0;
1682 DataArrayDoubleTuple *aa;
1683 std::vector<double> bb;
1685 int spaceDim=self->getSpaceDimension();
1686 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1687 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1688 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1689 PyObject *ret=PyTuple_New(2);
1690 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1691 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1695 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const
1697 DataArrayIdType *c=0,*cI=0;
1698 int spaceDim=self->getSpaceDimension();
1701 DataArrayDoubleTuple *aa;
1702 std::vector<double> bb;
1704 mcIdType nbOfTuples=-1;
1705 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1706 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1708 PyObject *ret=PyTuple_New(2);
1709 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1710 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1714 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const
1718 DataArrayDoubleTuple *aa;
1719 std::vector<double> bb;
1721 int spaceDim=self->getSpaceDimension();
1722 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1723 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1725 DataArrayIdType *elems=self->getCellsInBoundingBox(tmp,eps);
1726 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1729 void duplicateNodesInCoords(PyObject *li)
1733 std::vector<mcIdType> multiVal;
1734 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
1735 MEDCoupling::DataArrayIdType *daIntTyypp=0;
1736 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1740 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1742 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1744 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1746 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
1750 virtual PyObject *findCommonCells(int compType, mcIdType startCellId=0) const
1752 DataArrayIdType *v0(nullptr),*v1(nullptr);
1753 self->findCommonCells(compType,startCellId,v0,v1);
1754 PyObject *res = PyList_New(2);
1755 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1756 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1761 virtual void renumberNodesInConn(PyObject *li)
1765 int res1(SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__MapII, 0 | 0 ));
1768 MapII *da2(reinterpret_cast<MapII *>(da));
1769 self->renumberNodesInConn(da2->data());
1773 int res1(SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 ));
1774 if (!SWIG_IsOK(res1))
1777 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
1778 self->renumberNodesInConn(tmp);
1782 DataArrayIdType *da2(reinterpret_cast< DataArrayIdType * >(da));
1784 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
1785 da2->checkAllocated();
1786 self->renumberNodesInConn(da2->getConstPointer());
1790 virtual PyObject *getNodeIdsInUse() const
1793 DataArrayIdType *ret0=self->getNodeIdsInUse(ret1);
1794 PyObject *ret=PyTuple_New(2);
1795 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1796 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1800 virtual DataArrayIdType *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1802 DataArrayIdType *ret(nullptr);
1804 mcIdType szArr,sw,iTypppArr;
1805 std::vector<mcIdType> stdvecTyyppArr;
1806 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1807 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1811 virtual PyObject *mergeNodes(double precision)
1815 DataArrayIdType *ret0=self->mergeNodes(precision,ret1,ret2);
1816 PyObject *res = PyList_New(3);
1817 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1818 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1819 PyList_SetItem(res,2,PyInt_FromLong(ret2));
1823 virtual PyObject *mergeNodesCenter(double precision)
1827 DataArrayIdType *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1828 PyObject *res = PyList_New(3);
1829 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1830 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1831 PyList_SetItem(res,2,PyInt_FromLong(ret2));
1835 DataArrayIdType *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const
1838 int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
1839 if (!SWIG_IsOK(res1))
1842 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
1843 return self->getCellIdsLyingOnNodes(tmp,((const mcIdType *)tmp)+size,fullyIn);
1847 DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
1849 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
1850 da2->checkAllocated();
1851 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1855 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI)
1859 std::vector<mcIdType> multiVal;
1860 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
1861 MEDCoupling::DataArrayIdType *daIntTyypp=0;
1862 mcIdType nbc=self->getNumberOfCells();
1863 convertIntStarOrSliceLikePyObjToCpp(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1870 std::ostringstream oss;
1871 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1872 throw INTERP_KERNEL::Exception(oss.str().c_str());
1875 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1880 mcIdType tmp=nbc+singleVal;
1881 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1885 std::ostringstream oss;
1886 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1887 throw INTERP_KERNEL::Exception(oss.str().c_str());
1893 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1897 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1902 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1903 daIntTyypp->checkAllocated();
1904 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1907 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayIdType instance !");
1911 static void Rotate2DAlg(PyObject *center, double angle, mcIdType nbNodes, PyObject *coords)
1914 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1915 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1916 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1917 for(mcIdType i=0;i<sz;i++)
1918 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1921 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords)
1924 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1925 mcIdType sw,nbNodes=0;
1926 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1927 std::vector<double> val3;
1928 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1929 "Rotate2DAlg",2,true,nbNodes);
1931 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1932 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1935 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, mcIdType nbNodes, PyObject *coords)
1938 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1939 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1940 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1941 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1942 for(mcIdType i=0;i<sz;i++)
1943 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1946 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords)
1949 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1950 mcIdType sw,nbNodes=0;
1951 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1952 std::vector<double> val3;
1953 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1954 "Rotate3DAlg",3,true,nbNodes);
1956 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1957 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1958 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1963 //== MEDCouplingPointSet End
1965 class MEDCouplingUMeshCell
1968 INTERP_KERNEL::NormalizedCellType getType() const;
1971 std::string __str__() const
1973 return self->repr();
1976 PyObject *getAllConn() const
1979 const mcIdType *r=self->getAllConn(ret2);
1980 PyObject *ret=PyTuple_New(ret2);
1981 for(mcIdType i=0;i<ret2;i++)
1982 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1988 class MEDCouplingUMeshCellIterator
1995 MEDCouplingUMeshCell *ret=self->nextt();
1997 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
2000 PyErr_SetString(PyExc_StopIteration,"No more data.");
2007 class MEDCouplingUMeshCellByTypeIterator
2010 ~MEDCouplingUMeshCellByTypeIterator();
2015 MEDCouplingUMeshCellEntry *ret=self->nextt();
2017 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
2020 PyErr_SetString(PyExc_StopIteration,"No more data.");
2027 class MEDCouplingUMeshCellByTypeEntry
2030 ~MEDCouplingUMeshCellByTypeEntry();
2033 MEDCouplingUMeshCellByTypeIterator *__iter__()
2035 return self->iterator();
2040 class MEDCouplingUMeshCellEntry
2043 INTERP_KERNEL::NormalizedCellType getType() const;
2044 int getNumberOfElems() const;
2047 MEDCouplingUMeshCellIterator *__iter__()
2049 return self->iterator();
2054 //== MEDCouplingUMesh
2056 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
2059 static MEDCouplingUMesh *New();
2060 static MEDCouplingUMesh *New(const char *meshName, int meshDim);
2061 void checkConsistencyLight() const;
2062 void checkGeomConsistency(double eps=1e-12) const;
2063 void setMeshDimension(int meshDim);
2064 void allocateCells(int nbOfCells=0);
2065 void finishInsertingCells();
2066 MEDCouplingUMeshCellByTypeEntry *cellsByType();
2067 void setConnectivity(DataArrayIdType *conn, DataArrayIdType *connIndex, bool isComputingTypes=true);
2068 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
2069 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis);
2070 int getNodalConnectivityArrayLen() const;
2071 void computeTypes();
2072 std::string reprConnectivityOfThis() const;
2073 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const;
2075 DataArrayIdType *conformize2D(double eps);
2076 DataArrayIdType *conformize3D(double eps);
2077 DataArrayIdType *colinearize2D(double eps);
2078 DataArrayIdType *colinearizeKeepingConform2D(double eps);
2079 void shiftNodeNumbersInConn(int delta);
2080 std::vector<bool> getQuadraticStatus() const;
2081 DataArrayIdType *findCellIdsOnBoundary() const;
2082 MEDCouplingUMesh *computeSkin() const;
2083 bool checkConsecutiveCellTypes() const;
2084 bool checkConsecutiveCellTypesForMEDFileFrmt() const;
2085 DataArrayIdType *rearrange2ConsecutiveCellTypes();
2086 DataArrayIdType *sortCellsInMEDFileFrmt();
2087 DataArrayIdType *getRenumArrForMEDFileFrmt() const;
2088 DataArrayIdType *convertCellArrayPerGeoType(const DataArrayIdType *da) const;
2089 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2090 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2091 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2092 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2093 void orientCorrectlyPolyhedrons();
2094 bool isPresenceOfQuadratic() const;
2095 bool isFullyQuadratic() const;
2096 MEDCouplingFieldDouble *buildDirectionVectorField() const;
2097 bool isContiguous1D() const;
2098 void tessellate2D(double eps);
2099 void convertQuadraticCellsToLinear();
2100 DataArrayIdType *convertLinearCellsToQuadratic(int conversionType=0);
2101 void convertDegeneratedCells();
2102 DataArrayIdType *convertDegeneratedCellsAndRemoveFlatOnes();
2103 bool removeDegenerated1DCells();
2104 bool areOnlySimplexCells() const;
2105 MEDCouplingFieldDouble *getEdgeRatioField() const;
2106 MEDCouplingFieldDouble *getAspectRatioField() const;
2107 MEDCouplingFieldDouble *getWarpField() const;
2108 MEDCouplingFieldDouble *getSkewField() const;
2109 DataArrayDouble *computePlaneEquationOf3DFaces() const;
2110 DataArrayIdType *convexEnvelop2D();
2111 std::string cppRepr() const;
2112 DataArrayIdType *findAndCorrectBadOriented3DExtrudedCells();
2113 DataArrayIdType *findAndCorrectBadOriented3DCells();
2114 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const;
2115 MEDCouplingSkyLineArray *generateGraph() const;
2116 DataArrayIdType *convertNodalConnectivityToStaticGeoTypeMesh() const;
2117 DataArrayIdType *buildUnionOf2DMesh() const;
2118 DataArrayIdType *buildUnionOf3DMesh() const;
2119 DataArrayIdType *orderConsecutiveCells1D() const;
2120 DataArrayDouble *getBoundingBoxForBBTreeFast() const;
2121 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const;
2122 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const;
2123 void changeOrientationOfCells();
2124 DataArrayDouble *computeCellCenterOfMassWithPrecision(double eps);
2125 int split2DCells(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *subNodesInSeg, const DataArrayIdType *subNodesInSegI, const DataArrayIdType *midOpt=0, const DataArrayIdType *midOptI=0);
2126 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da);
2127 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
2128 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
2129 static DataArrayIdType *ComputeSpreadZoneGradually(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn);
2130 static DataArrayIdType *ComputeRangesFromTypeDistribution(const std::vector<mcIdType>& code);
2134 return MEDCouplingUMesh::New();
2137 MEDCouplingUMesh(const char *meshName, int meshDim)
2139 return MEDCouplingUMesh::New(meshName,meshDim);
2142 std::string __str__() const
2144 return self->simpleRepr();
2147 std::string __repr__() const
2149 std::ostringstream oss;
2150 self->reprQuickOverview(oss);
2154 MEDCouplingUMeshCellIterator *__iter__()
2156 return self->cellIterator();
2159 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da)
2161 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
2165 PyObject *getAllGeoTypesSorted() const
2167 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
2168 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2169 PyObject *res=PyList_New(result.size());
2170 for(int i=0;iL!=result.end(); i++, iL++)
2171 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2175 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
2179 std::vector<mcIdType> multiVal;
2180 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2181 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2182 mcIdType nbc=self->getNumberOfCells();
2183 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2190 std::ostringstream oss;
2191 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2192 throw INTERP_KERNEL::Exception(oss.str().c_str());
2196 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2203 mcIdType tmp=nbc+singleVal;
2204 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2209 std::ostringstream oss;
2210 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2211 throw INTERP_KERNEL::Exception(oss.str().c_str());
2217 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2223 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2224 daIntTyypp->checkAllocated();
2225 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2229 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayIdType instance !");
2233 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
2237 std::vector<mcIdType> multiVal;
2238 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2239 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2240 mcIdType nbc=self->getNumberOfCells();
2241 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2248 std::ostringstream oss;
2249 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2250 throw INTERP_KERNEL::Exception(oss.str().c_str());
2254 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2261 mcIdType tmp=nbc+singleVal;
2262 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2267 std::ostringstream oss;
2268 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2269 throw INTERP_KERNEL::Exception(oss.str().c_str());
2275 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2280 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2286 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2287 daIntTyypp->checkAllocated();
2288 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2292 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayIdType instance !");
2296 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, mcIdType size, PyObject *li)
2298 mcIdType szArr,sw,iTypppArr;
2299 std::vector<mcIdType> stdvecTyyppArr;
2300 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2303 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2304 throw INTERP_KERNEL::Exception(oss.str().c_str());
2306 self->insertNextCell(type,size,tmp);
2309 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li)
2311 mcIdType szArr,sw,iTypppArr;
2312 std::vector<mcIdType> stdvecTyyppArr;
2313 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2314 self->insertNextCell(type,szArr,tmp);
2317 DataArrayIdType *getNodalConnectivity()
2319 DataArrayIdType *ret=self->getNodalConnectivity();
2324 DataArrayIdType *getNodalConnectivityIndex()
2326 DataArrayIdType *ret=self->getNodalConnectivityIndex();
2332 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn, mcIdType nbOfDepthPeeling=-1)
2334 mcIdType szArr,sw,iTypppArr;
2335 std::vector<mcIdType> stdvecTyyppArr;
2336 const mcIdType *seedPtr=convertIntStarLikePyObjToCppIntStar(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2337 mcIdType nbOfDepthPeelingPerformed=0;
2338 DataArrayIdType *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2339 PyObject *res=PyTuple_New(2);
2340 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2341 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2345 static PyObject *FindCommonCellsAlg(int compType, mcIdType startCellId, const DataArrayIdType *nodal, const DataArrayIdType *nodalI, const DataArrayIdType *revNodal, const DataArrayIdType *revNodalI)
2347 DataArrayIdType *v0=0,*v1=0;
2348 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2349 PyObject *res = PyList_New(2);
2350 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2351 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2355 PyObject *distanceToPoint(PyObject *point) const
2359 DataArrayDoubleTuple *aa;
2360 std::vector<double> bb;
2362 int nbOfCompo=self->getSpaceDimension();
2363 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2366 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2367 PyObject *ret=PyTuple_New(2);
2368 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2369 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2373 PyObject *distanceToPoints(const DataArrayDouble *pts) const
2375 DataArrayIdType *ret1=0;
2376 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2377 PyObject *ret=PyTuple_New(2);
2378 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2379 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2383 PyObject *tetrahedrize(int policy)
2386 DataArrayIdType *ret1(0);
2387 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2388 PyObject *ret=PyTuple_New(3);
2389 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2390 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2391 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2395 PyObject *checkButterflyCells(double eps=1e-12)
2397 std::vector<mcIdType> cells;
2398 self->checkButterflyCells(cells,eps);
2399 DataArrayIdType *ret=DataArrayIdType::New();
2400 ret->alloc(cells.size(),1);
2401 std::copy(cells.begin(),cells.end(),ret->getPointer());
2402 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2405 PyObject *splitByType() const
2407 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2408 std::size_t sz=ms.size();
2409 PyObject *ret = PyList_New(sz);
2410 for(std::size_t i=0;i<sz;i++)
2411 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2415 PyObject *partitionBySpreadZone() const
2417 std::vector<DataArrayIdType *> retCpp=self->partitionBySpreadZone();
2418 std::size_t sz=retCpp.size();
2419 PyObject *ret=PyList_New(sz);
2420 for(std::size_t i=0;i<sz;i++)
2421 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2425 static PyObject *PartitionBySpreadZone(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn)
2427 std::vector<DataArrayIdType *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2428 std::size_t sz=retCpp.size();
2429 PyObject *ret=PyList_New(sz);
2430 for(std::size_t i=0;i<sz;i++)
2431 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2435 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const
2438 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(ids,&size);
2439 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2440 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2443 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const
2446 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2447 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2451 DataArrayIdType *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const
2454 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2455 DataArrayIdType *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2459 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
2461 DataArrayIdType *tmp0=0,*tmp1=0,*tmp2=0;
2462 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2463 PyObject *ret=PyTuple_New(3);
2464 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2465 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2466 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2470 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
2472 DataArrayIdType *tmp0=0,*tmp1=0;
2473 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2474 PyObject *ret=PyTuple_New(2);
2475 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2476 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2480 void duplicateNodes(PyObject *li)
2484 std::vector<mcIdType> multiVal;
2485 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2486 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2487 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2491 return self->duplicateNodes(&singleVal,&singleVal+1);
2493 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2495 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2497 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
2501 void duplicateNodesInConn(PyObject *li, mcIdType offset)
2505 std::vector<mcIdType> multiVal;
2506 std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2507 MEDCoupling::DataArrayIdType *daIntTyypp=0;
2508 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2512 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2514 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2516 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2518 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
2522 void attractSeg3MidPtsAroundNodes(double ratio, PyObject *nodeIds)
2524 mcIdType szArr,sw,iTypppArr;
2525 std::vector<mcIdType> stdvecTyyppArr;
2526 const mcIdType *nodeIdsPtr(convertIntStarLikePyObjToCppIntStar(nodeIds,sw,szArr,iTypppArr,stdvecTyyppArr));
2527 self->attractSeg3MidPtsAroundNodes(ratio,nodeIdsPtr,nodeIdsPtr+szArr);
2530 PyObject *getLevArrPerCellTypes(PyObject *li) const
2533 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2534 DataArrayIdType *tmp0,*tmp1=0;
2535 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2536 PyObject *ret=PyTuple_New(2);
2537 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2538 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2542 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const
2544 DataArrayIdType *ret0=0,*ret1=0;
2545 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2546 PyObject *ret=PyTuple_New(2);
2547 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2548 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2552 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms)
2554 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2555 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2556 DataArrayIdType *ret1=0,*ret2=0;
2557 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2558 PyObject *ret=PyTuple_New(3);
2559 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2560 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2561 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2565 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms)
2567 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2568 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2569 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2570 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2573 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType)
2576 std::vector<const MEDCouplingUMesh *> meshes;
2577 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2578 std::vector<DataArrayIdType *> corr;
2579 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2581 PyObject *ret1=PyList_New(sz);
2582 for(std::size_t i=0;i<sz;i++)
2583 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2584 PyObject *ret=PyList_New(2);
2585 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2586 PyList_SetItem(ret,1,ret1);
2590 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms)
2592 std::vector<MEDCouplingUMesh *> meshes;
2593 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2594 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2597 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps)
2599 std::vector<MEDCouplingUMesh *> meshes;
2600 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2601 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2604 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const
2608 DataArrayDoubleTuple *aa;
2609 std::vector<double> bb;
2611 int spaceDim=self->getSpaceDimension();
2612 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2613 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2615 std::vector<mcIdType> cells;
2616 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2617 DataArrayIdType *ret=DataArrayIdType::New();
2618 ret->alloc(cells.size(),1);
2619 std::copy(cells.begin(),cells.end(),ret->getPointer());
2620 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2623 void orientCorrectly2DCells(PyObject *vec, bool polyOnly)
2627 DataArrayDoubleTuple *aa;
2628 std::vector<double> bb;
2630 int spaceDim=self->getSpaceDimension();
2631 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2632 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2633 self->orientCorrectly2DCells(v,polyOnly);
2636 PyObject *arePolyhedronsNotCorrectlyOriented() const
2638 std::vector<mcIdType> cells;
2639 self->arePolyhedronsNotCorrectlyOriented(cells);
2640 DataArrayIdType *ret=DataArrayIdType::New();
2641 ret->alloc(cells.size(),1);
2642 std::copy(cells.begin(),cells.end(),ret->getPointer());
2643 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2646 PyObject *getFastAveragePlaneOfThis() const
2650 self->getFastAveragePlaneOfThis(vec,pos);
2652 std::copy(vec,vec+3,vals);
2653 std::copy(pos,pos+3,vals+3);
2654 return convertDblArrToPyListOfTuple<double>(vals,3,2);
2657 static MEDCouplingUMesh *MergeUMeshes(PyObject *li)
2659 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2660 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2661 return MEDCouplingUMesh::MergeUMeshes(tmp);
2664 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const
2666 DataArrayIdType *ret1;
2667 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2668 PyObject *ret=PyTuple_New(2);
2669 PyObject *ret0Py=ret0?Py_True:Py_False;
2671 PyTuple_SetItem(ret,0,ret0Py);
2672 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2676 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const
2678 DataArrayIdType *ret1;
2679 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2680 PyObject *ret=PyTuple_New(2);
2681 PyObject *ret0Py=ret0?Py_True:Py_False;
2683 PyTuple_SetItem(ret,0,ret0Py);
2684 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2688 PyObject *explode3DMeshTo1D() const
2690 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2691 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2692 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2693 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2694 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2695 PyObject *ret=PyTuple_New(5);
2696 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2697 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2698 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2699 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2700 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2704 PyObject *explodeIntoEdges() const
2706 MCAuto<DataArrayIdType> desc,descIndex,revDesc,revDescIndx;
2707 MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2708 PyObject *ret=PyTuple_New(5);
2709 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2710 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2711 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2712 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2713 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2717 PyObject *explodeMeshIntoMicroEdges() const
2719 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2720 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2721 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2722 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2723 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2724 PyObject *ret=PyTuple_New(5);
2725 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2726 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2727 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2728 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2729 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2733 PyObject *buildDescendingConnectivity() const
2735 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2736 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2737 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2738 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2739 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2740 PyObject *ret=PyTuple_New(5);
2741 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2742 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2743 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2744 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2745 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2749 PyObject *buildDescendingConnectivity2() const
2751 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2752 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2753 MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2754 MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2755 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2756 PyObject *ret=PyTuple_New(5);
2757 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2758 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2759 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2760 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2761 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2765 PyObject *computeNeighborsOfCells() const
2767 DataArrayIdType *neighbors=0,*neighborsIdx=0;
2768 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2769 PyObject *ret=PyTuple_New(2);
2770 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2771 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2775 PyObject *computeNeighborsOfNodes() const
2777 DataArrayIdType *neighbors=0,*neighborsIdx=0;
2778 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2779 PyObject *ret=PyTuple_New(2);
2780 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2781 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2785 PyObject *computeEnlargedNeighborsOfNodes() const
2787 MCAuto<DataArrayIdType> neighbors,neighborsIdx;
2788 self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2789 PyObject *ret=PyTuple_New(2);
2790 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2791 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2795 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayIdType *nodeNeigh, const DataArrayIdType *nodeNeighI) const
2797 MCAuto<DataArrayIdType> cellNeigh,cellNeighIndex;
2798 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2799 PyObject *ret=PyTuple_New(2);
2800 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2801 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2805 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *revDesc, const DataArrayIdType *revDescI)
2807 DataArrayIdType *neighbors=0,*neighborsIdx=0;
2808 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2809 PyObject *ret=PyTuple_New(2);
2810 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2811 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2815 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2817 MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2818 MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2819 DataArrayIdType *d2,*d3,*d4,*dd5;
2820 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2821 PyObject *ret=PyTuple_New(7);
2822 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2823 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2824 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2825 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2826 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2827 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2828 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2832 DataArrayDouble *getPartBarycenterAndOwner(DataArrayIdType *da) const
2835 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2836 da->checkAllocated();
2837 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2840 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayIdType *da) const
2843 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2844 da->checkAllocated();
2845 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2848 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayIdType *da) const
2851 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2852 da->checkAllocated();
2853 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2856 PyObject *getTypesOfPart(DataArrayIdType *da) const
2859 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2860 da->checkAllocated();
2861 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2862 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2863 PyObject *res = PyList_New(result.size());
2864 for (int i=0;iL!=result.end(); i++, iL++)
2865 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2869 DataArrayIdType *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayIdType *da) const
2872 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2873 da->checkAllocated();
2874 DataArrayIdType *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2875 ret->setName(da->getName().c_str());
2879 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps)
2881 DataArrayIdType *cellNb1=0,*cellNb2=0;
2882 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2883 PyObject *ret=PyTuple_New(3);
2884 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2885 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2886 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2890 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps)
2892 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2893 DataArrayIdType *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2894 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2895 PyObject *ret(PyTuple_New(4));
2896 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2897 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2898 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2899 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2903 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const
2905 int spaceDim=self->getSpaceDimension();
2907 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2909 DataArrayDouble *a,*a2;
2910 DataArrayDoubleTuple *aa,*aa2;
2911 std::vector<double> bb,bb2;
2913 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st parameter for origin.";
2914 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd parameter for vector.";
2915 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2916 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2918 DataArrayIdType *cellIds=0;
2919 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2920 PyObject *ret=PyTuple_New(2);
2921 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2922 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2926 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const
2928 int spaceDim=self->getSpaceDimension();
2930 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2932 DataArrayDouble *a,*a2;
2933 DataArrayDoubleTuple *aa,*aa2;
2934 std::vector<double> bb,bb2;
2936 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st parameter for origin.";
2937 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd parameter for vector.";
2938 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2939 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2941 DataArrayIdType *cellIds=0;
2942 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2943 PyObject *ret=PyTuple_New(2);
2944 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2945 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2949 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const
2952 DataArrayDouble *a,*a2;
2953 DataArrayDoubleTuple *aa,*aa2;
2954 std::vector<double> bb,bb2;
2956 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st parameter for origin.";
2957 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd parameter for vector.";
2958 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2959 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2960 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2964 DataArrayIdType *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const
2966 int spaceDim=self->getSpaceDimension();
2968 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2970 DataArrayDouble *a,*a2;
2971 DataArrayDoubleTuple *aa,*aa2;
2972 std::vector<double> bb,bb2;
2974 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st parameter for origin.";
2975 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd parameter for vector.";
2976 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2977 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2978 return self->getCellIdsCrossingPlane(orig,vect,eps);
2981 void convertToPolyTypes(PyObject *li)
2985 std::vector<mcIdType> pos2;
2986 DataArrayIdType *pos3=0;
2987 DataArrayIdTypeTuple *pos4=0;
2988 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2993 self->convertToPolyTypes(&pos1,&pos1+1);
3000 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
3005 self->convertToPolyTypes(pos3->begin(),pos3->end());
3009 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
3013 void convertAllToPoly();
3014 void convertExtrudedPolyhedra();
3016 void simplifyPolyhedra(double eps);
3017 MEDCouplingUMesh *buildSpreadZonesWithPoly() const;
3018 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy);
3021 //== MEDCouplingUMesh End
3023 //== MEDCouplingMappedExtrudedMesh
3025 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
3028 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
3029 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D);
3030 MEDCouplingUMesh *build3DUnstructuredMesh() const;
3031 int get2DCellIdForExtrusion() const;
3033 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, mcIdType cell2DId)
3035 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3038 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D)
3040 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3043 MEDCouplingMappedExtrudedMesh()
3045 return MEDCouplingMappedExtrudedMesh::New();
3048 std::string __str__() const
3050 return self->simpleRepr();
3053 std::string __repr__() const
3055 std::ostringstream oss;
3056 self->reprQuickOverview(oss);
3060 PyObject *getMesh2D() const
3062 MEDCouplingUMesh *ret=self->getMesh2D();
3065 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3067 PyObject *getMesh1D() const
3069 MEDCouplingUMesh *ret=self->getMesh1D();
3072 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3074 PyObject *getMesh3DIds() const
3076 DataArrayIdType *ret=self->getMesh3DIds();
3079 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
3084 //== MEDCouplingMappedExtrudedMesh End
3086 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3089 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3090 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m);
3091 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const;
3092 int getNodalConnectivityLength() const;
3093 virtual void allocateCells(int nbOfCells=0);
3094 virtual void checkConsistencyOfConnectivity() const;
3097 virtual void insertNextCell(PyObject *li)
3099 mcIdType szArr,sw,iTypppArr;
3100 std::vector<mcIdType> stdvecTyyppArr;
3101 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3102 self->insertNextCell(tmp,tmp+szArr);
3105 virtual DataArrayIdType *getNodalConnectivity() const
3107 DataArrayIdType *ret=self->getNodalConnectivity();
3108 if(ret) ret->incrRef();
3112 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li)
3114 std::vector< const MEDCoupling1GTUMesh *> parts;
3115 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3116 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3121 //== MEDCoupling1SGTUMesh
3123 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3126 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3127 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m);
3128 void setNodalConnectivity(DataArrayIdType *nodalConn);
3129 int getNumberOfNodesPerCell() const;
3130 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2);
3131 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
3132 MEDCoupling1GTUMesh *computeDualMesh() const;
3133 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const;
3134 DataArrayIdType *sortHexa8EachOther();
3137 MEDCoupling1SGTUMesh()
3139 return MEDCoupling1SGTUMesh::New();
3142 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
3144 return MEDCoupling1SGTUMesh::New(name,type);
3147 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m)
3149 return MEDCoupling1SGTUMesh::New(m);
3152 std::string __str__() const
3154 return self->simpleRepr();
3157 std::string __repr__() const
3159 std::ostringstream oss;
3160 self->reprQuickOverview(oss);
3164 PyObject *structurizeMe(double eps=1e-12) const
3166 DataArrayIdType *cellPerm(0),*nodePerm(0);
3167 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3168 PyObject *ret(PyTuple_New(3));
3169 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3170 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3171 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3175 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li)
3177 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3178 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3179 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3182 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li)
3184 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3185 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3186 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3191 //== MEDCoupling1SGTUMesh End
3193 //== MEDCoupling1DGTUMesh
3195 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3198 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3199 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m);
3200 void setNodalConnectivity(DataArrayIdType *nodalConn, DataArrayIdType *nodalConnIndex);
3201 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
3202 bool isPacked() const;
3205 MEDCoupling1DGTUMesh()
3207 return MEDCoupling1DGTUMesh::New();
3209 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
3211 return MEDCoupling1DGTUMesh::New(name,type);
3214 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m)
3216 return MEDCoupling1DGTUMesh::New(m);
3219 std::string __str__() const
3221 return self->simpleRepr();
3224 std::string __repr__() const
3226 std::ostringstream oss;
3227 self->reprQuickOverview(oss);
3231 DataArrayIdType *getNodalConnectivityIndex() const
3233 DataArrayIdType *ret=self->getNodalConnectivityIndex();
3234 if(ret) ret->incrRef();
3238 PyObject *retrievePackedNodalConnectivity() const
3240 DataArrayIdType *ret1=0,*ret2=0;
3241 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3242 PyObject *ret0Py=ret0?Py_True:Py_False;
3244 PyObject *ret=PyTuple_New(3);
3245 PyTuple_SetItem(ret,0,ret0Py);
3246 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3247 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3251 PyObject *copyWithNodalConnectivityPacked() const
3254 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3255 PyObject *ret=PyTuple_New(2);
3256 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3257 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3258 PyTuple_SetItem(ret,1,ret1Py);
3262 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li)
3264 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3265 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3266 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3269 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li)
3271 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3272 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3273 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3276 static DataArrayIdType *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<mcIdType>& offsetInNodeIdsPerElt)
3278 std::vector<const MEDCoupling::DataArrayIdType *> tmp;
3279 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",tmp);
3280 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3285 //== MEDCoupling1DGTUMeshEnd
3287 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3290 mcIdType getCellIdFromPos(mcIdType i, mcIdType j, mcIdType k) const;
3291 mcIdType getNodeIdFromPos(mcIdType i, mcIdType j, mcIdType k) const;
3292 mcIdType getNumberOfCellsOfSubLevelMesh() const;
3293 int getSpaceDimensionOnNodeStruct() const;
3294 double computeSquareness() const;
3295 virtual std::vector<mcIdType> getNodeGridStructure() const;
3296 std::vector<mcIdType> getCellGridStructure() const;
3297 MEDCoupling1SGTUMesh *build1SGTUnstructured() const;
3298 std::vector<mcIdType> getLocationFromCellId(mcIdType cellId) const;
3299 std::vector<mcIdType> getLocationFromNodeId(mcIdType cellId) const;
3300 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim);
3301 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const;
3302 static mcIdType DeduceNumberOfGivenStructure(const std::vector<mcIdType>& st);
3303 static DataArrayIdType *ComputeCornersGhost(const std::vector<mcIdType>& st, mcIdType ghostLev);
3304 static std::vector<mcIdType> GetSplitVectFromStruct(const std::vector<mcIdType>& strct);
3307 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const
3309 mcIdType tmpp1=-1,tmpp2=-1;
3310 std::vector<mcIdType> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3311 std::vector< std::pair<mcIdType,mcIdType> > inp;
3315 for(mcIdType i=0;i<tmpp1;i++)
3316 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3321 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3322 inp.resize(tmpp1/2);
3323 for(mcIdType i=0;i<tmpp1/2;i++)
3324 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3327 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3328 return self->buildStructuredSubPart(inp);
3331 static DataArrayIdType *BuildExplicitIdsFrom(PyObject *st, PyObject *part)
3333 std::vector< std::pair<mcIdType,mcIdType> > inp;
3334 convertPyToVectorPairInt(part,inp);
3336 mcIdType szArr,sw,iTypppArr;
3337 std::vector<mcIdType> stdvecTyyppArr;
3338 const mcIdType *tmp4=convertIntStarLikePyObjToCppIntStar(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3339 std::vector<mcIdType> tmp5(tmp4,tmp4+szArr);
3341 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3344 static void MultiplyPartOf(const std::vector<mcIdType>& st, PyObject *part, double factor, DataArrayDouble *da)
3346 std::vector< std::pair<mcIdType,mcIdType> > inp;
3347 convertPyToVectorPairInt(part,inp);
3348 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3351 static void MultiplyPartOfByGhost(const std::vector<mcIdType>& st, PyObject *part, mcIdType ghostSize, double factor, DataArrayDouble *da)
3353 std::vector< std::pair<mcIdType,mcIdType> > inp;
3354 convertPyToVectorPairInt(part,inp);
3355 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3358 static PyObject *PutInGhostFormat(mcIdType ghostSize, const std::vector<mcIdType>& st, PyObject *part)
3360 std::vector< std::pair<mcIdType,mcIdType> > inp;
3361 convertPyToVectorPairInt(part,inp);
3362 std::vector<mcIdType> stWithGhost;
3363 std::vector< std::pair<mcIdType,mcIdType> > partWithGhost;
3364 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3365 PyObject *ret(PyTuple_New(2));
3366 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3367 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3371 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<mcIdType>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat)
3373 std::vector< std::pair<mcIdType,mcIdType> > inp;
3374 convertPyToVectorPairInt(partCompactFormat,inp);
3375 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3378 static void AssignPartOfFieldOfDoubleUsing(const std::vector<mcIdType>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other)
3380 std::vector< std::pair<mcIdType,mcIdType> > inp;
3381 convertPyToVectorPairInt(partCompactFormat,inp);
3382 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3385 static mcIdType DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part)
3387 std::vector< std::pair<mcIdType,mcIdType> > inp;
3388 convertPyToVectorPairInt(part,inp);
3389 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3392 static DataArrayIdType *Build1GTNodalConnectivity(PyObject *li)
3394 mcIdType szArr,sw,iTypppArr;
3395 std::vector<mcIdType> stdvecTyyppArr;
3396 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3397 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3400 static DataArrayIdType *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li)
3402 mcIdType szArr,sw,iTypppArr;
3403 std::vector<mcIdType> stdvecTyyppArr;
3404 const mcIdType *tmp(convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3405 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3408 static std::vector<mcIdType> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat)
3410 std::vector< std::pair<mcIdType,mcIdType> > inp;
3411 convertPyToVectorPairInt(partCompactFormat,inp);
3412 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3415 static PyObject *GetCompactFrmtFromDimensions(const std::vector<mcIdType>& dims)
3417 std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3418 PyObject *retPy=PyList_New(ret.size());
3419 for(std::size_t i=0;i<ret.size();i++)
3421 PyObject *tmp=PyTuple_New(2);
3422 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3423 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3424 PyList_SetItem(retPy,i,tmp);
3429 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2)
3431 std::vector< std::pair<mcIdType,mcIdType> > r1Cpp,r2Cpp;
3432 convertPyToVectorPairInt(r1,r1Cpp);
3433 convertPyToVectorPairInt(r2,r2Cpp);
3434 std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3435 PyObject *retPy=PyList_New(ret.size());
3436 for(std::size_t i=0;i<ret.size();i++)
3438 PyObject *tmp=PyTuple_New(2);
3439 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3440 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3441 PyList_SetItem(retPy,i,tmp);
3446 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3448 std::vector< std::pair<mcIdType,mcIdType> > r1Cpp,r2Cpp;
3449 convertPyToVectorPairInt(r1,r1Cpp);
3450 convertPyToVectorPairInt(r2,r2Cpp);
3451 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3454 static PyObject *IsPartStructured(PyObject *li, PyObject *st)
3456 mcIdType szArr,sw,iTypppArr;
3457 std::vector<mcIdType> stdvecTyyppArr;
3458 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3459 mcIdType szArr2,sw2,iTypppArr2;
3460 std::vector<mcIdType> stdvecTyyppArr2;
3461 const mcIdType *tmp2=convertIntStarLikePyObjToCppIntStar(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3462 std::vector<mcIdType> tmp3(tmp2,tmp2+szArr2);
3463 std::vector< std::pair<mcIdType,mcIdType> > partCompactFormat;
3464 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3465 PyObject *ret=PyTuple_New(2);
3466 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3467 PyTuple_SetItem(ret,0,ret0Py);
3468 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3469 for(std::size_t i=0;i<partCompactFormat.size();i++)
3471 PyObject *tmp4=PyTuple_New(2);
3472 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3473 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3474 PyList_SetItem(ret1Py,i,tmp4);
3476 PyTuple_SetItem(ret,1,ret1Py);
3480 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true)
3482 std::vector< std::pair<mcIdType,mcIdType> > param0,param1,ret;
3483 convertPyToVectorPairInt(bigInAbs,param0);
3484 convertPyToVectorPairInt(partOfBigInAbs,param1);
3485 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3486 PyObject *retPy(PyList_New(ret.size()));
3487 for(std::size_t i=0;i<ret.size();i++)
3489 PyObject *tmp(PyTuple_New(2));
3490 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3491 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3492 PyList_SetItem(retPy,i,tmp);
3497 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<mcIdType>& translation)
3499 std::vector< std::pair<mcIdType,mcIdType> > param0;
3500 convertPyToVectorPairInt(part,param0);
3501 std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3502 PyObject *retPy(PyList_New(ret.size()));
3503 for(std::size_t i=0;i<ret.size();i++)
3505 PyObject *tmp(PyTuple_New(2));
3506 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3507 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3508 PyList_SetItem(retPy,i,tmp);
3513 static std::vector<mcIdType> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo)
3515 std::vector< std::pair<mcIdType,mcIdType> > param0,param1;
3516 convertPyToVectorPairInt(startingFrom,param0);
3517 convertPyToVectorPairInt(goingTo,param1);
3518 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3521 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true)
3523 std::vector< std::pair<mcIdType,mcIdType> > param0,param1,ret;
3524 convertPyToVectorPairInt(bigInAbs,param0);
3525 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3526 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3527 PyObject *retPy(PyList_New(ret.size()));
3528 for(std::size_t i=0;i<ret.size();i++)
3530 PyObject *tmp(PyTuple_New(2));
3531 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3532 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3533 PyList_SetItem(retPy,i,tmp);
3540 class MEDCouplingCurveLinearMesh;
3542 //== MEDCouplingCMesh
3544 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3547 static MEDCouplingCMesh *New();
3548 static MEDCouplingCMesh *New(const std::string& meshName);
3549 void setCoords(const DataArrayDouble *coordsX,
3550 const DataArrayDouble *coordsY=0,
3551 const DataArrayDouble *coordsZ=0);
3552 void setCoordsAt(int i, const DataArrayDouble *arr);
3553 MEDCouplingCurveLinearMesh *buildCurveLinear() const;
3557 return MEDCouplingCMesh::New();
3559 MEDCouplingCMesh(const std::string& meshName)
3561 return MEDCouplingCMesh::New(meshName);
3563 std::string __str__() const
3565 return self->simpleRepr();
3567 std::string __repr__() const
3569 std::ostringstream oss;
3570 self->reprQuickOverview(oss);
3573 DataArrayDouble *getCoordsAt(int i)
3575 DataArrayDouble *ret=self->getCoordsAt(i);
3583 //== MEDCouplingCMesh End
3585 //== MEDCouplingCurveLinearMesh
3587 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3590 static MEDCouplingCurveLinearMesh *New();
3591 static MEDCouplingCurveLinearMesh *New(const std::string& meshName);
3592 void setCoords(const DataArrayDouble *coords);
3594 MEDCouplingCurveLinearMesh()
3596 return MEDCouplingCurveLinearMesh::New();
3598 MEDCouplingCurveLinearMesh(const std::string& meshName)
3600 return MEDCouplingCurveLinearMesh::New(meshName);
3602 std::string __str__() const
3604 return self->simpleRepr();
3606 std::string __repr__() const
3608 std::ostringstream oss;
3609 self->reprQuickOverview(oss);
3612 DataArrayDouble *getCoords()
3614 DataArrayDouble *ret=self->getCoords();
3619 void setNodeGridStructure(PyObject *gridStruct)
3621 mcIdType szArr,sw,iTypppArr;
3622 std::vector<mcIdType> stdvecTyyppArr;
3623 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3624 self->setNodeGridStructure(tmp,tmp+szArr);
3629 //== MEDCouplingCurveLinearMesh End
3631 //== MEDCouplingIMesh
3633 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3636 static MEDCouplingIMesh *New();
3638 void setSpaceDimension(int spaceDim);
3639 std::vector<mcIdType> getNodeStruct() const;
3640 std::vector<double> getOrigin() const;
3641 std::vector<double> getDXYZ() const;
3642 void setAxisUnit(const std::string& unitName);
3643 std::string getAxisUnit() const;
3644 double getMeasureOfAnyCell() const;
3645 MEDCouplingCMesh *convertToCartesian() const;
3646 void refineWithFactor(const std::vector<mcIdType>& factors);
3647 MEDCouplingIMesh *asSingleCell() const;
3648 MEDCouplingIMesh *buildWithGhost(mcIdType ghostLev) const;
3653 return MEDCouplingIMesh::New();
3655 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
3657 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3658 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3659 const mcIdType *nodeStrctPtr(0);
3660 const double *originPtr(0),*dxyzPtr(0);
3661 mcIdType sw,sz,val0;
3662 std::vector<mcIdType> bb0;
3663 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
3666 std::vector<double> bb,bb2;
3668 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3669 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3671 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3674 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
3676 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3679 void setNodeStruct(PyObject *nodeStrct)
3681 mcIdType sw,sz,val0;
3682 std::vector<mcIdType> bb0;
3683 const mcIdType *nodeStrctPtr(convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0));
3684 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3687 void setOrigin(PyObject *origin)
3689 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3691 std::vector<double> bb;
3692 mcIdType sw,nbTuples;
3693 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3694 self->setOrigin(originPtr,originPtr+nbTuples);
3697 void setDXYZ(PyObject *dxyz)
3699 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3701 std::vector<double> bb;
3702 mcIdType sw,nbTuples;
3703 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3704 self->setDXYZ(originPtr,originPtr+nbTuples);
3707 static void CondenseFineToCoarse(const std::vector<mcIdType>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, DataArrayDouble *coarseDA)
3709 std::vector< std::pair<mcIdType,mcIdType> > inp;
3710 convertPyToVectorPairInt(fineLocInCoarse,inp);
3711 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3714 static void CondenseFineToCoarseGhost(const std::vector<mcIdType>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, DataArrayDouble *coarseDA, mcIdType ghostSize)
3716 std::vector< std::pair<mcIdType,mcIdType> > inp;
3717 convertPyToVectorPairInt(fineLocInCoarse,inp);
3718 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3721 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts)
3723 std::vector< std::pair<mcIdType,mcIdType> > inp;
3724 convertPyToVectorPairInt(fineLocInCoarse,inp);
3725 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3728 static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, mcIdType ghostSize)
3730 std::vector< std::pair<mcIdType,mcIdType> > inp;
3731 convertPyToVectorPairInt(fineLocInCoarse,inp);
3732 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3735 static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, mcIdType ghostSize)
3737 std::vector< std::pair<mcIdType,mcIdType> > inp;
3738 convertPyToVectorPairInt(fineLocInCoarse,inp);
3739 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3742 std::string __str__() const
3744 return self->simpleRepr();
3746 std::string __repr__() const
3748 std::ostringstream oss;
3749 self->reprQuickOverview(oss);
3755 //== MEDCouplingIMesh End
3759 namespace MEDCoupling
3761 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3764 virtual void checkConsistencyLight() const;
3765 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const;
3766 bool areStrictlyCompatible(const MEDCouplingField *other) const;
3767 bool areStrictlyCompatibleForMulDiv(const MEDCouplingField *other) const;
3768 virtual void copyTinyStringsFrom(const MEDCouplingField *other);
3769 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh);
3770 void setName(const char *name);
3771 std::string getDescription() const;
3772 void setDescription(const char *desc);
3773 std::string getName() const;
3774 TypeOfField getTypeOfField() const;
3775 NatureOfField getNature() const;
3776 virtual void setNature(NatureOfField nat);
3777 DataArrayDouble *getLocalizationOfDiscr() const;
3778 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const;
3779 mcIdType getNumberOfTuplesExpected() const;
3780 mcIdType getNumberOfMeshPlacesExpected() const;
3781 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3782 const std::vector<double>& gsCoo, const std::vector<double>& wg);
3783 void clearGaussLocalizations();
3784 MEDCouplingGaussLocalization& getGaussLocalization(int locId);
3785 mcIdType getNbOfGaussLocalization() const;
3786 mcIdType getGaussLocalizationIdOfOneCell(mcIdType cellId) const;
3787 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const;
3788 mcIdType getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const;
3789 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3791 PyObject *getMesh() const
3793 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3796 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3799 PyObject *getDiscretization()
3801 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3804 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3807 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const
3809 std::set<mcIdType> ret=self->getGaussLocalizationIdsOfOneType(type);
3810 return convertIntArrToPyList3(ret);
3813 PyObject *buildSubMeshData(PyObject *li) const
3815 DataArrayIdType *ret1=0;
3816 MEDCouplingMesh *ret0=0;
3818 int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
3819 if (!SWIG_IsOK(res1))
3822 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
3823 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3827 DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
3829 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
3830 da2->checkAllocated();
3831 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3833 PyObject *res = PyList_New(2);
3834 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3835 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
3839 PyObject *buildSubMeshDataRange(mcIdType begin, mcIdType end, mcIdType step) const
3841 DataArrayIdType *ret1=0;
3843 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3844 PyObject *res=PyTuple_New(2);
3845 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3847 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
3850 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3851 PyTuple_SetItem(res,1,res1);
3856 DataArrayIdType *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3859 mcIdType v0; std::vector<mcIdType> v1;
3860 const mcIdType *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
3861 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3864 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3865 const std::vector<double>& gsCoo, const std::vector<double>& wg)
3868 int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
3869 if (!SWIG_IsOK(res1))
3872 INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
3873 self->setGaussLocalizationOnCells(tmp,((mcIdType *)tmp)+size,refCoo,gsCoo,wg);
3877 DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
3879 throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
3880 da2->checkAllocated();
3881 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3885 PyObject *getCellIdsHavingGaussLocalization(int locId) const
3887 std::vector<mcIdType> tmp;
3888 self->getCellIdsHavingGaussLocalization(locId,tmp);
3889 DataArrayIdType *ret=DataArrayIdType::New();
3890 ret->alloc((mcIdType)tmp.size(),1);
3891 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3892 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
3895 mcIdType getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const
3897 std::vector<mcIdType> inp0;
3898 convertPyToNewIntArr4(code,1,3,inp0);
3899 std::vector<const DataArrayIdType *> inp1;
3900 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(idsPerType,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",inp1);
3901 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3906 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3909 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f);
3910 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f);
3911 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt32& f);
3912 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt64& f);
3913 static MEDCouplingFieldTemplate *New(TypeOfField type);
3914 std::string simpleRepr() const;
3915 std::string advancedRepr() const;
3916 bool isEqual(const MEDCouplingFieldTemplate *other, double meshPrec) const;
3917 bool isEqualWithoutConsideringStr(const MEDCouplingFieldTemplate *other, double meshPrec) const;
3920 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f)
3922 return MEDCouplingFieldTemplate::New(f);
3925 MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f)
3927 return MEDCouplingFieldTemplate::New(f);
3930 MEDCouplingFieldTemplate(const MEDCouplingFieldInt32& f)
3932 return MEDCouplingFieldTemplate::New(f);
3935 MEDCouplingFieldTemplate(const MEDCouplingFieldInt64& f)
3937 return MEDCouplingFieldTemplate::New(f);
3940 MEDCouplingFieldTemplate(TypeOfField type)
3942 return MEDCouplingFieldTemplate::New(type);
3945 std::string __str__() const
3947 return self->simpleRepr();
3950 std::string __repr__() const
3952 std::ostringstream oss;
3953 self->reprQuickOverview(oss);
3957 PyObject *isEqualIfNotWhy(const MEDCouplingFieldTemplate *other, double meshPrec) const
3960 bool ret0=self->isEqualIfNotWhy(other,meshPrec,ret1);
3961 PyObject *ret=PyTuple_New(2);
3962 PyObject *ret0Py=ret0?Py_True:Py_False;
3964 PyTuple_SetItem(ret,0,ret0Py);
3965 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3972 class MEDCouplingFieldT : public MEDCoupling::MEDCouplingField
3975 TypeOfTimeDiscretization getTimeDiscretization() const;
3977 MEDCouplingFieldT();
3978 ~MEDCouplingFieldT();
3981 %template(MEDCouplingFieldTdouble) MEDCoupling::MEDCouplingFieldT<double>;
3982 %template(MEDCouplingFieldTfloat) MEDCoupling::MEDCouplingFieldT<float>;
3983 %template(MEDCouplingFieldTint) MEDCoupling::MEDCouplingFieldT<int>;
3985 class MEDCouplingFieldInt32;
3986 class MEDCouplingFieldInt64;
3987 class MEDCouplingFieldFloat;
3989 class MEDCouplingFieldDouble : public MEDCouplingFieldT<double>
3992 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3993 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3994 bool isEqual(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
3995 bool isEqualWithoutConsideringStr(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
3996 void setTimeUnit(const std::string& unit);
3997 std::string getTimeUnit() const;
3998 void synchronizeTimeWithSupport();
3999 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other);
4000 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other);
4001 std::string simpleRepr() const;
4002 std::string advancedRepr() const;
4003 std::string writeVTK(const std::string& fileName, bool isBinary=true) const;
4004 MEDCouplingFieldInt32 *convertToIntField() const;
4005 MEDCouplingFieldFloat *convertToFloatField() const;
4006 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
4007 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
4008 MEDCouplingFieldDouble *deepCopy() const;
4009 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const;
4010 MEDCouplingFieldDouble *nodeToCellDiscretization() const;
4011 MEDCouplingFieldDouble *cellToNodeDiscretization() const;
4012 double getIJ(int tupleId, int compoId) const;
4013 double getIJK(int cellId, int nodeIdInCell, int compoId) const;
4014 void synchronizeTimeWithMesh();
4015 void setArray(DataArrayDouble *array);
4016 void setEndArray(DataArrayDouble *array);
4017 void setTime(double val, int iteration, int order);
4018 void setStartTime(double val, int iteration, int order);
4019 void setEndTime(double val, int iteration, int order);
4020 void applyLin(double a, double b, int compoId);
4021 void applyLin(double a, double b);
4022 int getNumberOfComponents() const;
4023 int getNumberOfTuples() const;
4024 int getNumberOfValues() const;
4025 void setTimeTolerance(double val);
4026 double getTimeTolerance() const;
4027 void setIteration(int it);
4028 void setEndIteration(int it);
4029 void setOrder(int order);
4030 void setEndOrder(int order);
4031 void setTimeValue(double val);
4032 void setEndTimeValue(double val);
4033 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15);
4034 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15);
4035 bool mergeNodes(double eps, double epsOnVals=1e-15);
4036 bool mergeNodesCenter(double eps, double epsOnVals=1e-15);
4037 bool zipCoords(double epsOnVals=1e-15);
4038 bool zipConnectivity(int compType,double epsOnVals=1e-15);
4039 bool simplexize(int policy);
4040 MEDCouplingFieldDouble *doublyContractedProduct() const;
4041 MEDCouplingFieldDouble *determinant() const;
4042 MEDCouplingFieldDouble *eigenValues() const;
4043 MEDCouplingFieldDouble *eigenVectors() const;
4044 MEDCouplingFieldDouble *inverse() const;
4045 MEDCouplingFieldDouble *trace() const;
4046 MEDCouplingFieldDouble *deviator() const;
4047 MEDCouplingFieldDouble *magnitude() const;
4048 MEDCouplingFieldDouble *maxPerTuple() const;
4049 void changeNbOfComponents(std::size_t newNbOfComp, double dftValue=0.);
4050 void sortPerTuple(bool asc);
4051 MEDCouplingFieldDouble &operator=(double value);
4052 void fillFromAnalytic(int nbOfComp, const std::string& func);
4053 void fillFromAnalyticCompo(int nbOfComp, const std::string& func);
4054 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
4055 void applyFunc(int nbOfComp, const std::string& func);
4056 void applyFuncCompo(int nbOfComp, const std::string& func);
4057 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
4058 void applyFunc(int nbOfComp, double val);
4059 void applyFunc(const std::string& func);
4060 void applyFuncFast32(const std::string& func);
4061 void applyFuncFast64(const std::string& func);
4062 double accumulate(int compId) const;
4063 double getMaxValue() const;
4064 double getMinValue() const;
4065 double getAverageValue() const;
4066 double norm2() const;
4067 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4068 double getWeightedAverageValue(int compId, bool isWAbs) const;
4069 double integral(int compId, bool isWAbs) const;
4070 double normL1(int compId) const;
4071 double normL2(int compId) const;
4072 double normMax(int compId) const;
4073 DataArrayIdType *findIdsInRange(double vmin, double vmax) const;
4074 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const;
4075 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4076 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4077 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4078 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const;
4079 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4080 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const;
4081 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4082 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const;
4083 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4084 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4085 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4086 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4087 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4088 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const;
4089 MEDCouplingFieldDouble *negate() const;
4091 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4093 return MEDCouplingFieldDouble::New(type,td);
4096 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4098 return MEDCouplingFieldDouble::New(ft,td);
4101 std::string __str__() const
4103 return self->simpleRepr();
4106 std::string __repr__() const
4108 std::ostringstream oss;
4109 self->reprQuickOverview(oss);
4113 PyObject *isEqualIfNotWhy(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const
4116 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
4117 PyObject *ret=PyTuple_New(2);
4118 PyObject *ret0Py=ret0?Py_True:Py_False;
4120 PyTuple_SetItem(ret,0,ret0Py);
4121 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4125 MEDCouplingFieldDouble *voronoize(double eps) const
4127 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4131 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const
4133 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4137 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4139 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4141 DataArrayDouble *a,*a2;
4142 DataArrayDoubleTuple *aa,*aa2;
4143 std::vector<double> bb,bb2;
4145 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4146 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4147 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4150 DataArrayDouble *getArray()
4152 DataArrayDouble *ret=self->getArray();
4158 PyObject *getArrays() const
4160 std::vector<DataArrayDouble *> arrs=self->getArrays();
4161 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4164 std::size_t sz=arrs.size();
4165 PyObject *ret=PyTuple_New(sz);
4166 for(std::size_t i=0;i<sz;i++)
4169 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4171 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4176 void setArrays(PyObject *ls)
4178 std::vector<const DataArrayDouble *> tmp;
4179 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4180 std::size_t sz=tmp.size();
4181 std::vector<DataArrayDouble *> arrs(sz);
4182 for(std::size_t i=0;i<sz;i++)
4183 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4184 self->setArrays(arrs);
4187 DataArrayDouble *getEndArray()
4189 DataArrayDouble *ret=self->getEndArray();
4195 PyObject *getValueOn(PyObject *sl) const
4199 DataArrayDoubleTuple *aa;
4200 std::vector<double> bb;
4202 const MEDCouplingMesh *mesh=self->getMesh();
4204 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4205 int spaceDim=mesh->getSpaceDimension();
4206 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4207 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4209 mcIdType sz=ToIdType(self->getNumberOfComponents());
4210 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4211 self->getValueOn(spaceLoc,res);
4212 return convertDblArrToPyList<double>(res,sz);
4215 PyObject *getValueOnPos(mcIdType i, mcIdType j, mcIdType k) const
4217 mcIdType sz=ToIdType(self->getNumberOfComponents());
4218 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4219 self->getValueOnPos(i,j,k,res);
4220 return convertDblArrToPyList<double>(res,sz);
4223 DataArrayDouble *getValueOnMulti(PyObject *locs) const
4225 const MEDCouplingMesh *mesh(self->getMesh());
4227 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4230 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4231 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4232 mesh->getSpaceDimension(),true,nbPts);
4233 return self->getValueOnMulti(inp,(int)nbPts);
4236 PyObject *getValueOn(PyObject *sl, double time) const
4240 DataArrayDoubleTuple *aa;
4241 std::vector<double> bb;
4243 const MEDCouplingMesh *mesh=self->getMesh();
4245 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4246 int spaceDim=mesh->getSpaceDimension();
4247 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4248 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4251 mcIdType sz=ToIdType(self->getNumberOfComponents());
4252 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4253 self->getValueOn(spaceLoc,time,res);
4254 return convertDblArrToPyList<double>(res,sz);
4257 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
4259 if(self->getArray()!=0)
4260 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4263 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4264 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4265 self->setArray(arr);
4272 double tmp0=self->getTime(tmp1,tmp2);
4273 PyObject *res = PyList_New(3);
4274 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4275 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4276 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4280 PyObject *getStartTime()
4283 double tmp0=self->getStartTime(tmp1,tmp2);
4284 PyObject *res = PyList_New(3);
4285 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4286 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4287 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4291 PyObject *getEndTime()
4294 double tmp0=self->getEndTime(tmp1,tmp2);
4295 PyObject *res = PyList_New(3);
4296 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4297 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4298 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4301 PyObject *accumulate() const
4303 mcIdType sz=ToIdType(self->getNumberOfComponents());
4304 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4305 self->accumulate(tmp);
4306 return convertDblArrToPyList<double>(tmp,sz);
4308 PyObject *integral(bool isWAbs) const
4310 mcIdType sz=ToIdType(self->getNumberOfComponents());
4311 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4312 self->integral(isWAbs,tmp);
4313 return convertDblArrToPyList<double>(tmp,sz);
4315 PyObject *getWeightedAverageValue(bool isWAbs=true) const
4317 mcIdType sz=ToIdType(self->getNumberOfComponents());
4318 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4319 self->getWeightedAverageValue(tmp,isWAbs);
4320 return convertDblArrToPyList<double>(tmp,sz);
4322 PyObject *normL1() const
4324 mcIdType sz=ToIdType(self->getNumberOfComponents());
4325 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4327 return convertDblArrToPyList<double>(tmp,sz);
4329 PyObject *normL2() const
4331 mcIdType sz=ToIdType(self->getNumberOfComponents());
4332 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4334 return convertDblArrToPyList<double>(tmp,sz);
4336 PyObject *normMax() const
4338 mcIdType sz=ToIdType(self->getNumberOfComponents());
4339 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4341 return convertDblArrToPyList<double>(tmp,sz);
4343 void renumberCells(PyObject *li, bool check=true)
4345 mcIdType szArr,sw,iTypppArr;
4346 std::vector<mcIdType> stdvecTyyppArr;
4347 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4348 self->renumberCells(tmp,check);
4351 void renumberCellsWithoutMesh(PyObject *li, bool check=true)
4353 mcIdType szArr,sw,iTypppArr;
4354 std::vector<mcIdType> stdvecTyyppArr;
4355 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4356 self->renumberCellsWithoutMesh(tmp,check);
4359 void renumberNodes(PyObject *li, double eps=1e-15)
4361 mcIdType szArr,sw,iTypppArr;
4362 std::vector<mcIdType> stdvecTyyppArr;
4363 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4364 self->renumberNodes(tmp,eps);
4367 void renumberNodesWithoutMesh(PyObject *li, mcIdType newNbOfNodes, double eps=1e-15)
4369 mcIdType szArr,sw,iTypppArr;
4370 std::vector<mcIdType> stdvecTyyppArr;
4371 const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4372 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4375 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const
4377 return fieldT_buildSubPart(self,li);
4380 MEDCouplingFieldDouble *__getitem__(PyObject *li) const
4382 return fieldT__getitem__(self,li);
4385 PyObject *getMaxValue2() const
4387 DataArrayIdType *tmp;
4388 double r1=self->getMaxValue2(tmp);
4389 PyObject *ret=PyTuple_New(2);
4390 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4391 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4395 PyObject *getMinValue2() const
4397 DataArrayIdType *tmp;
4398 double r1=self->getMinValue2(tmp);
4399 PyObject *ret=PyTuple_New(2);
4400 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4401 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4405 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const
4407 std::vector<std::size_t> tmp;
4408 convertPyToNewIntArr3(li,tmp);
4409 return self->keepSelectedComponents(tmp);
4412 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li)
4414 std::vector<std::size_t> tmp;
4415 convertPyToNewIntArr3(li,tmp);
4416 self->setSelectedComponents(f,tmp);
4419 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const
4422 DataArrayDouble *a,*a2;
4423 DataArrayDoubleTuple *aa,*aa2;
4424 std::vector<double> bb,bb2;
4427 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st parameter for origin.";
4428 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd parameter for vector.";
4429 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4430 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4432 return self->extractSlice3D(orig,vect,eps);
4435 MEDCouplingFieldDouble *__add__(PyObject *obj)
4437 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4440 MEDCouplingFieldDouble *__radd__(PyObject *obj)
4442 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4445 MEDCouplingFieldDouble *__sub__(PyObject *obj)
4447 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.";
4448 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4451 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4453 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4455 return (*self)-(*other);
4457 throw INTERP_KERNEL::Exception(msg);
4462 DataArrayDoubleTuple *aa;
4463 std::vector<double> bb;
4465 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4470 if(!self->getArray())
4471 throw INTERP_KERNEL::Exception(msg2);
4472 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4473 ret->applyLin(1.,-val);
4474 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4475 ret2->setArray(ret);
4480 if(!self->getArray())
4481 throw INTERP_KERNEL::Exception(msg2);
4482 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4483 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4484 ret2->setArray(ret);
4489 if(!self->getArray())
4490 throw INTERP_KERNEL::Exception(msg2);
4491 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4492 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4493 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4494 ret2->setArray(ret);
4499 if(!self->getArray())
4500 throw INTERP_KERNEL::Exception(msg2);
4501 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4502 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4503 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4504 ret2->setArray(ret);
4508 { throw INTERP_KERNEL::Exception(msg); }
4512 MEDCouplingFieldDouble *__rsub__(PyObject *obj)
4514 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4517 MEDCouplingFieldDouble *__mul__(PyObject *obj)
4519 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4522 MEDCouplingFieldDouble *__rmul__(PyObject *obj)
4524 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4527 MEDCouplingFieldDouble *__div__(PyObject *obj)
4529 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.";
4530 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4533 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4535 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4537 return (*self)/(*other);
4539 throw INTERP_KERNEL::Exception(msg);
4544 DataArrayDoubleTuple *aa;
4545 std::vector<double> bb;
4547 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4553 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4554 if(!self->getArray())
4555 throw INTERP_KERNEL::Exception(msg2);
4556 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4557 ret->applyLin(1./val,0);
4558 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4559 ret2->setArray(ret);
4564 if(!self->getArray())
4565 throw INTERP_KERNEL::Exception(msg2);
4566 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4567 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4568 ret2->setArray(ret);
4573 if(!self->getArray())
4574 throw INTERP_KERNEL::Exception(msg2);
4575 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4576 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4577 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4578 ret2->setArray(ret);
4583 if(!self->getArray())
4584 throw INTERP_KERNEL::Exception(msg2);
4585 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4586 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4587 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4588 ret2->setArray(ret);
4592 { throw INTERP_KERNEL::Exception(msg); }
4596 MEDCouplingFieldDouble *__rdiv__(PyObject *obj)
4598 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4601 MEDCouplingFieldDouble *__pow__(PyObject *obj)
4603 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.";
4604 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4607 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4609 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4611 return (*self)^(*other);
4613 throw INTERP_KERNEL::Exception(msg);
4618 DataArrayDoubleTuple *aa;
4619 std::vector<double> bb;
4621 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4626 if(!self->getArray())
4627 throw INTERP_KERNEL::Exception(msg2);
4628 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4630 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4631 ret2->setArray(ret);
4636 if(!self->getArray())
4637 throw INTERP_KERNEL::Exception(msg2);
4638 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4639 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4640 ret2->setArray(ret);
4645 if(!self->getArray())
4646 throw INTERP_KERNEL::Exception(msg2);
4647 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4648 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4649 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4650 ret2->setArray(ret);
4655 if(!self->getArray())
4656 throw INTERP_KERNEL::Exception(msg2);
4657 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4658 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4659 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4660 ret2->setArray(ret);
4664 { throw INTERP_KERNEL::Exception(msg); }
4668 MEDCouplingFieldDouble *__neg__() const
4670 return self->negate();
4673 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
4675 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.";
4676 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4679 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4681 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4685 Py_XINCREF(trueSelf);
4689 throw INTERP_KERNEL::Exception(msg);
4694 DataArrayDoubleTuple *aa;
4695 std::vector<double> bb;
4697 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4702 if(!self->getArray())
4703 throw INTERP_KERNEL::Exception(msg2);
4704 self->getArray()->applyLin(1.,val);
4705 Py_XINCREF(trueSelf);
4710 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4713 Py_XINCREF(trueSelf);
4718 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4719 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4720 ret2->setArray(aaa);
4722 Py_XINCREF(trueSelf);
4727 if(!self->getArray())
4728 throw INTERP_KERNEL::Exception(msg2);
4729 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4730 self->getArray()->addEqual(aaa);
4731 Py_XINCREF(trueSelf);
4735 { throw INTERP_KERNEL::Exception(msg); }
4739 PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
4741 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.";
4742 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4745 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4747 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4751 Py_XINCREF(trueSelf);
4755 throw INTERP_KERNEL::Exception(msg);
4760 DataArrayDoubleTuple *aa;
4761 std::vector<double> bb;
4763 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4768 if(!self->getArray())
4769 throw INTERP_KERNEL::Exception(msg2);
4770 self->getArray()->applyLin(1.,-val);
4771 Py_XINCREF(trueSelf);
4776 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4779 Py_XINCREF(trueSelf);
4784 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4785 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4786 ret2->setArray(aaa);
4788 Py_XINCREF(trueSelf);
4793 if(!self->getArray())
4794 throw INTERP_KERNEL::Exception(msg2);
4795 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4796 self->getArray()->substractEqual(aaa);
4797 Py_XINCREF(trueSelf);
4801 { throw INTERP_KERNEL::Exception(msg); }
4805 PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
4807 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.";
4808 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4811 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4813 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4817 Py_XINCREF(trueSelf);
4821 throw INTERP_KERNEL::Exception(msg);
4826 DataArrayDoubleTuple *aa;
4827 std::vector<double> bb;
4829 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4834 if(!self->getArray())
4835 throw INTERP_KERNEL::Exception(msg2);
4836 self->getArray()->applyLin(val,0);
4837 Py_XINCREF(trueSelf);
4842 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4845 Py_XINCREF(trueSelf);
4850 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4851 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4852 ret2->setArray(aaa);
4854 Py_XINCREF(trueSelf);
4859 if(!self->getArray())
4860 throw INTERP_KERNEL::Exception(msg2);
4861 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4862 self->getArray()->multiplyEqual(aaa);
4863 Py_XINCREF(trueSelf);
4867 { throw INTERP_KERNEL::Exception(msg); }
4871 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
4873 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.";
4874 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4877 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4879 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4883 Py_XINCREF(trueSelf);
4887 throw INTERP_KERNEL::Exception(msg);
4892 DataArrayDoubleTuple *aa;
4893 std::vector<double> bb;
4895 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4901 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4902 if(!self->getArray())
4903 throw INTERP_KERNEL::Exception(msg2);
4904 self->getArray()->applyLin(1./val,0);
4905 Py_XINCREF(trueSelf);
4910 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4913 Py_XINCREF(trueSelf);
4918 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4919 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4920 ret2->setArray(aaa);
4922 Py_XINCREF(trueSelf);
4927 if(!self->getArray())
4928 throw INTERP_KERNEL::Exception(msg2);
4929 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4930 self->getArray()->divideEqual(aaa);
4931 Py_XINCREF(trueSelf);
4935 { throw INTERP_KERNEL::Exception(msg); }
4939 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj)
4941 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.";
4942 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4945 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4947 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4951 Py_XINCREF(trueSelf);
4955 throw INTERP_KERNEL::Exception(msg);
4960 DataArrayDoubleTuple *aa;
4961 std::vector<double> bb;
4963 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4968 if(!self->getArray())
4969 throw INTERP_KERNEL::Exception(msg2);
4970 self->getArray()->applyPow(val);
4971 Py_XINCREF(trueSelf);
4976 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4979 Py_XINCREF(trueSelf);
4984 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4985 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4986 ret2->setArray(aaa);
4988 Py_XINCREF(trueSelf);
4993 if(!self->getArray())
4994 throw INTERP_KERNEL::Exception(msg2);
4995 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4996 self->getArray()->powEqual(aaa);
4997 Py_XINCREF(trueSelf);
5001 { throw INTERP_KERNEL::Exception(msg); }
5005 static MEDCouplingFieldDouble *MergeFields(PyObject *li)
5007 std::vector<const MEDCouplingFieldDouble *> tmp;
5008 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5009 return MEDCouplingFieldDouble::MergeFields(tmp);
5012 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true)
5014 std::vector<const MEDCouplingFieldDouble *> tmp;
5015 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5016 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
5019 PyObject *getTinySerializationInformation() const
5021 return field_getTinySerializationInformation<MEDCouplingFieldDouble>(self);
5024 PyObject *serialize() const
5026 return field_serialize<double>(self);
5029 PyObject *__getstate__() const
5031 return field__getstate__<MEDCouplingFieldDouble>(self,MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldDouble_serialize);
5034 void __setstate__(PyObject *inp)
5036 field__setstate__<double>(self,inp);
5041 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5044 int getNumberOfFields() const;
5045 MEDCouplingMultiFields *deepCopy() const;
5046 virtual std::string simpleRepr() const;
5047 virtual std::string advancedRepr() const;
5048 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5049 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5050 virtual void checkConsistencyLight() const;
5053 std::string __str__() const
5055 return self->simpleRepr();
5057 static MEDCouplingMultiFields *New(PyObject *li)
5059 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5060 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5061 std::size_t sz=tmp.size();
5062 std::vector<MEDCouplingFieldDouble *> fs(sz);
5063 for(std::size_t i=0;i<sz;i++)
5064 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5065 return MEDCouplingMultiFields::New(fs);
5067 MEDCouplingMultiFields(PyObject *li)
5069 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5070 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5071 std::size_t sz=tmp.size();
5072 std::vector<MEDCouplingFieldDouble *> fs(sz);
5073 for(std::size_t i=0;i<sz;i++)
5074 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5075 return MEDCouplingMultiFields::New(fs);
5077 PyObject *getFields() const
5079 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5080 std::size_t sz=fields.size();
5081 PyObject *res = PyList_New(sz);
5082 for(std::size_t i=0;i<sz;i++)
5086 fields[i]->incrRef();
5087 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5091 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5096 PyObject *getFieldAtPos(int id) const
5098 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5102 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5105 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5107 PyObject *getMeshes() const
5109 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5110 std::size_t sz=ms.size();
5111 PyObject *res = PyList_New(sz);
5112 for(std::size_t i=0;i<sz;i++)
5117 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5121 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5126 PyObject *getDifferentMeshes() const
5128 std::vector<int> refs;
5129 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5130 std::size_t sz=ms.size();
5131 PyObject *res = PyList_New(sz);
5132 for(std::size_t i=0;i<sz;i++)
5137 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5141 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5145 PyObject *ret=PyTuple_New(2);
5146 PyTuple_SetItem(ret,0,res);
5147 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5150 PyObject *getArrays() const
5152 std::vector<DataArrayDouble *> ms=self->getArrays();
5153 std::size_t sz=ms.size();
5154 PyObject *res = PyList_New(sz);
5155 for(std::size_t i=0;i<sz;i++)
5160 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5164 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5169 PyObject *getDifferentArrays() const
5171 std::vector< std::vector<int> > refs;
5172 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5173 std::size_t sz=ms.size();
5174 PyObject *res = PyList_New(sz);
5175 PyObject *res2 = PyList_New(sz);
5176 for(std::size_t i=0;i<sz;i++)
5181 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5185 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5187 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5190 PyObject *ret=PyTuple_New(2);
5191 PyTuple_SetItem(ret,0,res);
5192 PyTuple_SetItem(ret,1,res2);
5198 class MEDCouplingFieldInt32 : public MEDCouplingFieldT<int>
5201 static MEDCouplingFieldInt32 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5202 static MEDCouplingFieldInt32 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5203 bool isEqual(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const;
5204 bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const;
5205 void setTimeUnit(const std::string& unit);
5206 std::string getTimeUnit() const;
5207 void setTime(double val, int iteration, int order);
5208 void setArray(DataArrayInt32 *array);
5209 MEDCouplingFieldInt32 *deepCopy() const;
5210 MEDCouplingFieldInt32 *clone(bool recDeepCpy) const;
5211 MEDCouplingFieldInt32 *cloneWithMesh(bool recDeepCpy) const;
5212 MEDCouplingFieldDouble *convertToDblField() const;
5213 MEDCouplingFieldInt32 *buildSubPartRange(int begin, int end, int step) const;
5215 MEDCouplingFieldInt32(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5217 return MEDCouplingFieldInt32::New(type,td);
5220 MEDCouplingFieldInt32(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5222 return MEDCouplingFieldInt32::New(ft,td);
5225 PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const
5228 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5229 PyObject *ret=PyTuple_New(2);
5230 PyObject *ret0Py=ret0?Py_True:Py_False;
5232 PyTuple_SetItem(ret,0,ret0Py);
5233 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5237 std::string __str__() const
5239 return self->simpleRepr();
5242 std::string __repr__() const
5244 std::ostringstream oss;
5245 self->reprQuickOverview(oss);
5249 MEDCouplingFieldInt32 *buildSubPart(PyObject *li) const
5251 return fieldT_buildSubPart(self,li);
5254 MEDCouplingFieldInt32 *__getitem__(PyObject *li) const
5256 return fieldT__getitem__(self,li);
5259 DataArrayInt32 *getArray()
5261 DataArrayInt32 *ret=self->getArray();
5270 double tmp0=self->getTime(tmp1,tmp2);
5271 PyObject *res = PyList_New(3);
5272 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5273 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5274 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5278 PyObject *getTinySerializationInformation() const
5280 return field_getTinySerializationInformation<MEDCouplingFieldInt32>(self);
5283 PyObject *serialize() const
5285 return field_serialize<int>(self);
5288 PyObject *__getstate__() const
5290 return field__getstate__<MEDCouplingFieldInt32>(self,MEDCoupling_MEDCouplingFieldInt32_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt32_serialize);
5293 void __setstate__(PyObject *inp)
5295 field__setstate__<int>(self,inp);
5300 class MEDCouplingFieldInt64 : public MEDCouplingFieldT<int>
5303 static MEDCouplingFieldInt64 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5304 static MEDCouplingFieldInt64 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5305 bool isEqual(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
5306 bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
5307 void setTimeUnit(const std::string& unit);
5308 std::string getTimeUnit() const;
5309 void setTime(double val, int iteration, int order);
5310 void setArray(DataArrayInt64 *array);
5311 MEDCouplingFieldInt64 *deepCopy() const;
5312 MEDCouplingFieldInt64 *clone(bool recDeepCpy) const;
5313 MEDCouplingFieldInt64 *cloneWithMesh(bool recDeepCpy) const;
5314 MEDCouplingFieldDouble *convertToDblField() const;
5315 MEDCouplingFieldInt64 *buildSubPartRange(int begin, int end, int step) const;
5317 MEDCouplingFieldInt64(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5319 return MEDCouplingFieldInt64::New(type,td);
5322 MEDCouplingFieldInt64(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5324 return MEDCouplingFieldInt64::New(ft,td);
5327 PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const
5330 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5331 PyObject *ret=PyTuple_New(2);
5332 PyObject *ret0Py=ret0?Py_True:Py_False;
5334 PyTuple_SetItem(ret,0,ret0Py);
5335 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5339 std::string __str__() const
5341 return self->simpleRepr();
5344 std::string __repr__() const
5346 std::ostringstream oss;
5347 self->reprQuickOverview(oss);
5351 MEDCouplingFieldInt64 *buildSubPart(PyObject *li) const
5353 return fieldT_buildSubPart(self,li);
5356 MEDCouplingFieldInt64 *__getitem__(PyObject *li) const
5358 return fieldT__getitem__(self,li);
5361 DataArrayInt64 *getArray()
5363 DataArrayInt64 *ret=self->getArray();
5372 double tmp0=self->getTime(tmp1,tmp2);
5373 PyObject *res = PyList_New(3);
5374 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5375 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5376 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5380 PyObject *getTinySerializationInformation() const
5382 return field_getTinySerializationInformation<MEDCouplingFieldInt64>(self);
5385 PyObject *serialize() const
5387 return field_serialize<Int64>(self);
5390 PyObject *__getstate__() const
5392 return field__getstate__<MEDCouplingFieldInt64>(self,MEDCoupling_MEDCouplingFieldInt64_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt64_serialize);
5395 void __setstate__(PyObject *inp)
5397 field__setstate__<Int64>(self,inp);
5402 class MEDCouplingFieldFloat : public MEDCouplingFieldT<float>
5405 static MEDCouplingFieldFloat *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5406 static MEDCouplingFieldFloat *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5407 bool isEqual(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
5408 bool isEqualWithoutConsideringStr(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
5409 void setTimeUnit(const std::string& unit);
5410 std::string getTimeUnit() const;
5411 void setTime(double val, int iteration, int order);
5412 void setArray(DataArrayFloat *array);
5413 MEDCouplingFieldFloat *deepCopy() const;
5414 MEDCouplingFieldFloat *clone(bool recDeepCpy) const;
5415 MEDCouplingFieldFloat *cloneWithMesh(bool recDeepCpy) const;
5416 MEDCouplingFieldDouble *convertToDblField() const;
5417 MEDCouplingFieldFloat *buildSubPartRange(int begin, int end, int step) const;
5419 MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5421 return MEDCouplingFieldFloat::New(type,td);
5424 MEDCouplingFieldFloat(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5426 return MEDCouplingFieldFloat::New(ft,td);
5429 PyObject *isEqualIfNotWhy(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const
5432 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5433 PyObject *ret=PyTuple_New(2);
5434 PyObject *ret0Py=ret0?Py_True:Py_False;
5436 PyTuple_SetItem(ret,0,ret0Py);
5437 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5441 std::string __str__() const
5443 return self->simpleRepr();
5446 std::string __repr__() const
5448 std::ostringstream oss;
5449 self->reprQuickOverview(oss);
5453 MEDCouplingFieldFloat *buildSubPart(PyObject *li) const
5455 return fieldT_buildSubPart(self,li);
5458 MEDCouplingFieldFloat *__getitem__(PyObject *li) const
5460 return fieldT__getitem__(self,li);
5463 DataArrayFloat *getArray()
5465 DataArrayFloat *ret=self->getArray();
5474 double tmp0=self->getTime(tmp1,tmp2);
5475 PyObject *res = PyList_New(3);
5476 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5477 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5478 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5482 PyObject *getTinySerializationInformation() const
5484 return field_getTinySerializationInformation<MEDCouplingFieldFloat>(self);
5487 PyObject *serialize() const
5489 return field_serialize<float>(self);
5492 PyObject *__getstate__() const
5494 return field__getstate__<MEDCouplingFieldFloat>(self,MEDCoupling_MEDCouplingFieldFloat_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldFloat_serialize);
5497 void __setstate__(PyObject *inp)
5499 field__setstate__<float>(self,inp);
5504 class MEDCouplingDefinitionTime
5507 MEDCouplingDefinitionTime();
5508 void assign(const MEDCouplingDefinitionTime& other);
5509 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5510 double getTimeResolution() const;
5511 std::vector<double> getHotSpotsTime() const;
5514 std::string __str__() const
5516 std::ostringstream oss;
5517 self->appendRepr(oss);
5521 PyObject *getIdsOnTimeRight(double tm) const
5523 int meshId,arrId,arrIdInField,fieldId;
5524 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5525 PyObject *res=PyList_New(4);
5526 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5527 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5528 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5529 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5533 PyObject *getIdsOnTimeLeft(double tm) const
5535 int meshId,arrId,arrIdInField,fieldId;
5536 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5537 PyObject *res=PyList_New(4);
5538 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5539 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5540 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5541 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5547 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5550 double getTimeTolerance() const;
5551 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5555 MEDCouplingFieldOverTime(PyObject *li)
5557 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5558 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5559 std::size_t sz=tmp.size();
5560 std::vector<MEDCouplingFieldDouble *> fs(sz);
5561 for(std::size_t i=0;i<sz;i++)
5562 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5563 return MEDCouplingFieldOverTime::New(fs);
5565 std::string __str__() const
5567 return self->simpleRepr();
5569 static MEDCouplingFieldOverTime *New(PyObject *li)
5571 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5572 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5573 std::size_t sz=tmp.size();
5574 std::vector<MEDCouplingFieldDouble *> fs(sz);
5575 for(std::size_t i=0;i<sz;i++)
5576 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5577 return MEDCouplingFieldOverTime::New(fs);
5582 class MEDCouplingCartesianAMRMesh;
5584 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5587 int getNumberOfCellsRecursiveWithOverlap() const;
5588 int getNumberOfCellsRecursiveWithoutOverlap() const;
5589 int getMaxNumberOfLevelsRelativeToThis() const;
5592 MEDCouplingCartesianAMRMeshGen *getMesh() const
5594 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5602 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5605 int getNumberOfOverlapedCellsForFather() const;
5606 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const;
5607 std::vector<mcIdType> computeCellGridSt() const;
5610 PyObject *getBLTRRange() const
5612 const std::vector< std::pair<mcIdType,mcIdType> >& ret(self->getBLTRRange());
5613 return convertFromVectorPairInt(ret);
5616 PyObject *getBLTRRangeRelativeToGF() const
5618 std::vector< std::pair<mcIdType,mcIdType> > ret(self->getBLTRRangeRelativeToGF());
5619 return convertFromVectorPairInt(ret);
5622 void addPatch(PyObject *bottomLeftTopRight, const std::vector<mcIdType>& factors)
5624 std::vector< std::pair<mcIdType,mcIdType> > inp;
5625 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5626 self->addPatch(inp,factors);
5629 MEDCouplingCartesianAMRPatch *__getitem__(mcIdType patchId) const
5631 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5633 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5634 if(patchId==mesh->getNumberOfPatches())
5636 std::ostringstream oss;
5637 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5638 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5641 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5647 void __delitem__(mcIdType patchId)
5649 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5651 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5652 mesh->removePatch(patchId);
5655 mcIdType __len__() const
5657 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5659 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5660 return mesh->getNumberOfPatches();
5665 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5669 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5672 mcIdType getAbsoluteLevel() const;
5673 mcIdType getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
5674 std::vector<mcIdType> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
5675 int getSpaceDimension() const;
5676 const std::vector<mcIdType>& getFactors() const;
5677 void setFactors(const std::vector<mcIdType>& newFactors);
5678 mcIdType getMaxNumberOfLevelsRelativeToThis() const;
5679 mcIdType getNumberOfCellsAtCurrentLevel() const;
5680 mcIdType getNumberOfCellsAtCurrentLevelGhost(mcIdType ghostLev) const;
5681 mcIdType getNumberOfCellsRecursiveWithOverlap() const;
5682 mcIdType getNumberOfCellsRecursiveWithoutOverlap() const;
5683 bool isPatchInNeighborhoodOf(mcIdType patchId1, mcIdType patchId2, mcIdType ghostLev) const;
5684 virtual void detachFromFather();
5686 mcIdType getNumberOfPatches() const;
5687 mcIdType getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const;
5688 MEDCouplingUMesh *buildUnstructured() const;
5689 DataArrayDouble *extractGhostFrom(mcIdType ghostSz, const DataArrayDouble *arr) const;
5690 std::vector<mcIdType> getPatchIdsInTheNeighborhoodOf(mcIdType patchId, mcIdType ghostLev) const;
5691 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const;
5692 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const;
5693 void removeAllPatches();
5694 void removePatch(mcIdType patchId);
5695 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<mcIdType>& factors);
5696 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<mcIdType>& factors, double eps);
5697 DataArrayDouble *createCellFieldOnPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnThis) const;
5698 void fillCellFieldOnPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const;
5699 void fillCellFieldOnPatchGhost(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev, bool isConservative=true) const;
5700 void fillCellFieldOnPatchOnlyOnGhostZone(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev) const;
5701 void fillCellFieldOnPatchOnlyOnGhostZoneWith(mcIdType ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5702 void fillCellFieldComingFromPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const;
5703 void fillCellFieldComingFromPatchGhost(mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, bool isConservative=true) const;
5704 DataArrayIdType *findPatchesInTheNeighborhoodOf(mcIdType patchId, mcIdType ghostLev) const;
5705 std::string buildPythonDumpOfThis() const;
5708 void addPatch(PyObject *bottomLeftTopRight, const std::vector<mcIdType>& factors)
5710 std::vector< std::pair<mcIdType,mcIdType> > inp;
5711 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5712 self->addPatch(inp,factors);
5715 PyObject *getPatches() const
5717 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5718 std::size_t sz(ps.size());
5719 PyObject *ret = PyList_New(sz);
5720 for(std::size_t i=0;i<sz;i++)
5722 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5725 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5730 // agy : don't know why typemap fails here ??? let it in the extend section
5731 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const
5733 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5736 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<mcIdType>& pos) const
5738 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5739 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5745 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<mcIdType>& pos) const
5747 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5748 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5754 virtual PyObject *positionRelativeToGodFather() const
5756 std::vector<mcIdType> out1;
5757 std::vector< std::pair<mcIdType,mcIdType> > out0(self->positionRelativeToGodFather(out1));
5758 PyObject *ret(PyTuple_New(2));
5759 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5760 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5764 virtual PyObject *retrieveGridsAt(mcIdType absoluteLev) const
5766 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5767 std::size_t sz(ps.size());
5768 PyObject *ret = PyList_New(sz);
5769 for(std::size_t i=0;i<sz;i++)
5770 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5774 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(mcIdType ghostSz, PyObject *recurseArrs) const
5776 std::vector<const DataArrayDouble *> inp;
5777 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5778 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5781 virtual MEDCouplingCartesianAMRMeshGen *getFather() const
5783 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5789 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const
5791 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5797 MEDCouplingCartesianAMRPatch *getPatch(mcIdType patchId) const
5799 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5805 MEDCouplingIMesh *getImageMesh() const
5807 const MEDCouplingIMesh *ret(self->getImageMesh());
5810 return const_cast<MEDCouplingIMesh *>(ret);
5813 MEDCouplingCartesianAMRPatch *__getitem__(mcIdType patchId) const
5815 if(patchId==self->getNumberOfPatches())
5817 std::ostringstream oss;
5818 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5819 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5822 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5828 void fillCellFieldOnPatchGhostAdv(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const
5830 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5831 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5832 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5835 void fillCellFieldOnPatchOnlyGhostAdv(mcIdType patchId, mcIdType ghostLev, PyObject *arrsOnPatches) const
5837 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5838 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5839 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5842 void __delitem__(mcIdType patchId)
5844 self->removePatch(patchId);
5847 mcIdType __len__() const
5849 return self->getNumberOfPatches();
5854 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5858 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5861 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh);
5864 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
5866 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5867 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5868 const mcIdType *nodeStrctPtr(0);
5869 const double *originPtr(0),*dxyzPtr(0);
5870 mcIdType sw,sz,val0;
5871 std::vector<mcIdType> bb0;
5872 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
5875 std::vector<double> bb,bb2;
5877 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5878 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5880 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5883 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps)
5885 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5886 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5887 std::vector< std::vector<mcIdType> > inp2;
5888 convertPyToVectorOfVectorOfInt(factors,inp2);
5889 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5892 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
5894 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5897 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh)
5899 return MEDCouplingCartesianAMRMesh::New(mesh);
5904 class MEDCouplingDataForGodFather : public RefCountObject
5907 virtual void synchronizeFineToCoarse();
5908 virtual void synchronizeFineToCoarseBetween(mcIdType fromLev, mcIdType toLev);
5909 virtual void synchronizeCoarseToFine();
5910 virtual void synchronizeCoarseToFineBetween(mcIdType fromLev, mcIdType toLev);
5911 virtual void synchronizeAllGhostZones();
5912 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh);
5913 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(mcIdType level);
5914 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(mcIdType level);
5915 virtual void alloc();
5916 virtual void dealloc();
5919 MEDCouplingCartesianAMRMesh *getMyGodFather()
5921 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5929 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5932 mcIdType getNumberOfLevels() const;
5933 MEDCouplingAMRAttribute *deepCopy() const;
5934 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const;
5935 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5936 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5937 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5938 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf);
5939 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const;
5940 std::string writeVTHB(const std::string& fileName) const;
5943 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, mcIdType ghostLev)
5945 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5946 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5947 MEDCouplingAMRAttribute *ret(0);
5950 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5951 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5953 catch(INTERP_KERNEL::Exception&)
5955 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5956 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5961 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, mcIdType ghostLev)
5963 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5966 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const
5968 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5969 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5975 void spillInfoOnComponents(PyObject *compNames)
5977 std::vector< std::vector<std::string> > compNamesCpp;
5978 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5979 self->spillInfoOnComponents(compNamesCpp);
5982 void spillNatures(PyObject *nfs)
5984 std::vector<mcIdType> inp0;
5985 if(!fillIntVector(nfs,inp0))
5986 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5987 std::size_t sz(inp0.size());
5988 std::vector<NatureOfField> inp00(sz);
5989 for(std::size_t i=0;i<sz;i++)
5990 inp00[i]=(NatureOfField)inp0[i];
5991 self->spillNatures(inp00);
5994 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const
5996 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5997 std::size_t sz(ret.size());
5998 PyObject *retPy(PyList_New(sz));
5999 for(std::size_t i=0;i<sz;i++)
6000 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
6006 class DenseMatrix : public RefCountObject, public TimeLabel
6009 static DenseMatrix *New(mcIdType nbRows, mcIdType nbCols);
6010 static DenseMatrix *New(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols);
6011 DenseMatrix *deepCopy() const;
6012 DenseMatrix *shallowCpy() const;
6014 mcIdType getNumberOfRows() const;
6015 mcIdType getNumberOfCols() const;
6016 mcIdType getNbOfElems() const;
6017 void reBuild(DataArrayDouble *array, mcIdType nbRows=-1, mcIdType nbCols=-1);
6018 void reShape(mcIdType nbRows, mcIdType nbCols);
6021 bool isEqual(const DenseMatrix& other, double eps) const;
6022 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const;
6023 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec);
6026 DenseMatrix(mcIdType nbRows, mcIdType nbCols)
6028 return DenseMatrix::New(nbRows,nbCols);
6031 DenseMatrix(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols)
6033 return DenseMatrix::New(array,nbRows,nbCols);
6036 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const
6039 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
6040 PyObject *ret=PyTuple_New(2);
6041 PyObject *ret0Py=ret0?Py_True:Py_False;
6043 PyTuple_SetItem(ret,0,ret0Py);
6044 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
6048 DataArrayDouble *getData()
6050 DataArrayDouble *ret(self->getData());
6056 DenseMatrix *__add__(const DenseMatrix *other)
6058 return MEDCoupling::DenseMatrix::Add(self,other);
6061 DenseMatrix *__sub__(const DenseMatrix *other)
6063 return MEDCoupling::DenseMatrix::Substract(self,other);
6066 DenseMatrix *__mul__(const DenseMatrix *other)
6068 return MEDCoupling::DenseMatrix::Multiply(self,other);
6071 DenseMatrix *__mul__(const DataArrayDouble *other)
6073 return MEDCoupling::DenseMatrix::Multiply(self,other);
6076 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other)
6078 self->addEqual(other);
6079 Py_XINCREF(trueSelf);
6083 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other)
6085 self->substractEqual(other);
6086 Py_XINCREF(trueSelf);
6090 PyObject *toNumPyMatrix() // not const. It is not a bug !
6092 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
6101 def MEDCouplingUMeshReduce(self):
6102 return MEDCouplingStdReduceFunct,(MEDCouplingUMesh,((),(self.__getstate__()),))
6103 def MEDCouplingCMeshReduce(self):
6104 return MEDCouplingStdReduceFunct,(MEDCouplingCMesh,((),(self.__getstate__()),))
6105 def MEDCouplingIMeshReduce(self):
6106 return MEDCouplingStdReduceFunct,(MEDCouplingIMesh,((),(self.__getstate__()),))
6107 def MEDCouplingMappedExtrudedMeshReduce(self):
6108 return MEDCouplingStdReduceFunct,(MEDCouplingMappedExtrudedMesh,((),(self.__getstate__()),))
6109 def MEDCouplingCurveLinearMeshReduce(self):
6110 return MEDCouplingStdReduceFunct,(MEDCouplingCurveLinearMesh,((),(self.__getstate__()),))
6111 def MEDCoupling1SGTUMeshReduce(self):
6112 return MEDCouplingStdReduceFunct,(MEDCoupling1SGTUMesh,((),(self.__getstate__()),))
6113 def MEDCoupling1DGTUMeshReduce(self):
6114 return MEDCouplingStdReduceFunct,(MEDCoupling1DGTUMesh,((),(self.__getstate__()),))
6115 def MEDCouplingFieldDoubleReduce(self):
6116 self.checkConsistencyLight()
6117 d=(self.getTypeOfField(),self.getTimeDiscretization())
6118 return MEDCouplingStdReduceFunct,(MEDCouplingFieldDouble,(d,(self.__getstate__()),))
6119 def MEDCouplingFieldInt32Reduce(self):
6120 self.checkConsistencyLight()
6121 d=(self.getTypeOfField(),self.getTimeDiscretization())
6122 return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt32,(d,(self.__getstate__()),))
6123 def MEDCouplingFieldInt64Reduce(self):
6124 self.checkConsistencyLight()
6125 d=(self.getTypeOfField(),self.getTimeDiscretization())
6126 return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt64,(d,(self.__getstate__()),))
6127 def MEDCouplingFieldFloatReduce(self):
6128 self.checkConsistencyLight()
6129 d=(self.getTypeOfField(),self.getTimeDiscretization())
6130 return MEDCouplingStdReduceFunct,(MEDCouplingFieldFloat,(d,(self.__getstate__()),))
6131 def MEDCouplingFTReduceFunct(cls,params):
6133 ret=object.__new__(cls)
6137 def MEDCouplingFieldTemplateReduce(self):
6138 ret = MEDCouplingFieldDouble(self)
6139 nbTuples = self.getNumberOfTuplesExpected()
6140 arr = DataArrayDouble(nbTuples) ; arr[:] = 0.
6142 return MEDCouplingFTReduceFunct,(MEDCouplingFieldTemplate,((ret,),()))
6144 # Forwarding DataArrayInt functions to MEDCouplingUMesh:
6146 MEDCouplingUMesh.ExtractFromIndexedArrays = DataArrayInt.ExtractFromIndexedArrays
6147 MEDCouplingUMesh.ExtractFromIndexedArraysSlice = DataArrayInt.ExtractFromIndexedArraysSlice
6148 MEDCouplingUMesh.SetPartOfIndexedArrays = DataArrayInt.SetPartOfIndexedArrays
6149 MEDCouplingUMesh.SetPartOfIndexedArraysSameIdx = DataArrayInt.SetPartOfIndexedArraysSameIdx
6150 MEDCouplingUMesh.RemoveIdsFromIndexedArrays = DataArrayInt.RemoveIdsFromIndexedArrays
6151 MEDCouplingFieldInt = MEDCouplingFieldInt32
6153 if MEDCouplingUse64BitIDs():
6154 MEDCouplingFieldID = MEDCouplingFieldInt64
6156 MEDCouplingFieldID = MEDCouplingFieldInt32
6162 __filename=os.environ.get('PYTHONSTARTUP')
6163 if __filename and os.path.isfile(__filename):
6164 with open(__filename) as __fp: