1 // Copyright (C) 2017-2019 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 "MEDCouplingUMesh.hxx"
31 #include "MEDCouplingMappedExtrudedMesh.hxx"
32 #include "MEDCouplingCMesh.hxx"
33 #include "MEDCouplingIMesh.hxx"
34 #include "MEDCouplingMap.txx"
35 #include "MEDCouplingCurveLinearMesh.hxx"
36 #include "MEDCoupling1GTUMesh.hxx"
37 #include "MEDCouplingField.hxx"
38 #include "MEDCouplingFieldDouble.hxx"
39 #include "MEDCouplingFieldInt.hxx"
40 #include "MEDCouplingFieldFloat.hxx"
41 #include "MEDCouplingFieldTemplate.hxx"
42 #include "MEDCouplingGaussLocalization.hxx"
44 #include "MEDCouplingMultiFields.hxx"
45 #include "MEDCouplingFieldOverTime.hxx"
46 #include "MEDCouplingDefinitionTime.hxx"
47 #include "MEDCouplingFieldDiscretization.hxx"
48 #include "MEDCouplingCartesianAMRMesh.hxx"
49 #include "MEDCouplingAMRAttribute.hxx"
50 #include "MEDCouplingMatrix.hxx"
51 #include "MEDCouplingPartDefinition.hxx"
52 #include "MEDCouplingSkyLineArray.hxx"
53 #include "MEDCouplingTypemaps.i"
55 #include "InterpKernelAutoPtr.hxx"
56 #include "BoxSplittingOptions.hxx"
58 using namespace MEDCoupling;
59 using namespace INTERP_KERNEL;
63 %template(ivec) std::vector<int>;
64 %template(dvec) std::vector<double>;
65 %template(svec) std::vector<std::string>;
68 %typemap(out) MEDCoupling::MEDCouplingMesh*
70 $result=convertMesh($1,$owner);
73 %typemap(out) MEDCouplingMesh*
75 $result=convertMesh($1,$owner);
80 %typemap(out) MEDCoupling::MEDCouplingPointSet*
82 $result=convertMesh($1,$owner);
85 %typemap(out) MEDCouplingPointSet*
87 $result=convertMesh($1,$owner);
92 %typemap(out) MEDCouplingCartesianAMRPatchGen*
94 $result=convertCartesianAMRPatch($1,$owner);
99 %typemap(out) MEDCouplingCartesianAMRMeshGen*
101 $result=convertCartesianAMRMesh($1,$owner);
106 %typemap(out) MEDCouplingDataForGodFather*
108 $result=convertDataForGodFather($1,$owner);
113 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
115 $result=convertMesh($1,$owner);
118 %typemap(out) MEDCoupling1GTUMesh*
120 $result=convertMesh($1,$owner);
125 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
127 $result=convertMesh($1,$owner);
130 %typemap(out) MEDCouplingStructuredMesh*
132 $result=convertMesh($1,$owner);
137 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
139 $result=convertFieldDiscretization($1,$owner);
142 %typemap(out) MEDCouplingFieldDiscretization*
144 $result=convertFieldDiscretization($1,$owner);
149 %typemap(out) MEDCoupling::MEDCouplingField*
151 $result=convertField($1,$owner);
154 %typemap(out) MEDCouplingField*
156 $result=convertField($1,$owner);
161 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
163 $result=convertMultiFields($1,$owner);
166 %typemap(out) MEDCouplingMultiFields*
168 $result=convertMultiFields($1,$owner);
173 %typemap(out) MEDCoupling::PartDefinition*
175 $result=convertPartDefinition($1,$owner);
178 %typemap(out) PartDefinition*
180 $result=convertPartDefinition($1,$owner);
185 %init %{ import_array(); %}
188 %init %{ initializeMe(); %}
190 %feature("autodoc", "1");
191 %feature("docstring");
193 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
194 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
195 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
196 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
197 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
198 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
199 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
200 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
201 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
202 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToFloatField;
203 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
204 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
205 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
206 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
207 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
208 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
209 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
210 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
211 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
212 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
213 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
214 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
215 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
216 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
217 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
218 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
235 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
236 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
237 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
238 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
239 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
240 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
241 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
242 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
243 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
244 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
245 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
246 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
247 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
248 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
249 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
250 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
251 %newobject MEDCoupling::MEDCouplingFieldInt::New;
252 %newobject MEDCoupling::MEDCouplingFieldInt::convertToDblField;
253 %newobject MEDCoupling::MEDCouplingFieldInt::getArray;
254 %newobject MEDCoupling::MEDCouplingFieldInt::deepCopy;
255 %newobject MEDCoupling::MEDCouplingFieldInt::clone;
256 %newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh;
257 %newobject MEDCoupling::MEDCouplingFieldInt::buildSubPart;
258 %newobject MEDCoupling::MEDCouplingFieldInt::buildSubPartRange;
259 %newobject MEDCoupling::MEDCouplingFieldInt::__getitem__;
260 %newobject MEDCoupling::MEDCouplingFieldFloat::New;
261 %newobject MEDCoupling::MEDCouplingFieldFloat::convertToDblField;
262 %newobject MEDCoupling::MEDCouplingFieldFloat::getArray;
263 %newobject MEDCoupling::MEDCouplingFieldFloat::deepCopy;
264 %newobject MEDCoupling::MEDCouplingFieldFloat::clone;
265 %newobject MEDCoupling::MEDCouplingFieldFloat::cloneWithMesh;
266 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPart;
267 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPartRange;
268 %newobject MEDCoupling::MEDCouplingFieldFloat::__getitem__;
269 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
270 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
271 %newobject MEDCoupling::MEDCouplingMesh::clone;
272 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
273 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
274 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
275 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
276 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
277 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
278 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
279 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
280 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
281 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
282 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
283 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
284 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
285 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
286 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
287 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
288 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
289 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
290 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
291 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
292 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
293 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
294 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
295 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
296 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
297 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
298 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
299 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
300 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
301 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
302 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
303 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
304 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
305 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
306 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
307 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
308 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
309 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
310 %newobject MEDCoupling::MEDCouplingUMesh::New;
311 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
312 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
313 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
314 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
315 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
316 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
317 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
318 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
319 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
320 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
321 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
322 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
323 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
324 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
325 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
326 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
327 %newobject MEDCoupling::MEDCouplingUMesh::conformize3D;
328 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
329 %newobject MEDCoupling::MEDCouplingUMesh::colinearizeKeepingConform2D;
330 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
331 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
332 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
333 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
334 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
335 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
336 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
337 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
338 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
339 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
340 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
341 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
342 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
343 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
344 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
345 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
346 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
347 %newobject MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords;
348 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
349 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
350 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
351 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
352 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
353 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
354 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
355 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
356 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
357 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
358 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
359 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
360 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
361 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
362 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
363 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
364 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
365 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
366 %newobject MEDCoupling::MEDCouplingUMesh::convertDegeneratedCellsAndRemoveFlatOnes;
367 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
368 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
369 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
370 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
371 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
372 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
373 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
374 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
375 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
376 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
377 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
378 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
379 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
380 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
381 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
382 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
383 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
384 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
385 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
386 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
387 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
388 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
389 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
390 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
391 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
392 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
393 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
394 %newobject MEDCoupling::MEDCouplingCMesh::New;
395 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
396 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
397 %newobject MEDCoupling::MEDCouplingIMesh::New;
398 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
399 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
400 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
401 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
402 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
403 %newobject MEDCoupling::MEDCouplingMultiFields::New;
404 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
405 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
406 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
407 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
408 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
409 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
410 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
411 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
412 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
413 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
414 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
415 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
416 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
417 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
418 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
419 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
420 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
421 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
422 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
423 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
424 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
425 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
426 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
427 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
428 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
429 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
430 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
431 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
432 %newobject MEDCoupling::DenseMatrix::New;
433 %newobject MEDCoupling::DenseMatrix::deepCopy;
434 %newobject MEDCoupling::DenseMatrix::shallowCpy;
435 %newobject MEDCoupling::DenseMatrix::getData;
436 %newobject MEDCoupling::DenseMatrix::matVecMult;
437 %newobject MEDCoupling::DenseMatrix::MatVecMult;
438 %newobject MEDCoupling::DenseMatrix::__add__;
439 %newobject MEDCoupling::DenseMatrix::__sub__;
440 %newobject MEDCoupling::DenseMatrix::__mul__;
441 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
442 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
443 %newobject MEDCoupling::MEDCouplingSkyLineArray::BuildFromPolyhedronConn;
444 %newobject MEDCoupling::MEDCouplingSkyLineArray::getSuperIndexArray;
445 %newobject MEDCoupling::MEDCouplingSkyLineArray::getIndexArray;
446 %newobject MEDCoupling::MEDCouplingSkyLineArray::getValuesArray;
448 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
449 %feature("unref") MEDCouplingMesh "$this->decrRef();"
450 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
451 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
452 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
453 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
454 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
455 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
456 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
457 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
458 %feature("unref") MEDCouplingField "$this->decrRef();"
459 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
460 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
461 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
462 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
463 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
464 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
465 %feature("unref") MEDCouplingFieldFloat "$this->decrRef();"
466 %feature("unref") MEDCouplingFieldInt "$this->decrRef();"
467 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
468 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
469 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
470 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
471 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
472 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
473 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
474 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
475 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
476 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
477 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
478 %feature("unref") DenseMatrix "$this->decrRef();"
479 %feature("unref") MEDCouplingSkyLineArray "$this->decrRef();"
481 %rename(assign) *::operator=;
482 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
483 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
484 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
485 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
489 // ABN: Instruct SWIG that INTERP_KERNEL::Exception is an exception class and that it should inherit Exception
490 // on the Python side. Must be put BEFORE the %rename clause:
491 %exceptionclass INTERP_KERNEL::Exception;
492 %rename (InterpKernelException) INTERP_KERNEL::Exception;
494 %include "MEDCouplingRefCountObject.i"
495 %include "MEDCouplingMemArray.i"
499 {// AGY : here initialization of C++ traits in MEDCouplingDataArrayTypemaps.i for code factorization. Awful, I know, but no other solutions.
500 SWIGTITraits<double>::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble;
501 SWIGTITraits<float>::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat;
502 SWIGTITraits<int>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt;
503 SWIGTITraits<double>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple;
504 SWIGTITraits<float>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayFloatTuple;
505 SWIGTITraits<int>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayIntTuple;
509 namespace INTERP_KERNEL
512 * \class BoxSplittingOptions
513 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
515 class BoxSplittingOptions
518 BoxSplittingOptions();
519 void init() throw(INTERP_KERNEL::Exception);
520 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
521 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
522 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
523 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
524 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
525 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
526 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
527 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
528 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
529 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
530 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
531 std::string printOptions() const throw(INTERP_KERNEL::Exception);
534 std::string __str__() const throw(INTERP_KERNEL::Exception)
536 return self->printOptions();
542 namespace MEDCoupling
558 CONST_ON_TIME_INTERVAL = 7
559 } TypeOfTimeDiscretization;
567 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
568 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
570 } MEDCouplingMeshType;
573 class DataArrayDouble;
574 class MEDCouplingUMesh;
575 class MEDCouplingCMesh;
576 class MEDCouplingFieldDouble;
578 %extend RefCountObject
580 std::string getHiddenCppPointer() const
582 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
587 %extend MEDCouplingGaussLocalization
589 std::string __str__() const throw(INTERP_KERNEL::Exception)
591 return self->getStringRepr();
594 std::string __repr__() const throw(INTERP_KERNEL::Exception)
596 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
597 oss << self->getStringRepr();
604 class MEDCouplingMesh : public RefCountObject, public TimeLabel
607 void setName(const std::string& name);
608 std::string getName() const;
609 void setDescription(const std::string& descr);
610 std::string getDescription() const;
611 void setTime(double val, int iteration, int order);
612 void setTimeUnit(const std::string& unit);
613 std::string getTimeUnit() const;
614 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
615 bool isStructured() const throw(INTERP_KERNEL::Exception);
616 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
617 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
618 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
619 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
620 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
621 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
622 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
623 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
624 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
625 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
626 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
627 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
628 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
629 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
630 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
631 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
632 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
633 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
634 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
635 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
636 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
637 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
638 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
639 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
640 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
641 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
642 virtual std::string getVTKFileExtension() const;
643 std::string getVTKFileNameOf(const std::string& fileName) const;
645 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
646 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
647 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
648 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
649 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
650 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
651 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
652 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
653 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
654 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
655 virtual void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings) throw(INTERP_KERNEL::Exception);
656 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
657 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
658 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
659 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
660 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
661 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
662 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
665 std::string __str__() const throw(INTERP_KERNEL::Exception)
667 return self->simpleRepr();
670 PyObject *getTime() throw(INTERP_KERNEL::Exception)
673 double tmp0=self->getTime(tmp1,tmp2);
674 PyObject *res = PyList_New(3);
675 PyList_SetItem(res,0,SWIG_From_double(tmp0));
676 PyList_SetItem(res,1,SWIG_From_int(tmp1));
677 PyList_SetItem(res,2,SWIG_From_int(tmp2));
681 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
683 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
684 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
690 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
694 DataArrayDoubleTuple *aa;
695 std::vector<double> bb;
697 int spaceDim=self->getSpaceDimension();
698 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
699 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
700 return self->getCellContainingPoint(pos,eps);
703 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
707 DataArrayDoubleTuple *aa;
708 std::vector<double> bb;
710 int spaceDim=self->getSpaceDimension();
711 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
712 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
713 MCAuto<DataArrayInt> elts,eltsIndex;
714 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
715 PyObject *ret=PyTuple_New(2);
716 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
717 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
721 PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
725 DataArrayDoubleTuple *aa;
726 std::vector<double> bb;
728 int spaceDim=self->getSpaceDimension();
729 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPointsLinearPartOnlyOnNonDynType : ";
730 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
731 MCAuto<DataArrayInt> elts,eltsIndex;
732 self->getCellsContainingPointsLinearPartOnlyOnNonDynType(pos,nbOfPoints,eps,elts,eltsIndex);
733 PyObject *ret=PyTuple_New(2);
734 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
735 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
739 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
741 auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayInt>& d, MCAuto<DataArrayInt>& e) { self->getCellsContainingPoints(a,b,c,d,e); };
742 return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
745 PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
747 auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayInt>& d, MCAuto<DataArrayInt>& e) { self->getCellsContainingPointsLinearPartOnlyOnNonDynType(a,b,c,d,e); };
748 return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
751 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
755 DataArrayDoubleTuple *aa;
756 std::vector<double> bb;
758 int spaceDim=self->getSpaceDimension();
759 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
760 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
761 std::vector<int> elts;
762 self->getCellsContainingPoint(pos,eps,elts);
763 DataArrayInt *ret=DataArrayInt::New();
764 ret->alloc((int)elts.size(),1);
765 std::copy(elts.begin(),elts.end(),ret->getPointer());
766 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
769 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
771 MCAuto<DataArrayInt> d0=DataArrayInt::New();
772 MCAuto<DataArrayInt> d1=DataArrayInt::New();
773 self->getReverseNodalConnectivity(d0,d1);
774 PyObject *ret=PyTuple_New(2);
775 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
776 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
780 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
783 int v0; std::vector<int> v1;
784 const int *ids(convertIntStarLikePyObjToCppIntStar(li,sw,sz,v0,v1));
785 self->renumberCells(ids,check);
788 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
790 DataArrayInt *cellCor, *nodeCor;
791 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
792 PyObject *res = PyList_New(2);
793 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
794 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
798 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
800 DataArrayInt *cellCor=0,*nodeCor=0;
801 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
802 PyObject *res = PyList_New(2);
803 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
804 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
808 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
810 DataArrayInt *cellCor=0;
811 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
815 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
818 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
819 if (!SWIG_IsOK(res1))
822 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
823 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
827 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
829 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
830 da2->checkAllocated();
831 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
834 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
836 std::vector<int> conn;
837 self->getNodeIdsOfCell(cellId,conn);
838 return convertIntArrToPyList2(conn);
841 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
843 std::vector<double> coo;
844 self->getCoordinatesOfNode(nodeId,coo);
845 return convertDblArrToPyList2(coo);
848 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
852 DataArrayDoubleTuple *aa;
853 std::vector<double> bb;
855 int spaceDim=self->getSpaceDimension();
856 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
857 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
858 self->scale(pointPtr,factor);
861 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
863 int spaceDim=self->getSpaceDimension();
864 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
865 self->getBoundingBox(tmp);
866 PyObject *ret=convertDblArrToPyListOfTuple<double>(tmp,2,spaceDim);
870 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
873 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
874 PyObject *ret=PyTuple_New(2);
875 PyObject *ret0Py=ret0?Py_True:Py_False;
877 PyTuple_SetItem(ret,0,ret0Py);
878 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
882 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
884 int szArr,sw,iTypppArr;
885 std::vector<int> stdvecTyyppArr;
886 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
887 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
888 if(sw==3)//DataArrayInt
890 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
891 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
892 std::string name=argpt->getName();
894 ret->setName(name.c_str());
896 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
899 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
901 int szArr,sw,iTypppArr;
902 std::vector<int> stdvecTyyppArr;
904 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
905 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
906 if(sw==3)//DataArrayInt
908 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
909 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
910 std::string name=argpt->getName();
912 ret->setName(name.c_str());
915 PyObject *res = PyList_New(2);
916 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
917 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
918 PyList_SetItem(res,0,obj0);
919 PyList_SetItem(res,1,obj1);
923 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
927 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
928 PyObject *res = PyTuple_New(2);
929 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
932 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
934 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
935 PyTuple_SetItem(res,0,obj0);
936 PyTuple_SetItem(res,1,obj1);
940 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
942 std::vector<int> vals=self->getDistributionOfTypes();
944 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
945 PyObject *ret=PyList_New((int)vals.size()/3);
946 for(int j=0;j<(int)vals.size()/3;j++)
948 PyObject *ret1=PyList_New(3);
949 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
950 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
951 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
952 PyList_SetItem(ret,j,ret1);
957 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
959 std::vector<int> code;
960 std::vector<const DataArrayInt *> idsPerType;
961 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
962 convertPyToNewIntArr4(li,1,3,code);
963 return self->checkTypeConsistencyAndContig(code,idsPerType);
966 PyObject *splitProfilePerType(const DataArrayInt *profile, bool smartPflKiller=true) const throw(INTERP_KERNEL::Exception)
968 std::vector<int> code;
969 std::vector<DataArrayInt *> idsInPflPerType;
970 std::vector<DataArrayInt *> idsPerType;
971 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType,smartPflKiller);
972 PyObject *ret=PyTuple_New(3);
975 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
976 PyObject *ret0=PyList_New((int)code.size()/3);
977 for(int j=0;j<(int)code.size()/3;j++)
979 PyObject *ret00=PyList_New(3);
980 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
981 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
982 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
983 PyList_SetItem(ret0,j,ret00);
985 PyTuple_SetItem(ret,0,ret0);
987 PyObject *ret1=PyList_New(idsInPflPerType.size());
988 for(std::size_t j=0;j<idsInPflPerType.size();j++)
989 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
990 PyTuple_SetItem(ret,1,ret1);
991 int n=idsPerType.size();
992 PyObject *ret2=PyList_New(n);
994 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
995 PyTuple_SetItem(ret,2,ret2);
999 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
1003 DataArrayDoubleTuple *aa;
1004 std::vector<double> bb;
1006 int spaceDim=self->getSpaceDimension();
1007 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1008 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1009 self->translate(vectorPtr);
1012 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
1014 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1017 DataArrayDoubleTuple *aa;
1018 std::vector<double> bb;
1020 int spaceDim=self->getSpaceDimension();
1021 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1022 self->rotate(centerPtr,0,alpha);
1025 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
1027 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1029 DataArrayDouble *a,*a2;
1030 DataArrayDoubleTuple *aa,*aa2;
1031 std::vector<double> bb,bb2;
1033 int spaceDim=self->getSpaceDimension();
1034 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1035 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
1036 self->rotate(centerPtr,vectorPtr,alpha);
1039 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1041 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1042 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1043 PyObject *res=PyList_New(result.size());
1044 for(int i=0;iL!=result.end(); i++, iL++)
1045 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1049 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
1051 std::vector<double> a0;
1052 std::vector<int> a1;
1053 std::vector<std::string> a2;
1054 self->getTinySerializationInformation(a0,a1,a2);
1055 PyObject *ret(PyTuple_New(3));
1056 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1057 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1059 PyObject *ret2(PyList_New(sz));
1061 for(int i=0;i<sz;i++)
1062 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1064 PyTuple_SetItem(ret,2,ret2);
1068 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1070 DataArrayInt *a0Tmp(0);
1071 DataArrayDouble *a1Tmp(0);
1072 self->serialize(a0Tmp,a1Tmp);
1073 PyObject *ret(PyTuple_New(2));
1074 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1075 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1079 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1081 std::vector<std::string> littleStrings;
1082 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1085 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1087 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1088 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1089 PyObject *ret(PyTuple_New(2));
1090 PyTuple_SetItem(ret,0,ret0);
1091 PyTuple_SetItem(ret,1,ret1);
1095 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1097 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1098 if(!PyTuple_Check(inp))
1099 throw INTERP_KERNEL::Exception(MSG);
1100 int sz(PyTuple_Size(inp));
1102 throw INTERP_KERNEL::Exception(MSG);
1103 PyObject *elt0(PyTuple_GetItem(inp,0));
1104 PyObject *elt1(PyTuple_GetItem(inp,1));
1105 std::vector<double> a0;
1106 std::vector<int> a1;
1107 std::vector<std::string> a2;
1108 DataArrayInt *b0(0);
1109 DataArrayDouble *b1(0);
1111 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1112 throw INTERP_KERNEL::Exception(MSG);
1113 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1115 fillArrayWithPyListDbl3(a0py,tmp,a0);
1116 convertPyToNewIntArr3(a1py,a1);
1117 fillStringVector(a2py,a2);
1120 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1121 throw INTERP_KERNEL::Exception(MSG);
1122 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1124 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1125 if(!SWIG_IsOK(status))
1126 throw INTERP_KERNEL::Exception(MSG);
1127 b0=reinterpret_cast<DataArrayInt *>(argp);
1128 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1129 if(!SWIG_IsOK(status))
1130 throw INTERP_KERNEL::Exception(MSG);
1131 b1=reinterpret_cast<DataArrayDouble *>(argp);
1133 // useless here to call resizeForUnserialization because arrays are well resized.
1134 self->unserialization(a0,a1,b0,b1,a2);
1137 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1139 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1140 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1141 return MEDCouplingMesh::MergeMeshes(tmp);
1147 //== MEDCouplingMesh End
1149 %include "NormalizedGeometricTypes"
1150 %include "MEDCouplingNatureOfFieldEnum"
1152 namespace MEDCoupling
1154 class MEDCouplingNatureOfField
1157 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1158 static std::string GetReprNoThrow(NatureOfField nat);
1159 static std::string GetAllPossibilitiesStr();
1163 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1164 // include "MEDCouplingTimeDiscretization.i"
1166 namespace MEDCoupling
1168 class MEDCouplingGaussLocalization
1171 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1172 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1173 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1174 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1175 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1176 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1177 int getDimension() const throw(INTERP_KERNEL::Exception);
1178 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1179 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1180 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1181 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1183 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1184 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1185 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1186 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1187 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1188 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1189 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1190 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1191 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1192 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1193 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1194 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1196 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1200 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const throw(INTERP_KERNEL::Exception)
1202 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1206 MEDCouplingUMesh *buildRefCell() const throw(INTERP_KERNEL::Exception)
1208 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1214 class MEDCouplingSkyLineArray
1217 static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayInt* c, const DataArrayInt* cI ) throw(INTERP_KERNEL::Exception);
1219 void set( DataArrayInt* index, DataArrayInt* value );
1220 void set3( DataArrayInt* superIndex, DataArrayInt* index, DataArrayInt* value );
1222 int getSuperNumberOf() const;
1223 int getNumberOf() const;
1224 int getLength() const;
1226 void deletePack(const int i, const int j) throw(INTERP_KERNEL::Exception);
1228 void deleteSimplePack(const int i) throw(INTERP_KERNEL::Exception);
1229 void deleteSimplePacks(const DataArrayInt* idx) throw(INTERP_KERNEL::Exception);
1233 MEDCouplingSkyLineArray() throw(INTERP_KERNEL::Exception)
1235 return MEDCouplingSkyLineArray::New();
1238 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value) throw(INTERP_KERNEL::Exception)
1240 return MEDCouplingSkyLineArray::New(index, value);
1243 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value ) throw(INTERP_KERNEL::Exception)
1245 return MEDCouplingSkyLineArray::New(index, value);
1248 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other ) throw(INTERP_KERNEL::Exception)
1250 return MEDCouplingSkyLineArray::New(other);
1253 std::string __str__() const throw(INTERP_KERNEL::Exception)
1255 return self->simpleRepr();
1258 DataArrayInt *getSuperIndexArray() const
1260 DataArrayInt *ret(self->getSuperIndexArray());
1266 DataArrayInt *getIndexArray() const
1268 DataArrayInt *ret(self->getIndexArray());
1274 DataArrayInt *getValuesArray() const
1276 DataArrayInt *ret(self->getValuesArray());
1282 PyObject *getSimplePackSafe(int absolutePackId) const throw(INTERP_KERNEL::Exception)
1284 std::vector<int> ret;
1285 self->getSimplePackSafe(absolutePackId,ret);
1286 return convertIntArrToPyList2(ret);
1289 PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const throw(INTERP_KERNEL::Exception)
1291 std::vector<int> vpack, vspIdx, out;
1293 convertPyToNewIntArr3(superPackIndices,vspIdx);
1294 convertPyToNewIntArr3(pack,vpack);
1296 self->findPackIds(vspIdx, vpack.data(), vpack.data()+vpack.size(), out);
1297 return convertIntArrToPyList2(out);
1300 void pushBackPack(const int i, PyObject *pack) throw(INTERP_KERNEL::Exception)
1302 std::vector<int> vpack;
1303 convertPyToNewIntArr3(pack,vpack);
1304 self->pushBackPack(i,vpack.data(), vpack.data()+vpack.size());
1307 void replaceSimplePack(const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1309 std::vector<int> vpack;
1310 convertPyToNewIntArr3(pack,vpack);
1311 self->replaceSimplePack(idx, vpack.data(), vpack.data()+vpack.size());
1314 void replaceSimplePacks(const DataArrayInt* idx, PyObject *listePacks) throw(INTERP_KERNEL::Exception)
1316 std::vector<const DataArrayInt*> packs;
1317 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt*>(listePacks,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",packs);
1318 self->replaceSimplePacks(idx, packs);
1321 void replacePack(const int superIdx, const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1323 std::vector<int> vpack;
1324 convertPyToNewIntArr3(pack,vpack);
1325 self->replacePack(superIdx, idx, vpack.data(), vpack.data()+vpack.size());
1328 PyObject *convertToPolyhedronConn() const throw(INTERP_KERNEL::Exception)
1330 MCAuto<DataArrayInt> d0=DataArrayInt::New();
1331 MCAuto<DataArrayInt> d1=DataArrayInt::New();
1332 self->convertToPolyhedronConn(d0,d1);
1333 PyObject *ret=PyTuple_New(2);
1334 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1335 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1342 %include "MEDCouplingFieldDiscretization.i"
1344 //== MEDCouplingPointSet
1346 namespace MEDCoupling
1348 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1351 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1352 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1353 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1354 void zipCoords() throw(INTERP_KERNEL::Exception);
1355 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1356 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1357 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1358 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1359 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1360 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1361 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1362 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1363 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1364 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1365 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1366 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1367 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1368 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1369 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1370 virtual DataArrayInt *findBoundaryNodes() const;
1371 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1372 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1373 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1374 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1375 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1376 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1377 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1378 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1379 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1380 virtual void invertOrientationOfAllCells() throw(INTERP_KERNEL::Exception);
1383 std::string __str__() const throw(INTERP_KERNEL::Exception)
1385 return self->simpleRepr();
1388 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1391 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1392 PyObject *res = PyList_New(2);
1393 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1394 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1398 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1400 DataArrayInt *comm, *commIndex;
1401 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1402 PyObject *res = PyList_New(2);
1403 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1404 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1408 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1410 DataArrayDouble *ret1=self->getCoords();
1413 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1416 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1418 int szArr,sw,iTypppArr;
1419 std::vector<int> stdvecTyyppArr;
1420 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1421 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1422 if(sw==3)//DataArrayInt
1424 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1425 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1426 std::string name=argpt->getName();
1428 ret->setName(name.c_str());
1430 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1433 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1435 int szArr,sw,iTypppArr;
1436 std::vector<int> stdvecTyyppArr;
1437 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1438 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1439 if(sw==3)//DataArrayInt
1441 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1442 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1443 std::string name=argpt->getName();
1445 ret->setName(name.c_str());
1447 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1450 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1452 int szArr,sw,iTypppArr;
1453 std::vector<int> stdvecTyyppArr;
1454 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1455 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1456 if(sw==3)//DataArrayInt
1458 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1459 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1460 std::string name=argpt->getName();
1462 ret->setName(name.c_str());
1464 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1467 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1469 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1470 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1473 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1475 int szArr,sw,iTypppArr;
1476 std::vector<int> stdvecTyyppArr;
1477 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1478 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1479 if(sw==3)//DataArrayInt
1481 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1482 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1483 std::string name=argpt->getName();
1485 ret->setName(name.c_str());
1487 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1490 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1492 int szArr,sw,iTypppArr;
1493 std::vector<int> stdvecTyyppArr;
1494 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1495 self->renumberNodes(tmp,newNbOfNodes);
1498 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1500 int szArr,sw,iTypppArr;
1501 std::vector<int> stdvecTyyppArr;
1502 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1503 self->renumberNodesCenter(tmp,newNbOfNodes);
1506 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1508 int spaceDim=self->getSpaceDimension();
1510 DataArrayDouble *a,*a2;
1511 DataArrayDoubleTuple *aa,*aa2;
1512 std::vector<double> bb,bb2;
1514 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st parameter for point.";
1515 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd parameter for vector.";
1516 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1517 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1518 std::vector<int> nodes;
1519 self->findNodesOnLine(p,v,eps,nodes);
1520 DataArrayInt *ret=DataArrayInt::New();
1521 ret->alloc((int)nodes.size(),1);
1522 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1523 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1525 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1527 int spaceDim=self->getSpaceDimension();
1529 DataArrayDouble *a,*a2;
1530 DataArrayDoubleTuple *aa,*aa2;
1531 std::vector<double> bb,bb2;
1533 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st parameter for point.";
1534 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd parameter for vector.";
1535 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1536 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1537 std::vector<int> nodes;
1538 self->findNodesOnPlane(p,v,eps,nodes);
1539 DataArrayInt *ret=DataArrayInt::New();
1540 ret->alloc((int)nodes.size(),1);
1541 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1542 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1545 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1549 DataArrayDoubleTuple *aa;
1550 std::vector<double> bb;
1552 int spaceDim=self->getSpaceDimension();
1553 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1554 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1555 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1556 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1559 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1561 DataArrayInt *c=0,*cI=0;
1565 DataArrayDoubleTuple *aa;
1566 std::vector<double> bb;
1568 int spaceDim=self->getSpaceDimension();
1569 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1570 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1571 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1572 PyObject *ret=PyTuple_New(2);
1573 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1574 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1578 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1580 DataArrayInt *c=0,*cI=0;
1581 int spaceDim=self->getSpaceDimension();
1584 DataArrayDoubleTuple *aa;
1585 std::vector<double> bb;
1588 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1589 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1591 PyObject *ret=PyTuple_New(2);
1592 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1593 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1597 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1601 DataArrayDoubleTuple *aa;
1602 std::vector<double> bb;
1604 int spaceDim=self->getSpaceDimension();
1605 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1606 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1608 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1609 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1612 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1616 std::vector<int> multiVal;
1617 std::pair<int, std::pair<int,int> > slic;
1618 MEDCoupling::DataArrayInt *daIntTyypp=0;
1619 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1623 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1625 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1627 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1629 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1633 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1635 DataArrayInt *v0(nullptr),*v1(nullptr);
1636 self->findCommonCells(compType,startCellId,v0,v1);
1637 PyObject *res = PyList_New(2);
1638 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1639 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1644 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1648 int res1(SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__MapII, 0 | 0 ));
1651 MapII *da2(reinterpret_cast<MapII *>(da));
1652 self->renumberNodesInConn(da2->data());
1656 int res1(SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 ));
1657 if (!SWIG_IsOK(res1))
1660 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1661 self->renumberNodesInConn(tmp);
1665 DataArrayInt *da2(reinterpret_cast< DataArrayInt * >(da));
1667 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1668 da2->checkAllocated();
1669 self->renumberNodesInConn(da2->getConstPointer());
1673 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1676 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1677 PyObject *ret=PyTuple_New(2);
1678 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1679 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1683 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1685 DataArrayInt *ret(nullptr);
1687 int szArr,sw,iTypppArr;
1688 std::vector<int> stdvecTyyppArr;
1689 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1690 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1694 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1698 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1699 PyObject *res = PyList_New(3);
1700 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1701 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1702 PyList_SetItem(res,2,SWIG_From_int(ret2));
1706 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1710 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1711 PyObject *res = PyList_New(3);
1712 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1713 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1714 PyList_SetItem(res,2,SWIG_From_int(ret2));
1718 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1721 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1722 if (!SWIG_IsOK(res1))
1725 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1726 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1730 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1732 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1733 da2->checkAllocated();
1734 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1738 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1742 std::vector<int> multiVal;
1743 std::pair<int, std::pair<int,int> > slic;
1744 MEDCoupling::DataArrayInt *daIntTyypp=0;
1745 int nbc=self->getNumberOfCells();
1746 convertIntStarOrSliceLikePyObjToCpp(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1753 std::ostringstream oss;
1754 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1755 throw INTERP_KERNEL::Exception(oss.str().c_str());
1758 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1763 int tmp=nbc+singleVal;
1764 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1768 std::ostringstream oss;
1769 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1770 throw INTERP_KERNEL::Exception(oss.str().c_str());
1776 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1780 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1785 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1786 daIntTyypp->checkAllocated();
1787 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1790 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1794 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1797 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1798 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1799 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1800 for(int i=0;i<sz;i++)
1801 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1804 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1807 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1809 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1810 std::vector<double> val3;
1811 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1812 "Rotate2DAlg",2,true,nbNodes);
1814 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1815 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1818 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1821 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1822 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1823 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1824 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1825 for(int i=0;i<sz;i++)
1826 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1829 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1832 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1834 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1835 std::vector<double> val3;
1836 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1837 "Rotate3DAlg",3,true,nbNodes);
1839 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1840 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1841 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1846 //== MEDCouplingPointSet End
1848 class MEDCouplingUMeshCell
1851 INTERP_KERNEL::NormalizedCellType getType() const;
1854 std::string __str__() const throw(INTERP_KERNEL::Exception)
1856 return self->repr();
1859 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1862 const int *r=self->getAllConn(ret2);
1863 PyObject *ret=PyTuple_New(ret2);
1864 for(int i=0;i<ret2;i++)
1865 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1871 class MEDCouplingUMeshCellIterator
1878 MEDCouplingUMeshCell *ret=self->nextt();
1880 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1883 PyErr_SetString(PyExc_StopIteration,"No more data.");
1890 class MEDCouplingUMeshCellByTypeIterator
1893 ~MEDCouplingUMeshCellByTypeIterator();
1898 MEDCouplingUMeshCellEntry *ret=self->nextt();
1900 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1903 PyErr_SetString(PyExc_StopIteration,"No more data.");
1910 class MEDCouplingUMeshCellByTypeEntry
1913 ~MEDCouplingUMeshCellByTypeEntry();
1916 MEDCouplingUMeshCellByTypeIterator *__iter__()
1918 return self->iterator();
1923 class MEDCouplingUMeshCellEntry
1926 INTERP_KERNEL::NormalizedCellType getType() const;
1927 int getNumberOfElems() const;
1930 MEDCouplingUMeshCellIterator *__iter__()
1932 return self->iterator();
1937 //== MEDCouplingUMesh
1939 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1942 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1943 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1944 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1945 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1946 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1947 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1948 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1949 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1950 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1951 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1952 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1953 void computeTypes() throw(INTERP_KERNEL::Exception);
1954 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1955 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1957 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1958 DataArrayInt *conformize3D(double eps) throw(INTERP_KERNEL::Exception);
1959 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1960 DataArrayInt *colinearizeKeepingConform2D(double eps) throw(INTERP_KERNEL::Exception);
1961 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1962 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1963 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1964 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1965 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1966 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1967 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1968 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1969 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1970 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1971 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1972 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1973 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1974 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1975 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1976 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1977 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1978 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1979 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1980 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1981 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1982 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1983 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1984 DataArrayInt *convertDegeneratedCellsAndRemoveFlatOnes() throw(INTERP_KERNEL::Exception);
1985 bool removeDegenerated1DCells() throw(INTERP_KERNEL::Exception);
1986 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1987 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1988 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1989 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1990 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1991 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1992 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1993 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1994 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1995 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1996 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1997 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1998 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1999 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
2000 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
2001 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
2002 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
2003 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
2004 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
2005 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
2006 int split2DCells(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *subNodesInSeg, const DataArrayInt *subNodesInSegI, const DataArrayInt *midOpt=0, const DataArrayInt *midOptI=0) throw(INTERP_KERNEL::Exception);
2007 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
2008 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2009 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2010 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
2011 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
2013 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
2015 return MEDCouplingUMesh::New();
2018 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
2020 return MEDCouplingUMesh::New(meshName,meshDim);
2023 std::string __str__() const throw(INTERP_KERNEL::Exception)
2025 return self->simpleRepr();
2028 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2030 std::ostringstream oss;
2031 self->reprQuickOverview(oss);
2035 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
2037 return self->cellIterator();
2040 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
2042 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
2046 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
2048 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
2049 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2050 PyObject *res=PyList_New(result.size());
2051 for(int i=0;iL!=result.end(); i++, iL++)
2052 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2056 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2060 std::vector<int> multiVal;
2061 std::pair<int, std::pair<int,int> > slic;
2062 MEDCoupling::DataArrayInt *daIntTyypp=0;
2063 int nbc=self->getNumberOfCells();
2064 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2071 std::ostringstream oss;
2072 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2073 throw INTERP_KERNEL::Exception(oss.str().c_str());
2077 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2084 int tmp=nbc+singleVal;
2085 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2090 std::ostringstream oss;
2091 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2092 throw INTERP_KERNEL::Exception(oss.str().c_str());
2098 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2104 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2105 daIntTyypp->checkAllocated();
2106 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2110 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
2114 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2118 std::vector<int> multiVal;
2119 std::pair<int, std::pair<int,int> > slic;
2120 MEDCoupling::DataArrayInt *daIntTyypp=0;
2121 int nbc=self->getNumberOfCells();
2122 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2129 std::ostringstream oss;
2130 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2131 throw INTERP_KERNEL::Exception(oss.str().c_str());
2135 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2142 int tmp=nbc+singleVal;
2143 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2148 std::ostringstream oss;
2149 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2150 throw INTERP_KERNEL::Exception(oss.str().c_str());
2156 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2161 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2167 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2168 daIntTyypp->checkAllocated();
2169 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2173 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2177 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2179 int szArr,sw,iTypppArr;
2180 std::vector<int> stdvecTyyppArr;
2181 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2184 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2185 throw INTERP_KERNEL::Exception(oss.str().c_str());
2187 self->insertNextCell(type,size,tmp);
2190 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2192 int szArr,sw,iTypppArr;
2193 std::vector<int> stdvecTyyppArr;
2194 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2195 self->insertNextCell(type,szArr,tmp);
2198 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2200 DataArrayInt *ret=self->getNodalConnectivity();
2205 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2207 DataArrayInt *ret=self->getNodalConnectivityIndex();
2213 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2215 int szArr,sw,iTypppArr;
2216 std::vector<int> stdvecTyyppArr;
2217 const int *seedPtr=convertIntStarLikePyObjToCppIntStar(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2218 int nbOfDepthPeelingPerformed=0;
2219 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2220 PyObject *res=PyTuple_New(2);
2221 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2222 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2226 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2228 DataArrayInt *v0=0,*v1=0;
2229 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2230 PyObject *res = PyList_New(2);
2231 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2232 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2236 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2240 DataArrayDoubleTuple *aa;
2241 std::vector<double> bb;
2243 int nbOfCompo=self->getSpaceDimension();
2244 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2247 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2248 PyObject *ret=PyTuple_New(2);
2249 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2250 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2254 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2256 DataArrayInt *ret1=0;
2257 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2258 PyObject *ret=PyTuple_New(2);
2259 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2260 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2264 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2267 DataArrayInt *ret1(0);
2268 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2269 PyObject *ret=PyTuple_New(3);
2270 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2271 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2272 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2276 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2278 std::vector<int> cells;
2279 self->checkButterflyCells(cells,eps);
2280 DataArrayInt *ret=DataArrayInt::New();
2281 ret->alloc((int)cells.size(),1);
2282 std::copy(cells.begin(),cells.end(),ret->getPointer());
2283 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2286 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2288 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2290 PyObject *ret = PyList_New(sz);
2291 for(int i=0;i<sz;i++)
2292 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2296 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2298 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2299 int sz=retCpp.size();
2300 PyObject *ret=PyList_New(sz);
2301 for(int i=0;i<sz;i++)
2302 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2306 static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2308 std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2309 int sz=retCpp.size();
2310 PyObject *ret=PyList_New(sz);
2311 for(int i=0;i<sz;i++)
2312 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2316 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2319 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2320 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2321 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2324 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2327 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2328 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2332 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2335 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2336 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2340 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2342 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2343 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2344 PyObject *ret=PyTuple_New(3);
2345 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2346 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2347 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2351 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2353 DataArrayInt *tmp0=0,*tmp1=0;
2354 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2355 PyObject *ret=PyTuple_New(2);
2356 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2357 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2361 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2365 std::vector<int> multiVal;
2366 std::pair<int, std::pair<int,int> > slic;
2367 MEDCoupling::DataArrayInt *daIntTyypp=0;
2368 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2372 return self->duplicateNodes(&singleVal,&singleVal+1);
2374 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2376 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2378 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2382 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2386 std::vector<int> multiVal;
2387 std::pair<int, std::pair<int,int> > slic;
2388 MEDCoupling::DataArrayInt *daIntTyypp=0;
2389 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2393 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2395 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2397 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2399 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2403 void attractSeg3MidPtsAroundNodes(double ratio, PyObject *nodeIds) throw(INTERP_KERNEL::Exception)
2405 int szArr,sw,iTypppArr;
2406 std::vector<int> stdvecTyyppArr;
2407 const int *nodeIdsPtr(convertIntStarLikePyObjToCppIntStar(nodeIds,sw,szArr,iTypppArr,stdvecTyyppArr));
2408 self->attractSeg3MidPtsAroundNodes(ratio,nodeIdsPtr,nodeIdsPtr+szArr);
2411 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2414 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2415 DataArrayInt *tmp0,*tmp1=0;
2416 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2417 PyObject *ret=PyTuple_New(2);
2418 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2419 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2423 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2425 DataArrayInt *ret0=0,*ret1=0;
2426 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2427 PyObject *ret=PyTuple_New(2);
2428 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2429 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2433 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2435 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2436 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2437 DataArrayInt *ret1=0,*ret2=0;
2438 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2439 PyObject *ret=PyTuple_New(3);
2440 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2441 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2442 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2446 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2448 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2449 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2450 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2451 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2454 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2457 std::vector<const MEDCouplingUMesh *> meshes;
2458 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2459 std::vector<DataArrayInt *> corr;
2460 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2462 PyObject *ret1=PyList_New(sz);
2463 for(int i=0;i<sz;i++)
2464 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2465 PyObject *ret=PyList_New(2);
2466 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2467 PyList_SetItem(ret,1,ret1);
2471 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2473 std::vector<MEDCouplingUMesh *> meshes;
2474 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2475 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2478 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2480 std::vector<MEDCouplingUMesh *> meshes;
2481 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2482 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2485 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2489 std::vector<int> multiVal;
2490 std::pair<int, std::pair<int,int> > slic;
2491 MEDCoupling::DataArrayInt *daIntTyypp=0;
2493 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2494 convertIntStarOrSliceLikePyObjToCpp(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2498 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2500 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2502 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2504 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2508 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2510 DataArrayInt *arrOut=0,*arrIndexOut=0;
2513 std::vector<int> multiVal;
2514 std::pair<int, std::pair<int,int> > slic;
2515 MEDCoupling::DataArrayInt *daIntTyypp=0;
2517 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2518 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2523 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2528 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2533 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2537 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2539 PyObject *ret=PyTuple_New(2);
2540 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2541 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2545 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2547 DataArrayInt *arrOut=0,*arrIndexOut=0;
2548 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2549 PyObject *ret=PyTuple_New(2);
2550 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2551 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2555 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2557 if(!PySlice_Check(slic))
2558 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2559 Py_ssize_t strt=2,stp=2,step=2;
2561 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2562 arrIndxIn->checkAllocated();
2563 if(arrIndxIn->getNumberOfComponents()!=1)
2564 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2565 GetIndicesOfSlice(slic,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2566 DataArrayInt *arrOut=0,*arrIndexOut=0;
2567 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2568 PyObject *ret=PyTuple_New(2);
2569 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2570 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2574 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2575 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2576 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2578 DataArrayInt *arrOut=0,*arrIndexOut=0;
2581 std::vector<int> multiVal;
2582 std::pair<int, std::pair<int,int> > slic;
2583 MEDCoupling::DataArrayInt *daIntTyypp=0;
2585 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2586 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2591 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2596 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2601 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2605 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2607 PyObject *ret=PyTuple_New(2);
2608 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2609 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2613 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2614 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2618 std::vector<int> multiVal;
2619 std::pair<int, std::pair<int,int> > slic;
2620 MEDCoupling::DataArrayInt *daIntTyypp=0;
2622 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2623 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2628 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2633 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2638 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2642 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2646 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2650 DataArrayDoubleTuple *aa;
2651 std::vector<double> bb;
2653 int spaceDim=self->getSpaceDimension();
2654 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2655 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2657 std::vector<int> cells;
2658 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2659 DataArrayInt *ret=DataArrayInt::New();
2660 ret->alloc((int)cells.size(),1);
2661 std::copy(cells.begin(),cells.end(),ret->getPointer());
2662 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2665 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2669 DataArrayDoubleTuple *aa;
2670 std::vector<double> bb;
2672 int spaceDim=self->getSpaceDimension();
2673 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2674 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2675 self->orientCorrectly2DCells(v,polyOnly);
2678 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2680 std::vector<int> cells;
2681 self->arePolyhedronsNotCorrectlyOriented(cells);
2682 DataArrayInt *ret=DataArrayInt::New();
2683 ret->alloc((int)cells.size(),1);
2684 std::copy(cells.begin(),cells.end(),ret->getPointer());
2685 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2688 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2692 self->getFastAveragePlaneOfThis(vec,pos);
2694 std::copy(vec,vec+3,vals);
2695 std::copy(pos,pos+3,vals+3);
2696 return convertDblArrToPyListOfTuple<double>(vals,3,2);
2699 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2701 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2702 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2703 return MEDCouplingUMesh::MergeUMeshes(tmp);
2706 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2709 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2710 PyObject *ret=PyTuple_New(2);
2711 PyObject *ret0Py=ret0?Py_True:Py_False;
2713 PyTuple_SetItem(ret,0,ret0Py);
2714 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2718 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2721 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2722 PyObject *ret=PyTuple_New(2);
2723 PyObject *ret0Py=ret0?Py_True:Py_False;
2725 PyTuple_SetItem(ret,0,ret0Py);
2726 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2730 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2732 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2733 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2734 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2735 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2736 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2737 PyObject *ret=PyTuple_New(5);
2738 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2739 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2740 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2741 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2742 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2746 PyObject *explodeIntoEdges() const throw(INTERP_KERNEL::Exception)
2748 MCAuto<DataArrayInt> desc,descIndex,revDesc,revDescIndx;
2749 MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2750 PyObject *ret=PyTuple_New(5);
2751 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2752 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2753 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2754 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2755 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2759 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2761 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2762 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2763 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2764 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2765 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2766 PyObject *ret=PyTuple_New(5);
2767 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2768 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2769 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2770 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2771 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2775 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2777 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2778 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2779 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2780 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2781 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2782 PyObject *ret=PyTuple_New(5);
2783 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2784 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2785 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2786 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2787 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2791 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2793 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2794 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2795 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2796 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2797 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2798 PyObject *ret=PyTuple_New(5);
2799 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2800 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2801 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2802 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2803 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2807 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2809 DataArrayInt *neighbors=0,*neighborsIdx=0;
2810 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2811 PyObject *ret=PyTuple_New(2);
2812 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2813 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2817 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2819 DataArrayInt *neighbors=0,*neighborsIdx=0;
2820 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2821 PyObject *ret=PyTuple_New(2);
2822 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2823 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2827 PyObject *computeEnlargedNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2829 MCAuto<DataArrayInt> neighbors,neighborsIdx;
2830 self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2831 PyObject *ret=PyTuple_New(2);
2832 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2833 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2837 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const throw(INTERP_KERNEL::Exception)
2839 MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
2840 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2841 PyObject *ret=PyTuple_New(2);
2842 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2843 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2847 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2849 DataArrayInt *neighbors=0,*neighborsIdx=0;
2850 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2851 PyObject *ret=PyTuple_New(2);
2852 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2853 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2857 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2859 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2860 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2861 DataArrayInt *d2,*d3,*d4,*dd5;
2862 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2863 PyObject *ret=PyTuple_New(7);
2864 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2865 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2866 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2867 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2868 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2869 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2870 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2874 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2877 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2878 da->checkAllocated();
2879 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2882 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2885 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2886 da->checkAllocated();
2887 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2890 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2893 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2894 da->checkAllocated();
2895 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2898 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2901 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2902 da->checkAllocated();
2903 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2904 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2905 PyObject *res = PyList_New(result.size());
2906 for (int i=0;iL!=result.end(); i++, iL++)
2907 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2911 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2914 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2915 da->checkAllocated();
2916 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2917 ret->setName(da->getName().c_str());
2921 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2923 DataArrayInt *cellNb1=0,*cellNb2=0;
2924 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2925 PyObject *ret=PyTuple_New(3);
2926 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2927 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2928 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2932 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2934 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2935 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2936 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2937 PyObject *ret(PyTuple_New(4));
2938 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2939 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2940 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2941 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2945 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2947 int spaceDim=self->getSpaceDimension();
2949 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2951 DataArrayDouble *a,*a2;
2952 DataArrayDoubleTuple *aa,*aa2;
2953 std::vector<double> bb,bb2;
2955 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st parameter for origin.";
2956 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd parameter for vector.";
2957 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2958 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2960 DataArrayInt *cellIds=0;
2961 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2962 PyObject *ret=PyTuple_New(2);
2963 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2964 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2968 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2970 int spaceDim=self->getSpaceDimension();
2972 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2974 DataArrayDouble *a,*a2;
2975 DataArrayDoubleTuple *aa,*aa2;
2976 std::vector<double> bb,bb2;
2978 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st parameter for origin.";
2979 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd parameter for vector.";
2980 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2981 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2983 DataArrayInt *cellIds=0;
2984 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2985 PyObject *ret=PyTuple_New(2);
2986 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2987 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2991 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2994 DataArrayDouble *a,*a2;
2995 DataArrayDoubleTuple *aa,*aa2;
2996 std::vector<double> bb,bb2;
2998 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st parameter for origin.";
2999 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd parameter for vector.";
3000 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
3001 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
3002 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
3006 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3008 int spaceDim=self->getSpaceDimension();
3010 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
3012 DataArrayDouble *a,*a2;
3013 DataArrayDoubleTuple *aa,*aa2;
3014 std::vector<double> bb,bb2;
3016 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st parameter for origin.";
3017 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd parameter for vector.";
3018 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3019 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3020 return self->getCellIdsCrossingPlane(orig,vect,eps);
3023 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
3027 std::vector<int> pos2;
3028 DataArrayInt *pos3=0;
3029 DataArrayIntTuple *pos4=0;
3030 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
3035 self->convertToPolyTypes(&pos1,&pos1+1);
3042 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
3047 self->convertToPolyTypes(pos3->begin(),pos3->end());
3051 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
3055 void convertAllToPoly();
3056 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
3057 bool unPolyze() throw(INTERP_KERNEL::Exception);
3058 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
3059 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
3060 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
3063 //== MEDCouplingUMesh End
3065 //== MEDCouplingMappedExtrudedMesh
3067 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
3070 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
3071 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
3072 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
3073 int get2DCellIdForExtrusion() const;
3075 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
3077 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3080 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
3082 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3085 MEDCouplingMappedExtrudedMesh()
3087 return MEDCouplingMappedExtrudedMesh::New();
3090 std::string __str__() const throw(INTERP_KERNEL::Exception)
3092 return self->simpleRepr();
3095 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3097 std::ostringstream oss;
3098 self->reprQuickOverview(oss);
3102 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
3104 MEDCouplingUMesh *ret=self->getMesh2D();
3107 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3109 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
3111 MEDCouplingUMesh *ret=self->getMesh1D();
3114 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3116 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
3118 DataArrayInt *ret=self->getMesh3DIds();
3121 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3126 //== MEDCouplingMappedExtrudedMesh End
3128 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3131 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3132 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3133 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
3134 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
3135 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
3136 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
3139 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
3141 int szArr,sw,iTypppArr;
3142 std::vector<int> stdvecTyyppArr;
3143 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3144 self->insertNextCell(tmp,tmp+szArr);
3147 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3149 DataArrayInt *ret=self->getNodalConnectivity();
3150 if(ret) ret->incrRef();
3154 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3156 std::vector< const MEDCoupling1GTUMesh *> parts;
3157 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3158 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3163 //== MEDCoupling1SGTUMesh
3165 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3168 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3169 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3170 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
3171 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
3172 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
3173 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3174 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
3175 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
3176 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
3179 MEDCoupling1SGTUMesh()
3181 return MEDCoupling1SGTUMesh::New();
3184 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3186 return MEDCoupling1SGTUMesh::New(name,type);
3189 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3191 return MEDCoupling1SGTUMesh::New(m);
3194 std::string __str__() const throw(INTERP_KERNEL::Exception)
3196 return self->simpleRepr();
3199 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3201 std::ostringstream oss;
3202 self->reprQuickOverview(oss);
3206 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3208 DataArrayInt *cellPerm(0),*nodePerm(0);
3209 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3210 PyObject *ret(PyTuple_New(3));
3211 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3212 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3213 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3217 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3219 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3220 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3221 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3224 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3226 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3227 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3228 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3233 //== MEDCoupling1SGTUMesh End
3235 //== MEDCoupling1DGTUMesh
3237 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3240 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3241 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3242 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3243 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3244 bool isPacked() const throw(INTERP_KERNEL::Exception);
3247 MEDCoupling1DGTUMesh()
3249 return MEDCoupling1DGTUMesh::New();
3251 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3253 return MEDCoupling1DGTUMesh::New(name,type);
3256 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3258 return MEDCoupling1DGTUMesh::New(m);
3261 std::string __str__() const throw(INTERP_KERNEL::Exception)
3263 return self->simpleRepr();
3266 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3268 std::ostringstream oss;
3269 self->reprQuickOverview(oss);
3273 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3275 DataArrayInt *ret=self->getNodalConnectivityIndex();
3276 if(ret) ret->incrRef();
3280 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3282 DataArrayInt *ret1=0,*ret2=0;
3283 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3284 PyObject *ret0Py=ret0?Py_True:Py_False;
3286 PyObject *ret=PyTuple_New(3);
3287 PyTuple_SetItem(ret,0,ret0Py);
3288 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3289 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3293 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3296 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3297 PyObject *ret=PyTuple_New(2);
3298 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3299 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3300 PyTuple_SetItem(ret,1,ret1Py);
3304 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3306 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3307 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3308 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3311 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3313 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3314 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3315 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3318 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3320 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3321 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3322 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3327 //== MEDCoupling1DGTUMeshEnd
3329 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3332 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3333 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3334 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3335 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3336 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3337 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3338 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3339 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3340 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3341 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3342 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3343 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3344 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3345 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3346 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3349 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3351 int tmpp1=-1,tmpp2=-1;
3352 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3353 std::vector< std::pair<int,int> > inp;
3357 for(int i=0;i<tmpp1;i++)
3358 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3363 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3364 inp.resize(tmpp1/2);
3365 for(int i=0;i<tmpp1/2;i++)
3366 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3369 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3370 return self->buildStructuredSubPart(inp);
3373 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3375 std::vector< std::pair<int,int> > inp;
3376 convertPyToVectorPairInt(part,inp);
3378 int szArr,sw,iTypppArr;
3379 std::vector<int> stdvecTyyppArr;
3380 const int *tmp4=convertIntStarLikePyObjToCppIntStar(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3381 std::vector<int> tmp5(tmp4,tmp4+szArr);
3383 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3386 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3388 std::vector< std::pair<int,int> > inp;
3389 convertPyToVectorPairInt(part,inp);
3390 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3393 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3395 std::vector< std::pair<int,int> > inp;
3396 convertPyToVectorPairInt(part,inp);
3397 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3400 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3402 std::vector< std::pair<int,int> > inp;
3403 convertPyToVectorPairInt(part,inp);
3404 std::vector<int> stWithGhost;
3405 std::vector< std::pair<int,int> > partWithGhost;
3406 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3407 PyObject *ret(PyTuple_New(2));
3408 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3409 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3413 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3415 std::vector< std::pair<int,int> > inp;
3416 convertPyToVectorPairInt(partCompactFormat,inp);
3417 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3420 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3422 std::vector< std::pair<int,int> > inp;
3423 convertPyToVectorPairInt(partCompactFormat,inp);
3424 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3427 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3429 std::vector< std::pair<int,int> > inp;
3430 convertPyToVectorPairInt(part,inp);
3431 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3434 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3436 int szArr,sw,iTypppArr;
3437 std::vector<int> stdvecTyyppArr;
3438 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3439 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3442 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3444 int szArr,sw,iTypppArr;
3445 std::vector<int> stdvecTyyppArr;
3446 const int *tmp(convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3447 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3450 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3452 std::vector< std::pair<int,int> > inp;
3453 convertPyToVectorPairInt(partCompactFormat,inp);
3454 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3457 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3459 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3460 PyObject *retPy=PyList_New(ret.size());
3461 for(std::size_t i=0;i<ret.size();i++)
3463 PyObject *tmp=PyTuple_New(2);
3464 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3465 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3466 PyList_SetItem(retPy,i,tmp);
3471 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3473 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3474 convertPyToVectorPairInt(r1,r1Cpp);
3475 convertPyToVectorPairInt(r2,r2Cpp);
3476 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3477 PyObject *retPy=PyList_New(ret.size());
3478 for(std::size_t i=0;i<ret.size();i++)
3480 PyObject *tmp=PyTuple_New(2);
3481 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3482 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3483 PyList_SetItem(retPy,i,tmp);
3488 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3490 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3491 convertPyToVectorPairInt(r1,r1Cpp);
3492 convertPyToVectorPairInt(r2,r2Cpp);
3493 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3496 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3498 int szArr,sw,iTypppArr;
3499 std::vector<int> stdvecTyyppArr;
3500 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3501 int szArr2,sw2,iTypppArr2;
3502 std::vector<int> stdvecTyyppArr2;
3503 const int *tmp2=convertIntStarLikePyObjToCppIntStar(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3504 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3505 std::vector< std::pair<int,int> > partCompactFormat;
3506 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3507 PyObject *ret=PyTuple_New(2);
3508 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3509 PyTuple_SetItem(ret,0,ret0Py);
3510 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3511 for(std::size_t i=0;i<partCompactFormat.size();i++)
3513 PyObject *tmp4=PyTuple_New(2);
3514 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3515 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3516 PyList_SetItem(ret1Py,i,tmp4);
3518 PyTuple_SetItem(ret,1,ret1Py);
3522 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3524 std::vector< std::pair<int,int> > param0,param1,ret;
3525 convertPyToVectorPairInt(bigInAbs,param0);
3526 convertPyToVectorPairInt(partOfBigInAbs,param1);
3527 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3528 PyObject *retPy(PyList_New(ret.size()));
3529 for(std::size_t i=0;i<ret.size();i++)
3531 PyObject *tmp(PyTuple_New(2));
3532 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3533 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3534 PyList_SetItem(retPy,i,tmp);
3539 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3541 std::vector< std::pair<int,int> > param0;
3542 convertPyToVectorPairInt(part,param0);
3543 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3544 PyObject *retPy(PyList_New(ret.size()));
3545 for(std::size_t i=0;i<ret.size();i++)
3547 PyObject *tmp(PyTuple_New(2));
3548 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3549 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3550 PyList_SetItem(retPy,i,tmp);
3555 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3557 std::vector< std::pair<int,int> > param0,param1;
3558 convertPyToVectorPairInt(startingFrom,param0);
3559 convertPyToVectorPairInt(goingTo,param1);
3560 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3563 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3565 std::vector< std::pair<int,int> > param0,param1,ret;
3566 convertPyToVectorPairInt(bigInAbs,param0);
3567 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3568 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3569 PyObject *retPy(PyList_New(ret.size()));
3570 for(std::size_t i=0;i<ret.size();i++)
3572 PyObject *tmp(PyTuple_New(2));
3573 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3574 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3575 PyList_SetItem(retPy,i,tmp);
3582 class MEDCouplingCurveLinearMesh;
3584 //== MEDCouplingCMesh
3586 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3589 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3590 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3591 void setCoords(const DataArrayDouble *coordsX,
3592 const DataArrayDouble *coordsY=0,
3593 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3594 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3595 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3597 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3599 return MEDCouplingCMesh::New();
3601 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3603 return MEDCouplingCMesh::New(meshName);
3605 std::string __str__() const throw(INTERP_KERNEL::Exception)
3607 return self->simpleRepr();
3609 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3611 std::ostringstream oss;
3612 self->reprQuickOverview(oss);
3615 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3617 DataArrayDouble *ret=self->getCoordsAt(i);
3625 //== MEDCouplingCMesh End
3627 //== MEDCouplingCurveLinearMesh
3629 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3632 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3633 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3634 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3636 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3638 return MEDCouplingCurveLinearMesh::New();
3640 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3642 return MEDCouplingCurveLinearMesh::New(meshName);
3644 std::string __str__() const throw(INTERP_KERNEL::Exception)
3646 return self->simpleRepr();
3648 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3650 std::ostringstream oss;
3651 self->reprQuickOverview(oss);
3654 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3656 DataArrayDouble *ret=self->getCoords();
3661 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3663 int szArr,sw,iTypppArr;
3664 std::vector<int> stdvecTyyppArr;
3665 const int *tmp=convertIntStarLikePyObjToCppIntStar(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3666 self->setNodeGridStructure(tmp,tmp+szArr);
3671 //== MEDCouplingCurveLinearMesh End
3673 //== MEDCouplingIMesh
3675 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3678 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3680 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3681 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3682 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3683 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3684 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3685 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3686 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3687 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3688 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3689 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3690 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3695 return MEDCouplingIMesh::New();
3697 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3699 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3700 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3701 const int *nodeStrctPtr(0);
3702 const double *originPtr(0),*dxyzPtr(0);
3704 std::vector<int> bb0;
3705 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
3708 std::vector<double> bb,bb2;
3710 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3711 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3713 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3716 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3718 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3721 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3724 std::vector<int> bb0;
3725 const int *nodeStrctPtr(convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0));
3726 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3729 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3731 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3734 DataArrayDoubleTuple *aa;
3735 std::vector<double> bb;
3737 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3738 self->setOrigin(originPtr,originPtr+nbTuples);
3741 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3743 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3746 DataArrayDoubleTuple *aa;
3747 std::vector<double> bb;
3749 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3750 self->setDXYZ(originPtr,originPtr+nbTuples);
3753 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3755 std::vector< std::pair<int,int> > inp;
3756 convertPyToVectorPairInt(fineLocInCoarse,inp);
3757 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3760 static void CondenseFineToCoarseGhost(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA, int ghostSize) throw(INTERP_KERNEL::Exception)
3762 std::vector< std::pair<int,int> > inp;
3763 convertPyToVectorPairInt(fineLocInCoarse,inp);
3764 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3767 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3769 std::vector< std::pair<int,int> > inp;
3770 convertPyToVectorPairInt(fineLocInCoarse,inp);
3771 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3774 static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, int ghostSize) throw(INTERP_KERNEL::Exception)
3776 std::vector< std::pair<int,int> > inp;
3777 convertPyToVectorPairInt(fineLocInCoarse,inp);
3778 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3781 static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, int ghostSize) throw(INTERP_KERNEL::Exception)
3783 std::vector< std::pair<int,int> > inp;
3784 convertPyToVectorPairInt(fineLocInCoarse,inp);
3785 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3788 std::string __str__() const throw(INTERP_KERNEL::Exception)
3790 return self->simpleRepr();
3792 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3794 std::ostringstream oss;
3795 self->reprQuickOverview(oss);
3801 //== MEDCouplingIMesh End
3805 namespace MEDCoupling
3807 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3810 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3811 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3812 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3813 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3814 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3815 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3816 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3817 std::string getName() const throw(INTERP_KERNEL::Exception);
3818 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3819 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3820 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3821 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3822 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3823 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3824 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3825 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3826 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3827 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3828 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3829 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3830 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3831 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3832 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3833 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3835 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3837 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3840 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3843 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3845 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3848 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3851 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3853 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3854 return convertIntArrToPyList3(ret);
3857 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3859 DataArrayInt *ret1=0;
3860 MEDCouplingMesh *ret0=0;
3862 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3863 if (!SWIG_IsOK(res1))
3866 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3867 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3871 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3873 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3874 da2->checkAllocated();
3875 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3877 PyObject *res = PyList_New(2);
3878 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3879 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3883 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3885 DataArrayInt *ret1=0;
3887 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3888 PyObject *res=PyTuple_New(2);
3889 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3891 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3894 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3895 PyTuple_SetItem(res,1,res1);
3900 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3903 int v0; std::vector<int> v1;
3904 const int *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
3905 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3908 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3909 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3912 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3913 if (!SWIG_IsOK(res1))
3916 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3917 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3921 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3923 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3924 da2->checkAllocated();
3925 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3929 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3931 std::vector<int> tmp;
3932 self->getCellIdsHavingGaussLocalization(locId,tmp);
3933 DataArrayInt *ret=DataArrayInt::New();
3934 ret->alloc((int)tmp.size(),1);
3935 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3936 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3939 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3941 std::vector<int> inp0;
3942 convertPyToNewIntArr4(code,1,3,inp0);
3943 std::vector<const DataArrayInt *> inp1;
3944 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3945 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3950 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3953 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3954 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f) throw(INTERP_KERNEL::Exception);
3955 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3956 static MEDCouplingFieldTemplate *New(TypeOfField type);
3957 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3958 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3959 bool isEqual(const MEDCouplingFieldTemplate *other, double meshPrec) const throw(INTERP_KERNEL::Exception);
3960 bool isEqualWithoutConsideringStr(const MEDCouplingFieldTemplate *other, double meshPrec) const throw(INTERP_KERNEL::Exception);
3963 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3965 return MEDCouplingFieldTemplate::New(f);
3968 MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f) throw(INTERP_KERNEL::Exception)
3970 return MEDCouplingFieldTemplate::New(f);
3973 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3975 return MEDCouplingFieldTemplate::New(f);
3978 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3980 return MEDCouplingFieldTemplate::New(type);
3983 std::string __str__() const throw(INTERP_KERNEL::Exception)
3985 return self->simpleRepr();
3988 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3990 std::ostringstream oss;
3991 self->reprQuickOverview(oss);
3995 PyObject *isEqualIfNotWhy(const MEDCouplingFieldTemplate *other, double meshPrec) const throw(INTERP_KERNEL::Exception)
3998 bool ret0=self->isEqualIfNotWhy(other,meshPrec,ret1);
3999 PyObject *ret=PyTuple_New(2);
4000 PyObject *ret0Py=ret0?Py_True:Py_False;
4002 PyTuple_SetItem(ret,0,ret0Py);
4003 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4010 class MEDCouplingFieldT : public MEDCoupling::MEDCouplingField
4013 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
4015 MEDCouplingFieldT();
4016 ~MEDCouplingFieldT();
4019 %template(MEDCouplingFieldTdouble) MEDCoupling::MEDCouplingFieldT<double>;
4020 %template(MEDCouplingFieldTfloat) MEDCoupling::MEDCouplingFieldT<float>;
4021 %template(MEDCouplingFieldTint) MEDCoupling::MEDCouplingFieldT<int>;
4023 class MEDCouplingFieldInt;
4024 class MEDCouplingFieldFloat;
4026 class MEDCouplingFieldDouble : public MEDCouplingFieldT<double>
4029 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
4030 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
4031 bool isEqual(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
4032 bool isEqualWithoutConsideringStr(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
4033 void setTimeUnit(const std::string& unit);
4034 std::string getTimeUnit() const;
4035 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
4036 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
4037 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
4038 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4039 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4040 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
4041 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
4042 MEDCouplingFieldFloat *convertToFloatField() const throw(INTERP_KERNEL::Exception);
4043 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
4044 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
4045 MEDCouplingFieldDouble *deepCopy() const;
4046 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
4047 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
4048 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
4049 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
4050 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
4051 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
4052 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
4053 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
4054 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4055 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4056 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4057 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
4058 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
4059 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
4060 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
4061 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
4062 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
4063 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4064 void setIteration(int it) throw(INTERP_KERNEL::Exception);
4065 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
4066 void setOrder(int order) throw(INTERP_KERNEL::Exception);
4067 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
4068 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
4069 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
4070 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4071 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4072 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4073 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4074 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4075 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4076 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
4077 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
4078 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
4079 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
4080 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
4081 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
4082 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
4083 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
4084 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
4085 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
4086 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
4087 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
4088 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
4089 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4090 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4091 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4092 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4093 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4094 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4095 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
4096 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
4097 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
4098 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
4099 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
4100 double getMaxValue() const throw(INTERP_KERNEL::Exception);
4101 double getMinValue() const throw(INTERP_KERNEL::Exception);
4102 double getAverageValue() const throw(INTERP_KERNEL::Exception);
4103 double norm2() const throw(INTERP_KERNEL::Exception);
4104 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4105 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4106 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4107 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
4108 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
4109 double normMax(int compId) const throw(INTERP_KERNEL::Exception);
4110 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
4111 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
4112 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4113 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4114 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4115 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4116 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4117 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4118 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4119 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4120 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4121 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4122 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4123 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4124 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4125 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4126 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
4128 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4130 return MEDCouplingFieldDouble::New(type,td);
4133 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4135 return MEDCouplingFieldDouble::New(ft,td);
4138 std::string __str__() const throw(INTERP_KERNEL::Exception)
4140 return self->simpleRepr();
4143 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4145 std::ostringstream oss;
4146 self->reprQuickOverview(oss);
4150 PyObject *isEqualIfNotWhy(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
4153 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
4154 PyObject *ret=PyTuple_New(2);
4155 PyObject *ret0Py=ret0?Py_True:Py_False;
4157 PyTuple_SetItem(ret,0,ret0Py);
4158 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4162 MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
4164 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4168 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
4170 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4174 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4176 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4178 DataArrayDouble *a,*a2;
4179 DataArrayDoubleTuple *aa,*aa2;
4180 std::vector<double> bb,bb2;
4182 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4183 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4184 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4187 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
4189 DataArrayDouble *ret=self->getArray();
4195 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4197 std::vector<DataArrayDouble *> arrs=self->getArrays();
4198 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4202 PyObject *ret=PyTuple_New(sz);
4203 for(int i=0;i<sz;i++)
4206 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4208 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4213 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4215 std::vector<const DataArrayDouble *> tmp;
4216 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4218 std::vector<DataArrayDouble *> arrs(sz);
4219 for(int i=0;i<sz;i++)
4220 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4221 self->setArrays(arrs);
4224 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4226 DataArrayDouble *ret=self->getEndArray();
4232 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4236 DataArrayDoubleTuple *aa;
4237 std::vector<double> bb;
4239 const MEDCouplingMesh *mesh=self->getMesh();
4241 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4242 int spaceDim=mesh->getSpaceDimension();
4243 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4244 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4246 int sz=self->getNumberOfComponents();
4247 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4248 self->getValueOn(spaceLoc,res);
4249 return convertDblArrToPyList<double>(res,sz);
4252 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4254 int sz=self->getNumberOfComponents();
4255 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4256 self->getValueOnPos(i,j,k,res);
4257 return convertDblArrToPyList<double>(res,sz);
4260 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4262 const MEDCouplingMesh *mesh(self->getMesh());
4264 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4267 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4268 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4269 mesh->getSpaceDimension(),true,nbPts);
4270 return self->getValueOnMulti(inp,nbPts);
4273 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4277 DataArrayDoubleTuple *aa;
4278 std::vector<double> bb;
4280 const MEDCouplingMesh *mesh=self->getMesh();
4282 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4283 int spaceDim=mesh->getSpaceDimension();
4284 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4285 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4288 int sz=self->getNumberOfComponents();
4289 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4290 self->getValueOn(spaceLoc,time,res);
4291 return convertDblArrToPyList<double>(res,sz);
4294 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4296 if(self->getArray()!=0)
4297 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4300 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4301 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4302 self->setArray(arr);
4306 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4309 double tmp0=self->getTime(tmp1,tmp2);
4310 PyObject *res = PyList_New(3);
4311 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4312 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4313 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4317 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4320 double tmp0=self->getStartTime(tmp1,tmp2);
4321 PyObject *res = PyList_New(3);
4322 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4323 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4324 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4328 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4331 double tmp0=self->getEndTime(tmp1,tmp2);
4332 PyObject *res = PyList_New(3);
4333 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4334 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4335 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4338 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4340 int sz=self->getNumberOfComponents();
4341 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4342 self->accumulate(tmp);
4343 return convertDblArrToPyList<double>(tmp,sz);
4345 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4347 int sz=self->getNumberOfComponents();
4348 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4349 self->integral(isWAbs,tmp);
4350 return convertDblArrToPyList<double>(tmp,sz);
4352 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4354 int sz=self->getNumberOfComponents();
4355 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4356 self->getWeightedAverageValue(tmp,isWAbs);
4357 return convertDblArrToPyList<double>(tmp,sz);
4359 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4361 int sz=self->getNumberOfComponents();
4362 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4364 return convertDblArrToPyList<double>(tmp,sz);
4366 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4368 int sz=self->getNumberOfComponents();
4369 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4371 return convertDblArrToPyList<double>(tmp,sz);
4373 PyObject *normMax() const throw(INTERP_KERNEL::Exception)
4375 int sz=self->getNumberOfComponents();
4376 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4378 return convertDblArrToPyList<double>(tmp,sz);
4380 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4382 int szArr,sw,iTypppArr;
4383 std::vector<int> stdvecTyyppArr;
4384 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4385 self->renumberCells(tmp,check);
4388 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4390 int szArr,sw,iTypppArr;
4391 std::vector<int> stdvecTyyppArr;
4392 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4393 self->renumberCellsWithoutMesh(tmp,check);
4396 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4398 int szArr,sw,iTypppArr;
4399 std::vector<int> stdvecTyyppArr;
4400 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4401 self->renumberNodes(tmp,eps);
4404 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4406 int szArr,sw,iTypppArr;
4407 std::vector<int> stdvecTyyppArr;
4408 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4409 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4412 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4414 return fieldT_buildSubPart(self,li);
4417 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4419 return fieldT__getitem__(self,li);
4422 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4425 double r1=self->getMaxValue2(tmp);
4426 PyObject *ret=PyTuple_New(2);
4427 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4428 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4432 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4435 double r1=self->getMinValue2(tmp);
4436 PyObject *ret=PyTuple_New(2);
4437 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4438 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4442 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4444 std::vector<int> tmp;
4445 convertPyToNewIntArr3(li,tmp);
4446 return self->keepSelectedComponents(tmp);
4449 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4451 std::vector<int> tmp;
4452 convertPyToNewIntArr3(li,tmp);
4453 self->setSelectedComponents(f,tmp);
4456 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4459 DataArrayDouble *a,*a2;
4460 DataArrayDoubleTuple *aa,*aa2;
4461 std::vector<double> bb,bb2;
4464 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st parameter for origin.";
4465 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd parameter for vector.";
4466 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4467 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4469 return self->extractSlice3D(orig,vect,eps);
4472 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4474 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4477 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4479 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4482 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4484 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.";
4485 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4488 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4490 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4492 return (*self)-(*other);
4494 throw INTERP_KERNEL::Exception(msg);
4499 DataArrayDoubleTuple *aa;
4500 std::vector<double> bb;
4502 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4507 if(!self->getArray())
4508 throw INTERP_KERNEL::Exception(msg2);
4509 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4510 ret->applyLin(1.,-val);
4511 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4512 ret2->setArray(ret);
4517 if(!self->getArray())
4518 throw INTERP_KERNEL::Exception(msg2);
4519 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4520 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4521 ret2->setArray(ret);
4526 if(!self->getArray())
4527 throw INTERP_KERNEL::Exception(msg2);
4528 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4529 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4530 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4531 ret2->setArray(ret);
4536 if(!self->getArray())
4537 throw INTERP_KERNEL::Exception(msg2);
4538 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4539 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4540 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4541 ret2->setArray(ret);
4545 { throw INTERP_KERNEL::Exception(msg); }
4549 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4551 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4554 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4556 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4559 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4561 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4564 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4566 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.";
4567 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4570 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4572 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4574 return (*self)/(*other);
4576 throw INTERP_KERNEL::Exception(msg);
4581 DataArrayDoubleTuple *aa;
4582 std::vector<double> bb;
4584 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4590 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4591 if(!self->getArray())
4592 throw INTERP_KERNEL::Exception(msg2);
4593 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4594 ret->applyLin(1./val,0);
4595 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4596 ret2->setArray(ret);
4601 if(!self->getArray())
4602 throw INTERP_KERNEL::Exception(msg2);
4603 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4604 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4605 ret2->setArray(ret);
4610 if(!self->getArray())
4611 throw INTERP_KERNEL::Exception(msg2);
4612 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4613 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4614 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4615 ret2->setArray(ret);
4620 if(!self->getArray())
4621 throw INTERP_KERNEL::Exception(msg2);
4622 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4623 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4624 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4625 ret2->setArray(ret);
4629 { throw INTERP_KERNEL::Exception(msg); }
4633 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4635 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4638 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4640 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.";
4641 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4644 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4646 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4648 return (*self)^(*other);
4650 throw INTERP_KERNEL::Exception(msg);
4655 DataArrayDoubleTuple *aa;
4656 std::vector<double> bb;
4658 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4663 if(!self->getArray())
4664 throw INTERP_KERNEL::Exception(msg2);
4665 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4667 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4668 ret2->setArray(ret);
4673 if(!self->getArray())
4674 throw INTERP_KERNEL::Exception(msg2);
4675 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4676 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4677 ret2->setArray(ret);
4682 if(!self->getArray())
4683 throw INTERP_KERNEL::Exception(msg2);
4684 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4685 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4686 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4687 ret2->setArray(ret);
4692 if(!self->getArray())
4693 throw INTERP_KERNEL::Exception(msg2);
4694 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4695 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4696 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4697 ret2->setArray(ret);
4701 { throw INTERP_KERNEL::Exception(msg); }
4705 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4707 return self->negate();
4710 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4712 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.";
4713 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4716 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4718 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4722 Py_XINCREF(trueSelf);
4726 throw INTERP_KERNEL::Exception(msg);
4731 DataArrayDoubleTuple *aa;
4732 std::vector<double> bb;
4734 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4739 if(!self->getArray())
4740 throw INTERP_KERNEL::Exception(msg2);
4741 self->getArray()->applyLin(1.,val);
4742 Py_XINCREF(trueSelf);
4747 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4750 Py_XINCREF(trueSelf);
4755 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4756 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4757 ret2->setArray(aaa);
4759 Py_XINCREF(trueSelf);
4764 if(!self->getArray())
4765 throw INTERP_KERNEL::Exception(msg2);
4766 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4767 self->getArray()->addEqual(aaa);
4768 Py_XINCREF(trueSelf);
4772 { throw INTERP_KERNEL::Exception(msg); }
4776 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4778 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.";
4779 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4782 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4784 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4788 Py_XINCREF(trueSelf);
4792 throw INTERP_KERNEL::Exception(msg);
4797 DataArrayDoubleTuple *aa;
4798 std::vector<double> bb;
4800 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4805 if(!self->getArray())
4806 throw INTERP_KERNEL::Exception(msg2);
4807 self->getArray()->applyLin(1.,-val);
4808 Py_XINCREF(trueSelf);
4813 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4816 Py_XINCREF(trueSelf);
4821 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4822 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4823 ret2->setArray(aaa);
4825 Py_XINCREF(trueSelf);
4830 if(!self->getArray())
4831 throw INTERP_KERNEL::Exception(msg2);
4832 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4833 self->getArray()->substractEqual(aaa);
4834 Py_XINCREF(trueSelf);
4838 { throw INTERP_KERNEL::Exception(msg); }
4842 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4844 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.";
4845 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4848 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4850 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4854 Py_XINCREF(trueSelf);
4858 throw INTERP_KERNEL::Exception(msg);
4863 DataArrayDoubleTuple *aa;
4864 std::vector<double> bb;
4866 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4871 if(!self->getArray())
4872 throw INTERP_KERNEL::Exception(msg2);
4873 self->getArray()->applyLin(val,0);
4874 Py_XINCREF(trueSelf);
4879 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4882 Py_XINCREF(trueSelf);
4887 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4888 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4889 ret2->setArray(aaa);
4891 Py_XINCREF(trueSelf);
4896 if(!self->getArray())
4897 throw INTERP_KERNEL::Exception(msg2);
4898 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4899 self->getArray()->multiplyEqual(aaa);
4900 Py_XINCREF(trueSelf);
4904 { throw INTERP_KERNEL::Exception(msg); }
4908 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4910 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.";
4911 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4914 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4916 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4920 Py_XINCREF(trueSelf);
4924 throw INTERP_KERNEL::Exception(msg);
4929 DataArrayDoubleTuple *aa;
4930 std::vector<double> bb;
4932 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4938 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4939 if(!self->getArray())
4940 throw INTERP_KERNEL::Exception(msg2);
4941 self->getArray()->applyLin(1./val,0);
4942 Py_XINCREF(trueSelf);
4947 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4950 Py_XINCREF(trueSelf);
4955 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4956 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4957 ret2->setArray(aaa);
4959 Py_XINCREF(trueSelf);
4964 if(!self->getArray())
4965 throw INTERP_KERNEL::Exception(msg2);
4966 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4967 self->getArray()->divideEqual(aaa);
4968 Py_XINCREF(trueSelf);
4972 { throw INTERP_KERNEL::Exception(msg); }
4976 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4978 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.";
4979 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4982 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4984 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4988 Py_XINCREF(trueSelf);
4992 throw INTERP_KERNEL::Exception(msg);
4997 DataArrayDoubleTuple *aa;
4998 std::vector<double> bb;
5000 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
5005 if(!self->getArray())
5006 throw INTERP_KERNEL::Exception(msg2);
5007 self->getArray()->applyPow(val);
5008 Py_XINCREF(trueSelf);
5013 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
5016 Py_XINCREF(trueSelf);
5021 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
5022 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
5023 ret2->setArray(aaa);
5025 Py_XINCREF(trueSelf);
5030 if(!self->getArray())
5031 throw INTERP_KERNEL::Exception(msg2);
5032 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
5033 self->getArray()->powEqual(aaa);
5034 Py_XINCREF(trueSelf);
5038 { throw INTERP_KERNEL::Exception(msg); }
5042 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5044 std::vector<const MEDCouplingFieldDouble *> tmp;
5045 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5046 return MEDCouplingFieldDouble::MergeFields(tmp);
5049 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
5051 std::vector<const MEDCouplingFieldDouble *> tmp;
5052 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5053 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
5056 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
5058 return field_getTinySerializationInformation<MEDCouplingFieldDouble>(self);
5061 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5063 return field_serialize<double>(self);
5066 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5068 return field__getstate__<MEDCouplingFieldDouble>(self,MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldDouble_serialize);
5071 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5073 field__setstate__<double>(self,inp);
5078 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5081 int getNumberOfFields() const;
5082 MEDCouplingMultiFields *deepCopy() const;
5083 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5084 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5085 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5086 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5087 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5090 std::string __str__() const throw(INTERP_KERNEL::Exception)
5092 return self->simpleRepr();
5094 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5096 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5097 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5099 std::vector<MEDCouplingFieldDouble *> fs(sz);
5100 for(int i=0;i<sz;i++)
5101 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5102 return MEDCouplingMultiFields::New(fs);
5104 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5106 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5107 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5109 std::vector<MEDCouplingFieldDouble *> fs(sz);
5110 for(int i=0;i<sz;i++)
5111 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5112 return MEDCouplingMultiFields::New(fs);
5114 PyObject *getFields() const
5116 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5117 int sz=fields.size();
5118 PyObject *res = PyList_New(sz);
5119 for(int i=0;i<sz;i++)
5123 fields[i]->incrRef();
5124 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5128 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5133 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5135 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5139 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5142 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5144 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5146 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5148 PyObject *res = PyList_New(sz);
5149 for(int i=0;i<sz;i++)
5154 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5158 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5163 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5165 std::vector<int> refs;
5166 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5168 PyObject *res = PyList_New(sz);
5169 for(int i=0;i<sz;i++)
5174 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5178 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5182 PyObject *ret=PyTuple_New(2);
5183 PyTuple_SetItem(ret,0,res);
5184 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5187 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5189 std::vector<DataArrayDouble *> ms=self->getArrays();
5191 PyObject *res = PyList_New(sz);
5192 for(int i=0;i<sz;i++)
5197 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5201 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5206 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5208 std::vector< std::vector<int> > refs;
5209 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5211 PyObject *res = PyList_New(sz);
5212 PyObject *res2 = PyList_New(sz);
5213 for(int i=0;i<sz;i++)
5218 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5222 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5224 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5227 PyObject *ret=PyTuple_New(2);
5228 PyTuple_SetItem(ret,0,res);
5229 PyTuple_SetItem(ret,1,res2);
5235 class MEDCouplingFieldInt : public MEDCouplingFieldT<int>
5238 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5239 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5240 bool isEqual(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const throw(INTERP_KERNEL::Exception);
5241 bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const throw(INTERP_KERNEL::Exception);
5242 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5243 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5244 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5245 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5246 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5247 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5248 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5249 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5250 MEDCouplingFieldInt *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
5252 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5254 return MEDCouplingFieldInt::New(type,td);
5257 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5259 return MEDCouplingFieldInt::New(ft,td);
5262 PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const throw(INTERP_KERNEL::Exception)
5265 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5266 PyObject *ret=PyTuple_New(2);
5267 PyObject *ret0Py=ret0?Py_True:Py_False;
5269 PyTuple_SetItem(ret,0,ret0Py);
5270 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5274 std::string __str__() const throw(INTERP_KERNEL::Exception)
5276 return self->simpleRepr();
5279 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5281 std::ostringstream oss;
5282 self->reprQuickOverview(oss);
5286 MEDCouplingFieldInt *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
5288 return fieldT_buildSubPart(self,li);
5291 MEDCouplingFieldInt *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
5293 return fieldT__getitem__(self,li);
5296 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5298 DataArrayInt *ret=self->getArray();
5304 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5307 double tmp0=self->getTime(tmp1,tmp2);
5308 PyObject *res = PyList_New(3);
5309 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5310 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5311 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5315 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
5317 return field_getTinySerializationInformation<MEDCouplingFieldInt>(self);
5320 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5322 return field_serialize<int>(self);
5325 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5327 return field__getstate__<MEDCouplingFieldInt>(self,MEDCoupling_MEDCouplingFieldInt_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt_serialize);
5330 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5332 field__setstate__<int>(self,inp);
5337 class MEDCouplingFieldFloat : public MEDCouplingFieldT<float>
5340 static MEDCouplingFieldFloat *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5341 static MEDCouplingFieldFloat *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5342 bool isEqual(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const throw(INTERP_KERNEL::Exception);
5343 bool isEqualWithoutConsideringStr(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const throw(INTERP_KERNEL::Exception);
5344 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5345 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5346 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5347 void setArray(DataArrayFloat *array) throw(INTERP_KERNEL::Exception);
5348 MEDCouplingFieldFloat *deepCopy() const throw(INTERP_KERNEL::Exception);
5349 MEDCouplingFieldFloat *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5350 MEDCouplingFieldFloat *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5351 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5352 MEDCouplingFieldFloat *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
5354 MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5356 return MEDCouplingFieldFloat::New(type,td);
5359 MEDCouplingFieldFloat(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5361 return MEDCouplingFieldFloat::New(ft,td);
5364 PyObject *isEqualIfNotWhy(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const throw(INTERP_KERNEL::Exception)
5367 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5368 PyObject *ret=PyTuple_New(2);
5369 PyObject *ret0Py=ret0?Py_True:Py_False;
5371 PyTuple_SetItem(ret,0,ret0Py);
5372 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5376 std::string __str__() const throw(INTERP_KERNEL::Exception)
5378 return self->simpleRepr();
5381 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5383 std::ostringstream oss;
5384 self->reprQuickOverview(oss);
5388 MEDCouplingFieldFloat *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
5390 return fieldT_buildSubPart(self,li);
5393 MEDCouplingFieldFloat *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
5395 return fieldT__getitem__(self,li);
5398 DataArrayFloat *getArray() throw(INTERP_KERNEL::Exception)
5400 DataArrayFloat *ret=self->getArray();
5406 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5409 double tmp0=self->getTime(tmp1,tmp2);
5410 PyObject *res = PyList_New(3);
5411 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5412 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5413 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5417 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
5419 return field_getTinySerializationInformation<MEDCouplingFieldFloat>(self);
5422 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5424 return field_serialize<float>(self);
5427 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5429 return field__getstate__<MEDCouplingFieldFloat>(self,MEDCoupling_MEDCouplingFieldFloat_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldFloat_serialize);
5432 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5434 field__setstate__<float>(self,inp);
5439 class MEDCouplingDefinitionTime
5442 MEDCouplingDefinitionTime();
5443 void assign(const MEDCouplingDefinitionTime& other);
5444 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5445 double getTimeResolution() const;
5446 std::vector<double> getHotSpotsTime() const;
5449 std::string __str__() const throw(INTERP_KERNEL::Exception)
5451 std::ostringstream oss;
5452 self->appendRepr(oss);
5456 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5458 int meshId,arrId,arrIdInField,fieldId;
5459 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5460 PyObject *res=PyList_New(4);
5461 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5462 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5463 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5464 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5468 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5470 int meshId,arrId,arrIdInField,fieldId;
5471 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5472 PyObject *res=PyList_New(4);
5473 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5474 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5475 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5476 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5482 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5485 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5486 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5490 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5492 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5493 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5495 std::vector<MEDCouplingFieldDouble *> fs(sz);
5496 for(int i=0;i<sz;i++)
5497 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5498 return MEDCouplingFieldOverTime::New(fs);
5500 std::string __str__() const throw(INTERP_KERNEL::Exception)
5502 return self->simpleRepr();
5504 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5506 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5507 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5509 std::vector<MEDCouplingFieldDouble *> fs(sz);
5510 for(int i=0;i<sz;i++)
5511 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5512 return MEDCouplingFieldOverTime::New(fs);
5517 class MEDCouplingCartesianAMRMesh;
5519 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5522 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5523 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5524 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5527 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5529 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5537 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5540 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5541 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5542 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5545 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5547 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5548 return convertFromVectorPairInt(ret);
5551 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5553 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5554 return convertFromVectorPairInt(ret);
5557 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5559 std::vector< std::pair<int,int> > inp;
5560 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5561 self->addPatch(inp,factors);
5564 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5566 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5568 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5569 if(patchId==mesh->getNumberOfPatches())
5571 std::ostringstream oss;
5572 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5573 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5576 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5582 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5584 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5586 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5587 mesh->removePatch(patchId);
5590 int __len__() const throw(INTERP_KERNEL::Exception)
5592 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5594 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5595 return mesh->getNumberOfPatches();
5600 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5604 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5607 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5608 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5609 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5610 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5611 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5612 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5613 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5614 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5615 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5616 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5617 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5618 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5619 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5621 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5622 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5623 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5624 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5625 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5626 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5627 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5628 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5629 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5630 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5631 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5632 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5633 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5634 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5635 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5636 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5637 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5638 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5639 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5640 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5643 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5645 std::vector< std::pair<int,int> > inp;
5646 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5647 self->addPatch(inp,factors);
5650 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5652 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5654 PyObject *ret = PyList_New(sz);
5655 for(int i=0;i<sz;i++)
5657 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5660 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5665 // agy : don't know why typemap fails here ??? let it in the extend section
5666 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5668 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5671 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5673 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5674 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5680 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5682 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5683 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5689 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5691 std::vector<int> out1;
5692 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5693 PyObject *ret(PyTuple_New(2));
5694 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5695 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5699 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5701 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5703 PyObject *ret = PyList_New(sz);
5704 for(int i=0;i<sz;i++)
5705 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5709 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5711 std::vector<const DataArrayDouble *> inp;
5712 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5713 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5716 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5718 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5724 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5726 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5732 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5734 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5740 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5742 const MEDCouplingIMesh *ret(self->getImageMesh());
5745 return const_cast<MEDCouplingIMesh *>(ret);
5748 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5750 if(patchId==self->getNumberOfPatches())
5752 std::ostringstream oss;
5753 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5754 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5757 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5763 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5765 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5766 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5767 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5770 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5772 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5773 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5774 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5777 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5779 self->removePatch(patchId);
5782 int __len__() const throw(INTERP_KERNEL::Exception)
5784 return self->getNumberOfPatches();
5789 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5793 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5796 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5799 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5801 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5802 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5803 const int *nodeStrctPtr(0);
5804 const double *originPtr(0),*dxyzPtr(0);
5806 std::vector<int> bb0;
5807 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
5810 std::vector<double> bb,bb2;
5812 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5813 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5815 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5818 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5820 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5821 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5822 std::vector< std::vector<int> > inp2;
5823 convertPyToVectorOfVectorOfInt(factors,inp2);
5824 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5827 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5829 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5832 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5834 return MEDCouplingCartesianAMRMesh::New(mesh);
5839 class MEDCouplingDataForGodFather : public RefCountObject
5842 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5843 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5844 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5845 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5846 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5847 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5848 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5849 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5850 virtual void alloc() throw(INTERP_KERNEL::Exception);
5851 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5854 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5856 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5864 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5867 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5868 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5869 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5870 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5871 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5872 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5873 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5874 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5875 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5878 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5880 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5881 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5882 MEDCouplingAMRAttribute *ret(0);
5885 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5886 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5888 catch(INTERP_KERNEL::Exception&)
5890 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5891 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5896 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5898 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5901 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5903 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5904 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5910 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5912 std::vector< std::vector<std::string> > compNamesCpp;
5913 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5914 self->spillInfoOnComponents(compNamesCpp);
5917 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5919 std::vector<int> inp0;
5920 if(!fillIntVector(nfs,inp0))
5921 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5922 std::size_t sz(inp0.size());
5923 std::vector<NatureOfField> inp00(sz);
5924 for(std::size_t i=0;i<sz;i++)
5925 inp00[i]=(NatureOfField)inp0[i];
5926 self->spillNatures(inp00);
5929 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5931 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5932 int sz((int)ret.size());
5933 PyObject *retPy(PyList_New(sz));
5934 for(int i=0;i<sz;i++)
5935 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5941 class DenseMatrix : public RefCountObject, public TimeLabel
5944 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5945 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5946 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5947 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5949 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5950 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5951 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5952 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5953 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5954 void transpose() throw(INTERP_KERNEL::Exception);
5956 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5957 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5958 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5961 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5963 return DenseMatrix::New(nbRows,nbCols);
5966 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5968 return DenseMatrix::New(array,nbRows,nbCols);
5971 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5974 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5975 PyObject *ret=PyTuple_New(2);
5976 PyObject *ret0Py=ret0?Py_True:Py_False;
5978 PyTuple_SetItem(ret,0,ret0Py);
5979 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5983 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5985 DataArrayDouble *ret(self->getData());
5991 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5993 return MEDCoupling::DenseMatrix::Add(self,other);
5996 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5998 return MEDCoupling::DenseMatrix::Substract(self,other);
6001 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6003 return MEDCoupling::DenseMatrix::Multiply(self,other);
6006 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
6008 return MEDCoupling::DenseMatrix::Multiply(self,other);
6011 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6013 self->addEqual(other);
6014 Py_XINCREF(trueSelf);
6018 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6020 self->substractEqual(other);
6021 Py_XINCREF(trueSelf);
6025 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
6027 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
6036 def MEDCouplingUMeshReduce(self):
6037 return MEDCouplingStdReduceFunct,(MEDCouplingUMesh,((),(self.__getstate__()),))
6038 def MEDCouplingCMeshReduce(self):
6039 return MEDCouplingStdReduceFunct,(MEDCouplingCMesh,((),(self.__getstate__()),))
6040 def MEDCouplingIMeshReduce(self):
6041 return MEDCouplingStdReduceFunct,(MEDCouplingIMesh,((),(self.__getstate__()),))
6042 def MEDCouplingMappedExtrudedMeshReduce(self):
6043 return MEDCouplingStdReduceFunct,(MEDCouplingMappedExtrudedMesh,((),(self.__getstate__()),))
6044 def MEDCouplingCurveLinearMeshReduce(self):
6045 return MEDCouplingStdReduceFunct,(MEDCouplingCurveLinearMesh,((),(self.__getstate__()),))
6046 def MEDCoupling1SGTUMeshReduce(self):
6047 return MEDCouplingStdReduceFunct,(MEDCoupling1SGTUMesh,((),(self.__getstate__()),))
6048 def MEDCoupling1DGTUMeshReduce(self):
6049 return MEDCouplingStdReduceFunct,(MEDCoupling1DGTUMesh,((),(self.__getstate__()),))
6050 def MEDCouplingFieldDoubleReduce(self):
6051 self.checkConsistencyLight()
6052 d=(self.getTypeOfField(),self.getTimeDiscretization())
6053 return MEDCouplingStdReduceFunct,(MEDCouplingFieldDouble,(d,(self.__getstate__()),))
6054 def MEDCouplingFieldIntReduce(self):
6055 self.checkConsistencyLight()
6056 d=(self.getTypeOfField(),self.getTimeDiscretization())
6057 return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt,(d,(self.__getstate__()),))
6058 def MEDCouplingFieldFloatReduce(self):
6059 self.checkConsistencyLight()
6060 d=(self.getTypeOfField(),self.getTimeDiscretization())
6061 return MEDCouplingStdReduceFunct,(MEDCouplingFieldFloat,(d,(self.__getstate__()),))
6066 __filename=os.environ.get('PYTHONSTARTUP')
6067 if __filename and os.path.isfile(__filename):
6068 exec(open(__filename).read())