1 // Copyright (C) 2017 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 %rename (InterpKernelException) INTERP_KERNEL::Exception;
491 %include "MEDCouplingRefCountObject.i"
492 %include "MEDCouplingMemArray.i"
496 {// AGY : here initialization of C++ traits in MEDCouplingDataArrayTypemaps.i for code factorization. Awful, I know, but no other solutions.
497 SWIGTITraits<double>::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble;
498 SWIGTITraits<float>::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat;
499 SWIGTITraits<int>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt;
500 SWIGTITraits<double>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple;
501 SWIGTITraits<float>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayFloatTuple;
502 SWIGTITraits<int>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayIntTuple;
506 namespace INTERP_KERNEL
509 * \class BoxSplittingOptions
510 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
512 class BoxSplittingOptions
515 BoxSplittingOptions();
516 void init() throw(INTERP_KERNEL::Exception);
517 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
518 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
519 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
520 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
521 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
522 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
523 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
524 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
525 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
526 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
527 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
528 std::string printOptions() const throw(INTERP_KERNEL::Exception);
531 std::string __str__() const throw(INTERP_KERNEL::Exception)
533 return self->printOptions();
539 namespace MEDCoupling
555 CONST_ON_TIME_INTERVAL = 7
556 } TypeOfTimeDiscretization;
564 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
565 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
567 } MEDCouplingMeshType;
570 class DataArrayDouble;
571 class MEDCouplingUMesh;
572 class MEDCouplingCMesh;
573 class MEDCouplingFieldDouble;
575 %extend RefCountObject
577 std::string getHiddenCppPointer() const
579 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
584 %extend MEDCouplingGaussLocalization
586 std::string __str__() const throw(INTERP_KERNEL::Exception)
588 return self->getStringRepr();
591 std::string __repr__() const throw(INTERP_KERNEL::Exception)
593 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
594 oss << self->getStringRepr();
601 class MEDCouplingMesh : public RefCountObject, public TimeLabel
604 void setName(const std::string& name);
605 std::string getName() const;
606 void setDescription(const std::string& descr);
607 std::string getDescription() const;
608 void setTime(double val, int iteration, int order);
609 void setTimeUnit(const std::string& unit);
610 std::string getTimeUnit() const;
611 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
612 bool isStructured() const throw(INTERP_KERNEL::Exception);
613 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
614 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
615 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
616 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
617 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
618 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
619 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
620 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
621 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
622 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
623 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
624 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
625 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
626 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
627 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
628 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
629 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
630 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
631 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
632 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
633 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
634 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
635 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
636 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
637 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
638 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
639 virtual std::string getVTKFileExtension() const;
640 std::string getVTKFileNameOf(const std::string& fileName) const;
642 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
643 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
644 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
645 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
646 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
647 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
648 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
649 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
650 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
651 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
652 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);
653 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
654 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
655 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
656 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
657 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
658 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
659 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
662 std::string __str__() const throw(INTERP_KERNEL::Exception)
664 return self->simpleRepr();
667 PyObject *getTime() throw(INTERP_KERNEL::Exception)
670 double tmp0=self->getTime(tmp1,tmp2);
671 PyObject *res = PyList_New(3);
672 PyList_SetItem(res,0,SWIG_From_double(tmp0));
673 PyList_SetItem(res,1,SWIG_From_int(tmp1));
674 PyList_SetItem(res,2,SWIG_From_int(tmp2));
678 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
680 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
681 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
687 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
691 DataArrayDoubleTuple *aa;
692 std::vector<double> bb;
694 int spaceDim=self->getSpaceDimension();
695 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
696 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
697 return self->getCellContainingPoint(pos,eps);
700 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
704 DataArrayDoubleTuple *aa;
705 std::vector<double> bb;
707 int spaceDim=self->getSpaceDimension();
708 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
709 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
710 MCAuto<DataArrayInt> elts,eltsIndex;
711 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
712 PyObject *ret=PyTuple_New(2);
713 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
714 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
718 PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
722 DataArrayDoubleTuple *aa;
723 std::vector<double> bb;
725 int spaceDim=self->getSpaceDimension();
726 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPointsLinearPartOnlyOnNonDynType : ";
727 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
728 MCAuto<DataArrayInt> elts,eltsIndex;
729 self->getCellsContainingPointsLinearPartOnlyOnNonDynType(pos,nbOfPoints,eps,elts,eltsIndex);
730 PyObject *ret=PyTuple_New(2);
731 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
732 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
736 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
738 auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayInt>& d, MCAuto<DataArrayInt>& e) { self->getCellsContainingPoints(a,b,c,d,e); };
739 return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
742 PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
744 auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayInt>& d, MCAuto<DataArrayInt>& e) { self->getCellsContainingPointsLinearPartOnlyOnNonDynType(a,b,c,d,e); };
745 return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
748 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
752 DataArrayDoubleTuple *aa;
753 std::vector<double> bb;
755 int spaceDim=self->getSpaceDimension();
756 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
757 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
758 std::vector<int> elts;
759 self->getCellsContainingPoint(pos,eps,elts);
760 DataArrayInt *ret=DataArrayInt::New();
761 ret->alloc((int)elts.size(),1);
762 std::copy(elts.begin(),elts.end(),ret->getPointer());
763 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
766 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
768 MCAuto<DataArrayInt> d0=DataArrayInt::New();
769 MCAuto<DataArrayInt> d1=DataArrayInt::New();
770 self->getReverseNodalConnectivity(d0,d1);
771 PyObject *ret=PyTuple_New(2);
772 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
773 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
777 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
780 int v0; std::vector<int> v1;
781 const int *ids(convertIntStarLikePyObjToCppIntStar(li,sw,sz,v0,v1));
782 self->renumberCells(ids,check);
785 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
787 DataArrayInt *cellCor, *nodeCor;
788 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
789 PyObject *res = PyList_New(2);
790 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
791 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
795 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
797 DataArrayInt *cellCor=0,*nodeCor=0;
798 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
799 PyObject *res = PyList_New(2);
800 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
801 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
805 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
807 DataArrayInt *cellCor=0;
808 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
812 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
815 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
816 if (!SWIG_IsOK(res1))
819 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
820 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
824 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
826 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
827 da2->checkAllocated();
828 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
831 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
833 std::vector<int> conn;
834 self->getNodeIdsOfCell(cellId,conn);
835 return convertIntArrToPyList2(conn);
838 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
840 std::vector<double> coo;
841 self->getCoordinatesOfNode(nodeId,coo);
842 return convertDblArrToPyList2(coo);
845 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
849 DataArrayDoubleTuple *aa;
850 std::vector<double> bb;
852 int spaceDim=self->getSpaceDimension();
853 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
854 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
855 self->scale(pointPtr,factor);
858 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
860 int spaceDim=self->getSpaceDimension();
861 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
862 self->getBoundingBox(tmp);
863 PyObject *ret=convertDblArrToPyListOfTuple<double>(tmp,2,spaceDim);
867 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
870 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
871 PyObject *ret=PyTuple_New(2);
872 PyObject *ret0Py=ret0?Py_True:Py_False;
874 PyTuple_SetItem(ret,0,ret0Py);
875 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
879 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
881 int szArr,sw,iTypppArr;
882 std::vector<int> stdvecTyyppArr;
883 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
884 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
885 if(sw==3)//DataArrayInt
887 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
888 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
889 std::string name=argpt->getName();
891 ret->setName(name.c_str());
893 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
896 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
898 int szArr,sw,iTypppArr;
899 std::vector<int> stdvecTyyppArr;
901 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
902 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
903 if(sw==3)//DataArrayInt
905 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
906 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
907 std::string name=argpt->getName();
909 ret->setName(name.c_str());
912 PyObject *res = PyList_New(2);
913 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
914 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
915 PyList_SetItem(res,0,obj0);
916 PyList_SetItem(res,1,obj1);
920 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
924 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
925 PyObject *res = PyTuple_New(2);
926 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
929 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
931 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
932 PyTuple_SetItem(res,0,obj0);
933 PyTuple_SetItem(res,1,obj1);
937 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
939 std::vector<int> vals=self->getDistributionOfTypes();
941 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
942 PyObject *ret=PyList_New((int)vals.size()/3);
943 for(int j=0;j<(int)vals.size()/3;j++)
945 PyObject *ret1=PyList_New(3);
946 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
947 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
948 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
949 PyList_SetItem(ret,j,ret1);
954 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
956 std::vector<int> code;
957 std::vector<const DataArrayInt *> idsPerType;
958 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
959 convertPyToNewIntArr4(li,1,3,code);
960 return self->checkTypeConsistencyAndContig(code,idsPerType);
963 PyObject *splitProfilePerType(const DataArrayInt *profile, bool smartPflKiller=true) const throw(INTERP_KERNEL::Exception)
965 std::vector<int> code;
966 std::vector<DataArrayInt *> idsInPflPerType;
967 std::vector<DataArrayInt *> idsPerType;
968 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType,smartPflKiller);
969 PyObject *ret=PyTuple_New(3);
972 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
973 PyObject *ret0=PyList_New((int)code.size()/3);
974 for(int j=0;j<(int)code.size()/3;j++)
976 PyObject *ret00=PyList_New(3);
977 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
978 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
979 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
980 PyList_SetItem(ret0,j,ret00);
982 PyTuple_SetItem(ret,0,ret0);
984 PyObject *ret1=PyList_New(idsInPflPerType.size());
985 for(std::size_t j=0;j<idsInPflPerType.size();j++)
986 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
987 PyTuple_SetItem(ret,1,ret1);
988 int n=idsPerType.size();
989 PyObject *ret2=PyList_New(n);
991 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
992 PyTuple_SetItem(ret,2,ret2);
996 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
1000 DataArrayDoubleTuple *aa;
1001 std::vector<double> bb;
1003 int spaceDim=self->getSpaceDimension();
1004 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1005 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1006 self->translate(vectorPtr);
1009 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
1011 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1014 DataArrayDoubleTuple *aa;
1015 std::vector<double> bb;
1017 int spaceDim=self->getSpaceDimension();
1018 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1019 self->rotate(centerPtr,0,alpha);
1022 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
1024 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1026 DataArrayDouble *a,*a2;
1027 DataArrayDoubleTuple *aa,*aa2;
1028 std::vector<double> bb,bb2;
1030 int spaceDim=self->getSpaceDimension();
1031 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1032 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
1033 self->rotate(centerPtr,vectorPtr,alpha);
1036 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1038 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1039 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1040 PyObject *res=PyList_New(result.size());
1041 for(int i=0;iL!=result.end(); i++, iL++)
1042 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1046 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
1048 std::vector<double> a0;
1049 std::vector<int> a1;
1050 std::vector<std::string> a2;
1051 self->getTinySerializationInformation(a0,a1,a2);
1052 PyObject *ret(PyTuple_New(3));
1053 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1054 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1056 PyObject *ret2(PyList_New(sz));
1058 for(int i=0;i<sz;i++)
1059 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1061 PyTuple_SetItem(ret,2,ret2);
1065 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1067 DataArrayInt *a0Tmp(0);
1068 DataArrayDouble *a1Tmp(0);
1069 self->serialize(a0Tmp,a1Tmp);
1070 PyObject *ret(PyTuple_New(2));
1071 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1072 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1076 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1078 std::vector<std::string> littleStrings;
1079 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1082 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1084 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1085 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1086 PyObject *ret(PyTuple_New(2));
1087 PyTuple_SetItem(ret,0,ret0);
1088 PyTuple_SetItem(ret,1,ret1);
1092 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1094 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1095 if(!PyTuple_Check(inp))
1096 throw INTERP_KERNEL::Exception(MSG);
1097 int sz(PyTuple_Size(inp));
1099 throw INTERP_KERNEL::Exception(MSG);
1100 PyObject *elt0(PyTuple_GetItem(inp,0));
1101 PyObject *elt1(PyTuple_GetItem(inp,1));
1102 std::vector<double> a0;
1103 std::vector<int> a1;
1104 std::vector<std::string> a2;
1105 DataArrayInt *b0(0);
1106 DataArrayDouble *b1(0);
1108 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1109 throw INTERP_KERNEL::Exception(MSG);
1110 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1112 fillArrayWithPyListDbl3(a0py,tmp,a0);
1113 convertPyToNewIntArr3(a1py,a1);
1114 fillStringVector(a2py,a2);
1117 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1118 throw INTERP_KERNEL::Exception(MSG);
1119 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1121 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1122 if(!SWIG_IsOK(status))
1123 throw INTERP_KERNEL::Exception(MSG);
1124 b0=reinterpret_cast<DataArrayInt *>(argp);
1125 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1126 if(!SWIG_IsOK(status))
1127 throw INTERP_KERNEL::Exception(MSG);
1128 b1=reinterpret_cast<DataArrayDouble *>(argp);
1130 // useless here to call resizeForUnserialization because arrays are well resized.
1131 self->unserialization(a0,a1,b0,b1,a2);
1134 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1136 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1137 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1138 return MEDCouplingMesh::MergeMeshes(tmp);
1144 //== MEDCouplingMesh End
1146 %include "NormalizedGeometricTypes"
1147 %include "MEDCouplingNatureOfFieldEnum"
1149 namespace MEDCoupling
1151 class MEDCouplingNatureOfField
1154 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1155 static std::string GetReprNoThrow(NatureOfField nat);
1156 static std::string GetAllPossibilitiesStr();
1160 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1161 // include "MEDCouplingTimeDiscretization.i"
1163 namespace MEDCoupling
1165 class MEDCouplingGaussLocalization
1168 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1169 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1170 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1171 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1172 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1173 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1174 int getDimension() const throw(INTERP_KERNEL::Exception);
1175 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1176 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1177 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1178 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1180 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1181 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1182 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1183 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1184 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1185 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1186 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1187 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1188 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1189 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1190 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1191 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1193 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1197 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const throw(INTERP_KERNEL::Exception)
1199 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1203 MEDCouplingUMesh *buildRefCell() const throw(INTERP_KERNEL::Exception)
1205 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1211 class MEDCouplingSkyLineArray
1214 static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayInt* c, const DataArrayInt* cI ) throw(INTERP_KERNEL::Exception);
1216 void set( DataArrayInt* index, DataArrayInt* value );
1217 void set3( DataArrayInt* superIndex, DataArrayInt* index, DataArrayInt* value );
1219 int getSuperNumberOf() const;
1220 int getNumberOf() const;
1221 int getLength() const;
1223 void deletePack(const int i, const int j) throw(INTERP_KERNEL::Exception);
1225 void deleteSimplePack(const int i) throw(INTERP_KERNEL::Exception);
1226 void deleteSimplePacks(const DataArrayInt* idx) throw(INTERP_KERNEL::Exception);
1230 MEDCouplingSkyLineArray() throw(INTERP_KERNEL::Exception)
1232 return MEDCouplingSkyLineArray::New();
1235 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value) throw(INTERP_KERNEL::Exception)
1237 return MEDCouplingSkyLineArray::New(index, value);
1240 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value ) throw(INTERP_KERNEL::Exception)
1242 return MEDCouplingSkyLineArray::New(index, value);
1245 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other ) throw(INTERP_KERNEL::Exception)
1247 return MEDCouplingSkyLineArray::New(other);
1250 std::string __str__() const throw(INTERP_KERNEL::Exception)
1252 return self->simpleRepr();
1255 DataArrayInt *getSuperIndexArray() const
1257 DataArrayInt *ret(self->getSuperIndexArray());
1263 DataArrayInt *getIndexArray() const
1265 DataArrayInt *ret(self->getIndexArray());
1271 DataArrayInt *getValuesArray() const
1273 DataArrayInt *ret(self->getValuesArray());
1279 PyObject *getSimplePackSafe(int absolutePackId) const throw(INTERP_KERNEL::Exception)
1281 std::vector<int> ret;
1282 self->getSimplePackSafe(absolutePackId,ret);
1283 return convertIntArrToPyList2(ret);
1286 PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const throw(INTERP_KERNEL::Exception)
1288 std::vector<int> vpack, vspIdx, out;
1290 convertPyToNewIntArr3(superPackIndices,vspIdx);
1291 convertPyToNewIntArr3(pack,vpack);
1293 self->findPackIds(vspIdx, vpack.data(), vpack.data()+vpack.size(), out);
1294 return convertIntArrToPyList2(out);
1297 void pushBackPack(const int i, PyObject *pack) throw(INTERP_KERNEL::Exception)
1299 std::vector<int> vpack;
1300 convertPyToNewIntArr3(pack,vpack);
1301 self->pushBackPack(i,vpack.data(), vpack.data()+vpack.size());
1304 void replaceSimplePack(const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1306 std::vector<int> vpack;
1307 convertPyToNewIntArr3(pack,vpack);
1308 self->replaceSimplePack(idx, vpack.data(), vpack.data()+vpack.size());
1311 void replaceSimplePacks(const DataArrayInt* idx, PyObject *listePacks) throw(INTERP_KERNEL::Exception)
1313 std::vector<const DataArrayInt*> packs;
1314 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt*>(listePacks,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",packs);
1315 self->replaceSimplePacks(idx, packs);
1318 void replacePack(const int superIdx, const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1320 std::vector<int> vpack;
1321 convertPyToNewIntArr3(pack,vpack);
1322 self->replacePack(superIdx, idx, vpack.data(), vpack.data()+vpack.size());
1325 PyObject *convertToPolyhedronConn() const throw(INTERP_KERNEL::Exception)
1327 MCAuto<DataArrayInt> d0=DataArrayInt::New();
1328 MCAuto<DataArrayInt> d1=DataArrayInt::New();
1329 self->convertToPolyhedronConn(d0,d1);
1330 PyObject *ret=PyTuple_New(2);
1331 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1332 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1339 %include "MEDCouplingFieldDiscretization.i"
1341 //== MEDCouplingPointSet
1343 namespace MEDCoupling
1345 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1348 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1349 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1350 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1351 void zipCoords() throw(INTERP_KERNEL::Exception);
1352 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1353 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1354 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1355 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1356 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1357 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1358 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1359 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1360 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1361 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1362 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1363 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1364 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1365 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1366 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1367 virtual DataArrayInt *findBoundaryNodes() const;
1368 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1369 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1370 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1371 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1372 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1373 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1374 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1375 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1376 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1377 virtual void invertOrientationOfAllCells() throw(INTERP_KERNEL::Exception);
1380 std::string __str__() const throw(INTERP_KERNEL::Exception)
1382 return self->simpleRepr();
1385 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1388 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1389 PyObject *res = PyList_New(2);
1390 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1391 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1395 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1397 DataArrayInt *comm, *commIndex;
1398 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1399 PyObject *res = PyList_New(2);
1400 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1401 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1405 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1407 DataArrayDouble *ret1=self->getCoords();
1410 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1413 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1415 int szArr,sw,iTypppArr;
1416 std::vector<int> stdvecTyyppArr;
1417 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1418 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1419 if(sw==3)//DataArrayInt
1421 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1422 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1423 std::string name=argpt->getName();
1425 ret->setName(name.c_str());
1427 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1430 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1432 int szArr,sw,iTypppArr;
1433 std::vector<int> stdvecTyyppArr;
1434 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1435 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1436 if(sw==3)//DataArrayInt
1438 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1439 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1440 std::string name=argpt->getName();
1442 ret->setName(name.c_str());
1444 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1447 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1449 int szArr,sw,iTypppArr;
1450 std::vector<int> stdvecTyyppArr;
1451 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1452 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1453 if(sw==3)//DataArrayInt
1455 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1456 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1457 std::string name=argpt->getName();
1459 ret->setName(name.c_str());
1461 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1464 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1466 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1467 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1470 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1472 int szArr,sw,iTypppArr;
1473 std::vector<int> stdvecTyyppArr;
1474 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1475 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1476 if(sw==3)//DataArrayInt
1478 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1479 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1480 std::string name=argpt->getName();
1482 ret->setName(name.c_str());
1484 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1487 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1489 int szArr,sw,iTypppArr;
1490 std::vector<int> stdvecTyyppArr;
1491 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1492 self->renumberNodes(tmp,newNbOfNodes);
1495 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1497 int szArr,sw,iTypppArr;
1498 std::vector<int> stdvecTyyppArr;
1499 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1500 self->renumberNodesCenter(tmp,newNbOfNodes);
1503 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1505 int spaceDim=self->getSpaceDimension();
1507 DataArrayDouble *a,*a2;
1508 DataArrayDoubleTuple *aa,*aa2;
1509 std::vector<double> bb,bb2;
1511 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st parameter for point.";
1512 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd parameter for vector.";
1513 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1514 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1515 std::vector<int> nodes;
1516 self->findNodesOnLine(p,v,eps,nodes);
1517 DataArrayInt *ret=DataArrayInt::New();
1518 ret->alloc((int)nodes.size(),1);
1519 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1520 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1522 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1524 int spaceDim=self->getSpaceDimension();
1526 DataArrayDouble *a,*a2;
1527 DataArrayDoubleTuple *aa,*aa2;
1528 std::vector<double> bb,bb2;
1530 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st parameter for point.";
1531 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd parameter for vector.";
1532 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1533 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1534 std::vector<int> nodes;
1535 self->findNodesOnPlane(p,v,eps,nodes);
1536 DataArrayInt *ret=DataArrayInt::New();
1537 ret->alloc((int)nodes.size(),1);
1538 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1539 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1542 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1546 DataArrayDoubleTuple *aa;
1547 std::vector<double> bb;
1549 int spaceDim=self->getSpaceDimension();
1550 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1551 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1552 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1553 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1556 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1558 DataArrayInt *c=0,*cI=0;
1562 DataArrayDoubleTuple *aa;
1563 std::vector<double> bb;
1565 int spaceDim=self->getSpaceDimension();
1566 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1567 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1568 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1569 PyObject *ret=PyTuple_New(2);
1570 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1571 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1575 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1577 DataArrayInt *c=0,*cI=0;
1578 int spaceDim=self->getSpaceDimension();
1581 DataArrayDoubleTuple *aa;
1582 std::vector<double> bb;
1585 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1586 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1588 PyObject *ret=PyTuple_New(2);
1589 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1590 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1594 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1598 DataArrayDoubleTuple *aa;
1599 std::vector<double> bb;
1601 int spaceDim=self->getSpaceDimension();
1602 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1603 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1605 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1606 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1609 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1613 std::vector<int> multiVal;
1614 std::pair<int, std::pair<int,int> > slic;
1615 MEDCoupling::DataArrayInt *daIntTyypp=0;
1616 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1620 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1622 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1624 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1626 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1630 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1632 DataArrayInt *v0(nullptr),*v1(nullptr);
1633 self->findCommonCells(compType,startCellId,v0,v1);
1634 PyObject *res = PyList_New(2);
1635 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1636 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1641 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1645 int res1(SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__MapII, 0 | 0 ));
1648 MapII *da2(reinterpret_cast<MapII *>(da));
1649 self->renumberNodesInConn(da2->data());
1653 int res1(SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 ));
1654 if (!SWIG_IsOK(res1))
1657 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1658 self->renumberNodesInConn(tmp);
1662 DataArrayInt *da2(reinterpret_cast< DataArrayInt * >(da));
1664 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1665 da2->checkAllocated();
1666 self->renumberNodesInConn(da2->getConstPointer());
1670 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1673 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1674 PyObject *ret=PyTuple_New(2);
1675 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1676 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1680 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1682 DataArrayInt *ret(nullptr);
1684 int szArr,sw,iTypppArr;
1685 std::vector<int> stdvecTyyppArr;
1686 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1687 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1691 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1695 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1696 PyObject *res = PyList_New(3);
1697 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1698 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1699 PyList_SetItem(res,2,SWIG_From_int(ret2));
1703 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1707 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1708 PyObject *res = PyList_New(3);
1709 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1710 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1711 PyList_SetItem(res,2,SWIG_From_int(ret2));
1715 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1718 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1719 if (!SWIG_IsOK(res1))
1722 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1723 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1727 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1729 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1730 da2->checkAllocated();
1731 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1735 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1739 std::vector<int> multiVal;
1740 std::pair<int, std::pair<int,int> > slic;
1741 MEDCoupling::DataArrayInt *daIntTyypp=0;
1742 int nbc=self->getNumberOfCells();
1743 convertIntStarOrSliceLikePyObjToCpp(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1750 std::ostringstream oss;
1751 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1752 throw INTERP_KERNEL::Exception(oss.str().c_str());
1755 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1760 int tmp=nbc+singleVal;
1761 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1765 std::ostringstream oss;
1766 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1767 throw INTERP_KERNEL::Exception(oss.str().c_str());
1773 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1777 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1782 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1783 daIntTyypp->checkAllocated();
1784 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1787 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1791 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1794 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1795 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1796 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1797 for(int i=0;i<sz;i++)
1798 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1801 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1804 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1806 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1807 std::vector<double> val3;
1808 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1809 "Rotate2DAlg",2,true,nbNodes);
1811 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1812 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1815 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1818 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1819 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1820 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1821 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1822 for(int i=0;i<sz;i++)
1823 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1826 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1829 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1831 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1832 std::vector<double> val3;
1833 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1834 "Rotate3DAlg",3,true,nbNodes);
1836 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1837 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1838 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1843 //== MEDCouplingPointSet End
1845 class MEDCouplingUMeshCell
1848 INTERP_KERNEL::NormalizedCellType getType() const;
1851 std::string __str__() const throw(INTERP_KERNEL::Exception)
1853 return self->repr();
1856 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1859 const int *r=self->getAllConn(ret2);
1860 PyObject *ret=PyTuple_New(ret2);
1861 for(int i=0;i<ret2;i++)
1862 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1868 class MEDCouplingUMeshCellIterator
1875 MEDCouplingUMeshCell *ret=self->nextt();
1877 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1880 PyErr_SetString(PyExc_StopIteration,"No more data.");
1887 class MEDCouplingUMeshCellByTypeIterator
1890 ~MEDCouplingUMeshCellByTypeIterator();
1895 MEDCouplingUMeshCellEntry *ret=self->nextt();
1897 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1900 PyErr_SetString(PyExc_StopIteration,"No more data.");
1907 class MEDCouplingUMeshCellByTypeEntry
1910 ~MEDCouplingUMeshCellByTypeEntry();
1913 MEDCouplingUMeshCellByTypeIterator *__iter__()
1915 return self->iterator();
1920 class MEDCouplingUMeshCellEntry
1923 INTERP_KERNEL::NormalizedCellType getType() const;
1924 int getNumberOfElems() const;
1927 MEDCouplingUMeshCellIterator *__iter__()
1929 return self->iterator();
1934 //== MEDCouplingUMesh
1936 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1939 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1940 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1941 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1942 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1943 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1944 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1945 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1946 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1947 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1948 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1949 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1950 void computeTypes() throw(INTERP_KERNEL::Exception);
1951 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1952 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1954 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1955 DataArrayInt *conformize3D(double eps) throw(INTERP_KERNEL::Exception);
1956 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1957 DataArrayInt *colinearizeKeepingConform2D(double eps) throw(INTERP_KERNEL::Exception);
1958 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1959 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1960 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1961 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1962 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1963 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1964 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1965 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1966 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1967 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1968 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1969 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1970 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1971 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1972 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1973 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1974 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1975 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1976 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1977 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1978 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1979 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1980 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1981 DataArrayInt *convertDegeneratedCellsAndRemoveFlatOnes() throw(INTERP_KERNEL::Exception);
1982 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1983 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1984 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1985 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1986 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1987 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1988 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1989 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1990 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1991 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1992 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1993 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1994 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1995 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1996 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1997 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1998 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1999 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
2000 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
2001 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
2002 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);
2003 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
2004 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2005 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2006 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
2007 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
2009 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
2011 return MEDCouplingUMesh::New();
2014 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
2016 return MEDCouplingUMesh::New(meshName,meshDim);
2019 std::string __str__() const throw(INTERP_KERNEL::Exception)
2021 return self->simpleRepr();
2024 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2026 std::ostringstream oss;
2027 self->reprQuickOverview(oss);
2031 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
2033 return self->cellIterator();
2036 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
2038 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
2042 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
2044 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
2045 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2046 PyObject *res=PyList_New(result.size());
2047 for(int i=0;iL!=result.end(); i++, iL++)
2048 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2052 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2056 std::vector<int> multiVal;
2057 std::pair<int, std::pair<int,int> > slic;
2058 MEDCoupling::DataArrayInt *daIntTyypp=0;
2059 int nbc=self->getNumberOfCells();
2060 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2067 std::ostringstream oss;
2068 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2069 throw INTERP_KERNEL::Exception(oss.str().c_str());
2073 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2080 int tmp=nbc+singleVal;
2081 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2086 std::ostringstream oss;
2087 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2088 throw INTERP_KERNEL::Exception(oss.str().c_str());
2094 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2100 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2101 daIntTyypp->checkAllocated();
2102 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2106 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
2110 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2114 std::vector<int> multiVal;
2115 std::pair<int, std::pair<int,int> > slic;
2116 MEDCoupling::DataArrayInt *daIntTyypp=0;
2117 int nbc=self->getNumberOfCells();
2118 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2125 std::ostringstream oss;
2126 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2127 throw INTERP_KERNEL::Exception(oss.str().c_str());
2131 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2138 int tmp=nbc+singleVal;
2139 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2144 std::ostringstream oss;
2145 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2146 throw INTERP_KERNEL::Exception(oss.str().c_str());
2152 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2157 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2163 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2164 daIntTyypp->checkAllocated();
2165 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2169 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2173 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2175 int szArr,sw,iTypppArr;
2176 std::vector<int> stdvecTyyppArr;
2177 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2180 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2181 throw INTERP_KERNEL::Exception(oss.str().c_str());
2183 self->insertNextCell(type,size,tmp);
2186 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2188 int szArr,sw,iTypppArr;
2189 std::vector<int> stdvecTyyppArr;
2190 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2191 self->insertNextCell(type,szArr,tmp);
2194 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2196 DataArrayInt *ret=self->getNodalConnectivity();
2201 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2203 DataArrayInt *ret=self->getNodalConnectivityIndex();
2209 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2211 int szArr,sw,iTypppArr;
2212 std::vector<int> stdvecTyyppArr;
2213 const int *seedPtr=convertIntStarLikePyObjToCppIntStar(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2214 int nbOfDepthPeelingPerformed=0;
2215 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2216 PyObject *res=PyTuple_New(2);
2217 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2218 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2222 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2224 DataArrayInt *v0=0,*v1=0;
2225 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2226 PyObject *res = PyList_New(2);
2227 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2228 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2232 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2236 DataArrayDoubleTuple *aa;
2237 std::vector<double> bb;
2239 int nbOfCompo=self->getSpaceDimension();
2240 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2243 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2244 PyObject *ret=PyTuple_New(2);
2245 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2246 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2250 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2252 DataArrayInt *ret1=0;
2253 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2254 PyObject *ret=PyTuple_New(2);
2255 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2256 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2260 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2263 DataArrayInt *ret1(0);
2264 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2265 PyObject *ret=PyTuple_New(3);
2266 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2267 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2268 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2272 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2274 std::vector<int> cells;
2275 self->checkButterflyCells(cells,eps);
2276 DataArrayInt *ret=DataArrayInt::New();
2277 ret->alloc((int)cells.size(),1);
2278 std::copy(cells.begin(),cells.end(),ret->getPointer());
2279 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2282 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2284 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2286 PyObject *ret = PyList_New(sz);
2287 for(int i=0;i<sz;i++)
2288 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2292 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2294 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2295 int sz=retCpp.size();
2296 PyObject *ret=PyList_New(sz);
2297 for(int i=0;i<sz;i++)
2298 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2302 static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2304 std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2305 int sz=retCpp.size();
2306 PyObject *ret=PyList_New(sz);
2307 for(int i=0;i<sz;i++)
2308 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2312 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2315 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2316 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2317 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2320 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2323 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2324 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2328 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2331 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2332 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2336 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2338 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2339 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2340 PyObject *ret=PyTuple_New(3);
2341 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2342 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2343 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2347 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2349 DataArrayInt *tmp0=0,*tmp1=0;
2350 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2351 PyObject *ret=PyTuple_New(2);
2352 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2353 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2357 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2361 std::vector<int> multiVal;
2362 std::pair<int, std::pair<int,int> > slic;
2363 MEDCoupling::DataArrayInt *daIntTyypp=0;
2364 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2368 return self->duplicateNodes(&singleVal,&singleVal+1);
2370 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2372 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2374 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2378 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2382 std::vector<int> multiVal;
2383 std::pair<int, std::pair<int,int> > slic;
2384 MEDCoupling::DataArrayInt *daIntTyypp=0;
2385 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2389 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2391 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2393 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2395 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2399 void attractSeg3MidPtsAroundNodes(double ratio, PyObject *nodeIds) throw(INTERP_KERNEL::Exception)
2401 int szArr,sw,iTypppArr;
2402 std::vector<int> stdvecTyyppArr;
2403 const int *nodeIdsPtr(convertIntStarLikePyObjToCppIntStar(nodeIds,sw,szArr,iTypppArr,stdvecTyyppArr));
2404 self->attractSeg3MidPtsAroundNodes(ratio,nodeIdsPtr,nodeIdsPtr+szArr);
2407 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2410 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2411 DataArrayInt *tmp0,*tmp1=0;
2412 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2413 PyObject *ret=PyTuple_New(2);
2414 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2415 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2419 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2421 DataArrayInt *ret0=0,*ret1=0;
2422 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2423 PyObject *ret=PyTuple_New(2);
2424 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2425 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2429 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2431 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2432 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2433 DataArrayInt *ret1=0,*ret2=0;
2434 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2435 PyObject *ret=PyTuple_New(3);
2436 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2437 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2438 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2442 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2444 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2445 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2446 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2447 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2450 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2453 std::vector<const MEDCouplingUMesh *> meshes;
2454 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2455 std::vector<DataArrayInt *> corr;
2456 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2458 PyObject *ret1=PyList_New(sz);
2459 for(int i=0;i<sz;i++)
2460 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2461 PyObject *ret=PyList_New(2);
2462 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2463 PyList_SetItem(ret,1,ret1);
2467 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2469 std::vector<MEDCouplingUMesh *> meshes;
2470 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2471 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2474 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2476 std::vector<MEDCouplingUMesh *> meshes;
2477 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2478 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2481 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2485 std::vector<int> multiVal;
2486 std::pair<int, std::pair<int,int> > slic;
2487 MEDCoupling::DataArrayInt *daIntTyypp=0;
2489 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2490 convertIntStarOrSliceLikePyObjToCpp(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2494 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2496 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2498 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2500 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2504 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2506 DataArrayInt *arrOut=0,*arrIndexOut=0;
2509 std::vector<int> multiVal;
2510 std::pair<int, std::pair<int,int> > slic;
2511 MEDCoupling::DataArrayInt *daIntTyypp=0;
2513 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2514 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2519 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2524 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2529 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2533 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2535 PyObject *ret=PyTuple_New(2);
2536 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2537 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2541 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2543 DataArrayInt *arrOut=0,*arrIndexOut=0;
2544 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2545 PyObject *ret=PyTuple_New(2);
2546 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2547 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2551 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2553 if(!PySlice_Check(slic))
2554 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2555 Py_ssize_t strt=2,stp=2,step=2;
2557 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2558 arrIndxIn->checkAllocated();
2559 if(arrIndxIn->getNumberOfComponents()!=1)
2560 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2561 GetIndicesOfSlice(slic,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2562 DataArrayInt *arrOut=0,*arrIndexOut=0;
2563 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2564 PyObject *ret=PyTuple_New(2);
2565 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2566 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2570 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2571 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2572 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2574 DataArrayInt *arrOut=0,*arrIndexOut=0;
2577 std::vector<int> multiVal;
2578 std::pair<int, std::pair<int,int> > slic;
2579 MEDCoupling::DataArrayInt *daIntTyypp=0;
2581 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2582 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2587 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2592 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2597 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2601 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2603 PyObject *ret=PyTuple_New(2);
2604 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2605 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2609 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2610 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2614 std::vector<int> multiVal;
2615 std::pair<int, std::pair<int,int> > slic;
2616 MEDCoupling::DataArrayInt *daIntTyypp=0;
2618 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2619 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2624 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2629 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2634 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2638 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2642 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2646 DataArrayDoubleTuple *aa;
2647 std::vector<double> bb;
2649 int spaceDim=self->getSpaceDimension();
2650 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2651 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2653 std::vector<int> cells;
2654 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2655 DataArrayInt *ret=DataArrayInt::New();
2656 ret->alloc((int)cells.size(),1);
2657 std::copy(cells.begin(),cells.end(),ret->getPointer());
2658 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2661 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2665 DataArrayDoubleTuple *aa;
2666 std::vector<double> bb;
2668 int spaceDim=self->getSpaceDimension();
2669 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2670 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2671 self->orientCorrectly2DCells(v,polyOnly);
2674 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2676 std::vector<int> cells;
2677 self->arePolyhedronsNotCorrectlyOriented(cells);
2678 DataArrayInt *ret=DataArrayInt::New();
2679 ret->alloc((int)cells.size(),1);
2680 std::copy(cells.begin(),cells.end(),ret->getPointer());
2681 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2684 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2688 self->getFastAveragePlaneOfThis(vec,pos);
2690 std::copy(vec,vec+3,vals);
2691 std::copy(pos,pos+3,vals+3);
2692 return convertDblArrToPyListOfTuple<double>(vals,3,2);
2695 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2697 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2698 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2699 return MEDCouplingUMesh::MergeUMeshes(tmp);
2702 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2705 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2706 PyObject *ret=PyTuple_New(2);
2707 PyObject *ret0Py=ret0?Py_True:Py_False;
2709 PyTuple_SetItem(ret,0,ret0Py);
2710 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2714 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2717 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2718 PyObject *ret=PyTuple_New(2);
2719 PyObject *ret0Py=ret0?Py_True:Py_False;
2721 PyTuple_SetItem(ret,0,ret0Py);
2722 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2726 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2728 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2729 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2730 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2731 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2732 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2733 PyObject *ret=PyTuple_New(5);
2734 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2735 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2736 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2737 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2738 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2742 PyObject *explodeIntoEdges() const throw(INTERP_KERNEL::Exception)
2744 MCAuto<DataArrayInt> desc,descIndex,revDesc,revDescIndx;
2745 MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2746 PyObject *ret=PyTuple_New(5);
2747 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2748 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2749 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2750 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2751 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2755 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2757 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2758 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2759 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2760 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2761 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2762 PyObject *ret=PyTuple_New(5);
2763 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2764 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2765 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2766 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2767 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2771 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2773 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2774 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2775 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2776 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2777 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2778 PyObject *ret=PyTuple_New(5);
2779 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2780 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2781 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2782 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2783 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2787 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2789 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2790 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2791 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2792 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2793 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2794 PyObject *ret=PyTuple_New(5);
2795 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2796 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2797 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2798 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2799 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2803 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2805 DataArrayInt *neighbors=0,*neighborsIdx=0;
2806 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2807 PyObject *ret=PyTuple_New(2);
2808 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2809 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2813 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2815 DataArrayInt *neighbors=0,*neighborsIdx=0;
2816 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2817 PyObject *ret=PyTuple_New(2);
2818 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2819 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2823 PyObject *computeEnlargedNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2825 MCAuto<DataArrayInt> neighbors,neighborsIdx;
2826 self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2827 PyObject *ret=PyTuple_New(2);
2828 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2829 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2833 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const throw(INTERP_KERNEL::Exception)
2835 MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
2836 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2837 PyObject *ret=PyTuple_New(2);
2838 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2839 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2843 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2845 DataArrayInt *neighbors=0,*neighborsIdx=0;
2846 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2847 PyObject *ret=PyTuple_New(2);
2848 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2849 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2853 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2855 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2856 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2857 DataArrayInt *d2,*d3,*d4,*dd5;
2858 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2859 PyObject *ret=PyTuple_New(7);
2860 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2861 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2862 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2863 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2864 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2865 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2866 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2870 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2873 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2874 da->checkAllocated();
2875 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2878 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2881 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2882 da->checkAllocated();
2883 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2886 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2889 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2890 da->checkAllocated();
2891 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2894 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2897 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2898 da->checkAllocated();
2899 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2900 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2901 PyObject *res = PyList_New(result.size());
2902 for (int i=0;iL!=result.end(); i++, iL++)
2903 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2907 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2910 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2911 da->checkAllocated();
2912 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2913 ret->setName(da->getName().c_str());
2917 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2919 DataArrayInt *cellNb1=0,*cellNb2=0;
2920 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2921 PyObject *ret=PyTuple_New(3);
2922 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2923 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2924 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2928 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2930 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2931 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2932 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2933 PyObject *ret(PyTuple_New(4));
2934 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2935 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2936 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2937 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2941 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2943 int spaceDim=self->getSpaceDimension();
2945 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2947 DataArrayDouble *a,*a2;
2948 DataArrayDoubleTuple *aa,*aa2;
2949 std::vector<double> bb,bb2;
2951 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st parameter for origin.";
2952 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd parameter for vector.";
2953 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2954 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2956 DataArrayInt *cellIds=0;
2957 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2958 PyObject *ret=PyTuple_New(2);
2959 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2960 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2964 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2966 int spaceDim=self->getSpaceDimension();
2968 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2970 DataArrayDouble *a,*a2;
2971 DataArrayDoubleTuple *aa,*aa2;
2972 std::vector<double> bb,bb2;
2974 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st parameter for origin.";
2975 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd parameter for vector.";
2976 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2977 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2979 DataArrayInt *cellIds=0;
2980 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2981 PyObject *ret=PyTuple_New(2);
2982 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2983 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2987 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2990 DataArrayDouble *a,*a2;
2991 DataArrayDoubleTuple *aa,*aa2;
2992 std::vector<double> bb,bb2;
2994 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st parameter for origin.";
2995 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd parameter for vector.";
2996 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2997 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2998 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
3002 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3004 int spaceDim=self->getSpaceDimension();
3006 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
3008 DataArrayDouble *a,*a2;
3009 DataArrayDoubleTuple *aa,*aa2;
3010 std::vector<double> bb,bb2;
3012 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st parameter for origin.";
3013 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd parameter for vector.";
3014 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3015 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3016 return self->getCellIdsCrossingPlane(orig,vect,eps);
3019 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
3023 std::vector<int> pos2;
3024 DataArrayInt *pos3=0;
3025 DataArrayIntTuple *pos4=0;
3026 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
3031 self->convertToPolyTypes(&pos1,&pos1+1);
3038 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
3043 self->convertToPolyTypes(pos3->begin(),pos3->end());
3047 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
3051 void convertAllToPoly();
3052 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
3053 bool unPolyze() throw(INTERP_KERNEL::Exception);
3054 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
3055 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
3056 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
3059 //== MEDCouplingUMesh End
3061 //== MEDCouplingMappedExtrudedMesh
3063 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
3066 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
3067 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
3068 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
3069 int get2DCellIdForExtrusion() const;
3071 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
3073 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3076 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
3078 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3081 MEDCouplingMappedExtrudedMesh()
3083 return MEDCouplingMappedExtrudedMesh::New();
3086 std::string __str__() const throw(INTERP_KERNEL::Exception)
3088 return self->simpleRepr();
3091 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3093 std::ostringstream oss;
3094 self->reprQuickOverview(oss);
3098 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
3100 MEDCouplingUMesh *ret=self->getMesh2D();
3103 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3105 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
3107 MEDCouplingUMesh *ret=self->getMesh1D();
3110 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3112 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
3114 DataArrayInt *ret=self->getMesh3DIds();
3117 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3122 //== MEDCouplingMappedExtrudedMesh End
3124 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3127 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3128 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3129 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
3130 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
3131 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
3132 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
3135 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
3137 int szArr,sw,iTypppArr;
3138 std::vector<int> stdvecTyyppArr;
3139 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3140 self->insertNextCell(tmp,tmp+szArr);
3143 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3145 DataArrayInt *ret=self->getNodalConnectivity();
3146 if(ret) ret->incrRef();
3150 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3152 std::vector< const MEDCoupling1GTUMesh *> parts;
3153 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3154 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3159 //== MEDCoupling1SGTUMesh
3161 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3164 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3165 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3166 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
3167 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
3168 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
3169 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3170 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
3171 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
3172 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
3175 MEDCoupling1SGTUMesh()
3177 return MEDCoupling1SGTUMesh::New();
3180 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3182 return MEDCoupling1SGTUMesh::New(name,type);
3185 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3187 return MEDCoupling1SGTUMesh::New(m);
3190 std::string __str__() const throw(INTERP_KERNEL::Exception)
3192 return self->simpleRepr();
3195 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3197 std::ostringstream oss;
3198 self->reprQuickOverview(oss);
3202 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3204 DataArrayInt *cellPerm(0),*nodePerm(0);
3205 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3206 PyObject *ret(PyTuple_New(3));
3207 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3208 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3209 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3213 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3215 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3216 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3217 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3220 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3222 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3223 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3224 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3229 //== MEDCoupling1SGTUMesh End
3231 //== MEDCoupling1DGTUMesh
3233 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3236 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3237 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3238 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3239 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3240 bool isPacked() const throw(INTERP_KERNEL::Exception);
3243 MEDCoupling1DGTUMesh()
3245 return MEDCoupling1DGTUMesh::New();
3247 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3249 return MEDCoupling1DGTUMesh::New(name,type);
3252 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3254 return MEDCoupling1DGTUMesh::New(m);
3257 std::string __str__() const throw(INTERP_KERNEL::Exception)
3259 return self->simpleRepr();
3262 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3264 std::ostringstream oss;
3265 self->reprQuickOverview(oss);
3269 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3271 DataArrayInt *ret=self->getNodalConnectivityIndex();
3272 if(ret) ret->incrRef();
3276 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3278 DataArrayInt *ret1=0,*ret2=0;
3279 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3280 PyObject *ret0Py=ret0?Py_True:Py_False;
3282 PyObject *ret=PyTuple_New(3);
3283 PyTuple_SetItem(ret,0,ret0Py);
3284 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3285 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3289 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3292 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3293 PyObject *ret=PyTuple_New(2);
3294 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3295 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3296 PyTuple_SetItem(ret,1,ret1Py);
3300 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3302 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3303 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3304 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3307 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3309 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3310 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3311 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3314 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3316 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3317 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3318 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3323 //== MEDCoupling1DGTUMeshEnd
3325 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3328 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3329 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3330 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3331 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3332 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3333 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3334 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3335 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3336 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3337 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3338 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3339 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3340 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3341 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3342 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3345 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3347 int tmpp1=-1,tmpp2=-1;
3348 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3349 std::vector< std::pair<int,int> > inp;
3353 for(int i=0;i<tmpp1;i++)
3354 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3359 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3360 inp.resize(tmpp1/2);
3361 for(int i=0;i<tmpp1/2;i++)
3362 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3365 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3366 return self->buildStructuredSubPart(inp);
3369 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3371 std::vector< std::pair<int,int> > inp;
3372 convertPyToVectorPairInt(part,inp);
3374 int szArr,sw,iTypppArr;
3375 std::vector<int> stdvecTyyppArr;
3376 const int *tmp4=convertIntStarLikePyObjToCppIntStar(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3377 std::vector<int> tmp5(tmp4,tmp4+szArr);
3379 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3382 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3384 std::vector< std::pair<int,int> > inp;
3385 convertPyToVectorPairInt(part,inp);
3386 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3389 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3391 std::vector< std::pair<int,int> > inp;
3392 convertPyToVectorPairInt(part,inp);
3393 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3396 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3398 std::vector< std::pair<int,int> > inp;
3399 convertPyToVectorPairInt(part,inp);
3400 std::vector<int> stWithGhost;
3401 std::vector< std::pair<int,int> > partWithGhost;
3402 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3403 PyObject *ret(PyTuple_New(2));
3404 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3405 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3409 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3411 std::vector< std::pair<int,int> > inp;
3412 convertPyToVectorPairInt(partCompactFormat,inp);
3413 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3416 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3418 std::vector< std::pair<int,int> > inp;
3419 convertPyToVectorPairInt(partCompactFormat,inp);
3420 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3423 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3425 std::vector< std::pair<int,int> > inp;
3426 convertPyToVectorPairInt(part,inp);
3427 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3430 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3432 int szArr,sw,iTypppArr;
3433 std::vector<int> stdvecTyyppArr;
3434 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3435 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3438 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3440 int szArr,sw,iTypppArr;
3441 std::vector<int> stdvecTyyppArr;
3442 const int *tmp(convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3443 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3446 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3448 std::vector< std::pair<int,int> > inp;
3449 convertPyToVectorPairInt(partCompactFormat,inp);
3450 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3453 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3455 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3456 PyObject *retPy=PyList_New(ret.size());
3457 for(std::size_t i=0;i<ret.size();i++)
3459 PyObject *tmp=PyTuple_New(2);
3460 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3461 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3462 PyList_SetItem(retPy,i,tmp);
3467 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3469 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3470 convertPyToVectorPairInt(r1,r1Cpp);
3471 convertPyToVectorPairInt(r2,r2Cpp);
3472 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3473 PyObject *retPy=PyList_New(ret.size());
3474 for(std::size_t i=0;i<ret.size();i++)
3476 PyObject *tmp=PyTuple_New(2);
3477 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3478 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3479 PyList_SetItem(retPy,i,tmp);
3484 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3486 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3487 convertPyToVectorPairInt(r1,r1Cpp);
3488 convertPyToVectorPairInt(r2,r2Cpp);
3489 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3492 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3494 int szArr,sw,iTypppArr;
3495 std::vector<int> stdvecTyyppArr;
3496 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3497 int szArr2,sw2,iTypppArr2;
3498 std::vector<int> stdvecTyyppArr2;
3499 const int *tmp2=convertIntStarLikePyObjToCppIntStar(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3500 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3501 std::vector< std::pair<int,int> > partCompactFormat;
3502 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3503 PyObject *ret=PyTuple_New(2);
3504 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3505 PyTuple_SetItem(ret,0,ret0Py);
3506 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3507 for(std::size_t i=0;i<partCompactFormat.size();i++)
3509 PyObject *tmp4=PyTuple_New(2);
3510 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3511 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3512 PyList_SetItem(ret1Py,i,tmp4);
3514 PyTuple_SetItem(ret,1,ret1Py);
3518 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3520 std::vector< std::pair<int,int> > param0,param1,ret;
3521 convertPyToVectorPairInt(bigInAbs,param0);
3522 convertPyToVectorPairInt(partOfBigInAbs,param1);
3523 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3524 PyObject *retPy(PyList_New(ret.size()));
3525 for(std::size_t i=0;i<ret.size();i++)
3527 PyObject *tmp(PyTuple_New(2));
3528 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3529 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3530 PyList_SetItem(retPy,i,tmp);
3535 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3537 std::vector< std::pair<int,int> > param0;
3538 convertPyToVectorPairInt(part,param0);
3539 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3540 PyObject *retPy(PyList_New(ret.size()));
3541 for(std::size_t i=0;i<ret.size();i++)
3543 PyObject *tmp(PyTuple_New(2));
3544 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3545 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3546 PyList_SetItem(retPy,i,tmp);
3551 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3553 std::vector< std::pair<int,int> > param0,param1;
3554 convertPyToVectorPairInt(startingFrom,param0);
3555 convertPyToVectorPairInt(goingTo,param1);
3556 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3559 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3561 std::vector< std::pair<int,int> > param0,param1,ret;
3562 convertPyToVectorPairInt(bigInAbs,param0);
3563 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3564 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3565 PyObject *retPy(PyList_New(ret.size()));
3566 for(std::size_t i=0;i<ret.size();i++)
3568 PyObject *tmp(PyTuple_New(2));
3569 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3570 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3571 PyList_SetItem(retPy,i,tmp);
3578 class MEDCouplingCurveLinearMesh;
3580 //== MEDCouplingCMesh
3582 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3585 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3586 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3587 void setCoords(const DataArrayDouble *coordsX,
3588 const DataArrayDouble *coordsY=0,
3589 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3590 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3591 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3593 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3595 return MEDCouplingCMesh::New();
3597 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3599 return MEDCouplingCMesh::New(meshName);
3601 std::string __str__() const throw(INTERP_KERNEL::Exception)
3603 return self->simpleRepr();
3605 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3607 std::ostringstream oss;
3608 self->reprQuickOverview(oss);
3611 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3613 DataArrayDouble *ret=self->getCoordsAt(i);
3621 //== MEDCouplingCMesh End
3623 //== MEDCouplingCurveLinearMesh
3625 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3628 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3629 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3630 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3632 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3634 return MEDCouplingCurveLinearMesh::New();
3636 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3638 return MEDCouplingCurveLinearMesh::New(meshName);
3640 std::string __str__() const throw(INTERP_KERNEL::Exception)
3642 return self->simpleRepr();
3644 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3646 std::ostringstream oss;
3647 self->reprQuickOverview(oss);
3650 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3652 DataArrayDouble *ret=self->getCoords();
3657 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3659 int szArr,sw,iTypppArr;
3660 std::vector<int> stdvecTyyppArr;
3661 const int *tmp=convertIntStarLikePyObjToCppIntStar(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3662 self->setNodeGridStructure(tmp,tmp+szArr);
3667 //== MEDCouplingCurveLinearMesh End
3669 //== MEDCouplingIMesh
3671 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3674 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3676 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3677 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3678 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3679 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3680 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3681 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3682 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3683 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3684 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3685 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3686 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3691 return MEDCouplingIMesh::New();
3693 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3695 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3696 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3697 const int *nodeStrctPtr(0);
3698 const double *originPtr(0),*dxyzPtr(0);
3700 std::vector<int> bb0;
3701 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
3704 std::vector<double> bb,bb2;
3706 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3707 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3709 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3712 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3714 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3717 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3720 std::vector<int> bb0;
3721 const int *nodeStrctPtr(convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0));
3722 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3725 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3727 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3730 DataArrayDoubleTuple *aa;
3731 std::vector<double> bb;
3733 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3734 self->setOrigin(originPtr,originPtr+nbTuples);
3737 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3739 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3742 DataArrayDoubleTuple *aa;
3743 std::vector<double> bb;
3745 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3746 self->setDXYZ(originPtr,originPtr+nbTuples);
3749 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3751 std::vector< std::pair<int,int> > inp;
3752 convertPyToVectorPairInt(fineLocInCoarse,inp);
3753 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3756 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)
3758 std::vector< std::pair<int,int> > inp;
3759 convertPyToVectorPairInt(fineLocInCoarse,inp);
3760 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3763 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3765 std::vector< std::pair<int,int> > inp;
3766 convertPyToVectorPairInt(fineLocInCoarse,inp);
3767 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3770 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)
3772 std::vector< std::pair<int,int> > inp;
3773 convertPyToVectorPairInt(fineLocInCoarse,inp);
3774 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3777 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)
3779 std::vector< std::pair<int,int> > inp;
3780 convertPyToVectorPairInt(fineLocInCoarse,inp);
3781 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3784 std::string __str__() const throw(INTERP_KERNEL::Exception)
3786 return self->simpleRepr();
3788 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3790 std::ostringstream oss;
3791 self->reprQuickOverview(oss);
3797 //== MEDCouplingIMesh End
3801 namespace MEDCoupling
3803 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3806 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3807 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3808 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3809 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3810 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3811 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3812 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3813 std::string getName() const throw(INTERP_KERNEL::Exception);
3814 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3815 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3816 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3817 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3818 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3819 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3820 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3821 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3822 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3823 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3824 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3825 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3826 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3827 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3828 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3829 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3831 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3833 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3836 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3839 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3841 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3844 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3847 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3849 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3850 return convertIntArrToPyList3(ret);
3853 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3855 DataArrayInt *ret1=0;
3856 MEDCouplingMesh *ret0=0;
3858 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3859 if (!SWIG_IsOK(res1))
3862 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3863 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3867 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3869 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3870 da2->checkAllocated();
3871 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3873 PyObject *res = PyList_New(2);
3874 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3875 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3879 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3881 DataArrayInt *ret1=0;
3883 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3884 PyObject *res=PyTuple_New(2);
3885 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3887 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3890 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3891 PyTuple_SetItem(res,1,res1);
3896 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3899 int v0; std::vector<int> v1;
3900 const int *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
3901 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3904 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3905 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3908 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3909 if (!SWIG_IsOK(res1))
3912 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3913 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3917 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3919 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3920 da2->checkAllocated();
3921 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3925 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3927 std::vector<int> tmp;
3928 self->getCellIdsHavingGaussLocalization(locId,tmp);
3929 DataArrayInt *ret=DataArrayInt::New();
3930 ret->alloc((int)tmp.size(),1);
3931 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3932 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3935 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3937 std::vector<int> inp0;
3938 convertPyToNewIntArr4(code,1,3,inp0);
3939 std::vector<const DataArrayInt *> inp1;
3940 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3941 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3946 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3949 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3950 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f) throw(INTERP_KERNEL::Exception);
3951 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3952 static MEDCouplingFieldTemplate *New(TypeOfField type);
3953 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3954 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3955 bool isEqual(const MEDCouplingFieldTemplate *other, double meshPrec) const throw(INTERP_KERNEL::Exception);
3956 bool isEqualWithoutConsideringStr(const MEDCouplingFieldTemplate *other, double meshPrec) const throw(INTERP_KERNEL::Exception);
3959 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3961 return MEDCouplingFieldTemplate::New(f);
3964 MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f) throw(INTERP_KERNEL::Exception)
3966 return MEDCouplingFieldTemplate::New(f);
3969 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3971 return MEDCouplingFieldTemplate::New(f);
3974 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3976 return MEDCouplingFieldTemplate::New(type);
3979 std::string __str__() const throw(INTERP_KERNEL::Exception)
3981 return self->simpleRepr();
3984 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3986 std::ostringstream oss;
3987 self->reprQuickOverview(oss);
3991 PyObject *isEqualIfNotWhy(const MEDCouplingFieldTemplate *other, double meshPrec) const throw(INTERP_KERNEL::Exception)
3994 bool ret0=self->isEqualIfNotWhy(other,meshPrec,ret1);
3995 PyObject *ret=PyTuple_New(2);
3996 PyObject *ret0Py=ret0?Py_True:Py_False;
3998 PyTuple_SetItem(ret,0,ret0Py);
3999 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4006 class MEDCouplingFieldT : public MEDCoupling::MEDCouplingField
4009 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
4011 MEDCouplingFieldT();
4012 ~MEDCouplingFieldT();
4015 %template(MEDCouplingFieldTdouble) MEDCoupling::MEDCouplingFieldT<double>;
4016 %template(MEDCouplingFieldTfloat) MEDCoupling::MEDCouplingFieldT<float>;
4017 %template(MEDCouplingFieldTint) MEDCoupling::MEDCouplingFieldT<int>;
4019 class MEDCouplingFieldInt;
4020 class MEDCouplingFieldFloat;
4022 class MEDCouplingFieldDouble : public MEDCouplingFieldT<double>
4025 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
4026 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
4027 bool isEqual(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
4028 bool isEqualWithoutConsideringStr(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
4029 void setTimeUnit(const std::string& unit);
4030 std::string getTimeUnit() const;
4031 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
4032 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
4033 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
4034 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4035 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4036 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
4037 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
4038 MEDCouplingFieldFloat *convertToFloatField() const throw(INTERP_KERNEL::Exception);
4039 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
4040 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
4041 MEDCouplingFieldDouble *deepCopy() const;
4042 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
4043 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
4044 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
4045 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
4046 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
4047 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
4048 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
4049 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
4050 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4051 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4052 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4053 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
4054 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
4055 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
4056 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
4057 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
4058 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
4059 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4060 void setIteration(int it) throw(INTERP_KERNEL::Exception);
4061 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
4062 void setOrder(int order) throw(INTERP_KERNEL::Exception);
4063 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
4064 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
4065 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
4066 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4067 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4068 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4069 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4070 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4071 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4072 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
4073 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
4074 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
4075 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
4076 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
4077 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
4078 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
4079 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
4080 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
4081 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
4082 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
4083 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
4084 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
4085 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4086 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4087 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4088 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4089 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4090 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4091 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
4092 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
4093 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
4094 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
4095 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
4096 double getMaxValue() const throw(INTERP_KERNEL::Exception);
4097 double getMinValue() const throw(INTERP_KERNEL::Exception);
4098 double getAverageValue() const throw(INTERP_KERNEL::Exception);
4099 double norm2() const throw(INTERP_KERNEL::Exception);
4100 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4101 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4102 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4103 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
4104 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
4105 double normMax(int compId) const throw(INTERP_KERNEL::Exception);
4106 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
4107 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
4108 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4109 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4110 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4111 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4112 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4113 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4114 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4115 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4116 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4117 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4118 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4119 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4120 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4121 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4122 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
4124 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4126 return MEDCouplingFieldDouble::New(type,td);
4129 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4131 return MEDCouplingFieldDouble::New(ft,td);
4134 std::string __str__() const throw(INTERP_KERNEL::Exception)
4136 return self->simpleRepr();
4139 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4141 std::ostringstream oss;
4142 self->reprQuickOverview(oss);
4146 PyObject *isEqualIfNotWhy(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
4149 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
4150 PyObject *ret=PyTuple_New(2);
4151 PyObject *ret0Py=ret0?Py_True:Py_False;
4153 PyTuple_SetItem(ret,0,ret0Py);
4154 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4158 MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
4160 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4164 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
4166 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4170 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4172 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4174 DataArrayDouble *a,*a2;
4175 DataArrayDoubleTuple *aa,*aa2;
4176 std::vector<double> bb,bb2;
4178 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4179 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4180 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4183 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
4185 DataArrayDouble *ret=self->getArray();
4191 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4193 std::vector<DataArrayDouble *> arrs=self->getArrays();
4194 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4198 PyObject *ret=PyTuple_New(sz);
4199 for(int i=0;i<sz;i++)
4202 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4204 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4209 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4211 std::vector<const DataArrayDouble *> tmp;
4212 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4214 std::vector<DataArrayDouble *> arrs(sz);
4215 for(int i=0;i<sz;i++)
4216 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4217 self->setArrays(arrs);
4220 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4222 DataArrayDouble *ret=self->getEndArray();
4228 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4232 DataArrayDoubleTuple *aa;
4233 std::vector<double> bb;
4235 const MEDCouplingMesh *mesh=self->getMesh();
4237 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4238 int spaceDim=mesh->getSpaceDimension();
4239 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4240 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4242 int sz=self->getNumberOfComponents();
4243 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4244 self->getValueOn(spaceLoc,res);
4245 return convertDblArrToPyList<double>(res,sz);
4248 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4250 int sz=self->getNumberOfComponents();
4251 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4252 self->getValueOnPos(i,j,k,res);
4253 return convertDblArrToPyList<double>(res,sz);
4256 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4258 const MEDCouplingMesh *mesh(self->getMesh());
4260 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4263 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4264 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4265 mesh->getSpaceDimension(),true,nbPts);
4266 return self->getValueOnMulti(inp,nbPts);
4269 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4273 DataArrayDoubleTuple *aa;
4274 std::vector<double> bb;
4276 const MEDCouplingMesh *mesh=self->getMesh();
4278 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4279 int spaceDim=mesh->getSpaceDimension();
4280 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4281 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4284 int sz=self->getNumberOfComponents();
4285 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4286 self->getValueOn(spaceLoc,time,res);
4287 return convertDblArrToPyList<double>(res,sz);
4290 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4292 if(self->getArray()!=0)
4293 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4296 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4297 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4298 self->setArray(arr);
4302 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4305 double tmp0=self->getTime(tmp1,tmp2);
4306 PyObject *res = PyList_New(3);
4307 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4308 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4309 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4313 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4316 double tmp0=self->getStartTime(tmp1,tmp2);
4317 PyObject *res = PyList_New(3);
4318 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4319 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4320 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4324 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4327 double tmp0=self->getEndTime(tmp1,tmp2);
4328 PyObject *res = PyList_New(3);
4329 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4330 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4331 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4334 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4336 int sz=self->getNumberOfComponents();
4337 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4338 self->accumulate(tmp);
4339 return convertDblArrToPyList<double>(tmp,sz);
4341 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4343 int sz=self->getNumberOfComponents();
4344 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4345 self->integral(isWAbs,tmp);
4346 return convertDblArrToPyList<double>(tmp,sz);
4348 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4350 int sz=self->getNumberOfComponents();
4351 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4352 self->getWeightedAverageValue(tmp,isWAbs);
4353 return convertDblArrToPyList<double>(tmp,sz);
4355 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4357 int sz=self->getNumberOfComponents();
4358 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4360 return convertDblArrToPyList<double>(tmp,sz);
4362 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4364 int sz=self->getNumberOfComponents();
4365 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4367 return convertDblArrToPyList<double>(tmp,sz);
4369 PyObject *normMax() const throw(INTERP_KERNEL::Exception)
4371 int sz=self->getNumberOfComponents();
4372 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4374 return convertDblArrToPyList<double>(tmp,sz);
4376 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4378 int szArr,sw,iTypppArr;
4379 std::vector<int> stdvecTyyppArr;
4380 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4381 self->renumberCells(tmp,check);
4384 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4386 int szArr,sw,iTypppArr;
4387 std::vector<int> stdvecTyyppArr;
4388 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4389 self->renumberCellsWithoutMesh(tmp,check);
4392 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4394 int szArr,sw,iTypppArr;
4395 std::vector<int> stdvecTyyppArr;
4396 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4397 self->renumberNodes(tmp,eps);
4400 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4402 int szArr,sw,iTypppArr;
4403 std::vector<int> stdvecTyyppArr;
4404 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4405 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4408 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4410 return fieldT_buildSubPart(self,li);
4413 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4415 return fieldT__getitem__(self,li);
4418 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4421 double r1=self->getMaxValue2(tmp);
4422 PyObject *ret=PyTuple_New(2);
4423 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4424 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4428 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4431 double r1=self->getMinValue2(tmp);
4432 PyObject *ret=PyTuple_New(2);
4433 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4434 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4438 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4440 std::vector<int> tmp;
4441 convertPyToNewIntArr3(li,tmp);
4442 return self->keepSelectedComponents(tmp);
4445 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4447 std::vector<int> tmp;
4448 convertPyToNewIntArr3(li,tmp);
4449 self->setSelectedComponents(f,tmp);
4452 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4455 DataArrayDouble *a,*a2;
4456 DataArrayDoubleTuple *aa,*aa2;
4457 std::vector<double> bb,bb2;
4460 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st parameter for origin.";
4461 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd parameter for vector.";
4462 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4463 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4465 return self->extractSlice3D(orig,vect,eps);
4468 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4470 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4473 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4475 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4478 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4480 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.";
4481 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4484 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4486 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4488 return (*self)-(*other);
4490 throw INTERP_KERNEL::Exception(msg);
4495 DataArrayDoubleTuple *aa;
4496 std::vector<double> bb;
4498 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4503 if(!self->getArray())
4504 throw INTERP_KERNEL::Exception(msg2);
4505 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4506 ret->applyLin(1.,-val);
4507 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4508 ret2->setArray(ret);
4513 if(!self->getArray())
4514 throw INTERP_KERNEL::Exception(msg2);
4515 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4516 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4517 ret2->setArray(ret);
4522 if(!self->getArray())
4523 throw INTERP_KERNEL::Exception(msg2);
4524 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4525 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4526 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4527 ret2->setArray(ret);
4532 if(!self->getArray())
4533 throw INTERP_KERNEL::Exception(msg2);
4534 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4535 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4536 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4537 ret2->setArray(ret);
4541 { throw INTERP_KERNEL::Exception(msg); }
4545 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4547 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4550 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4552 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4555 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4557 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4560 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4562 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.";
4563 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4566 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4568 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4570 return (*self)/(*other);
4572 throw INTERP_KERNEL::Exception(msg);
4577 DataArrayDoubleTuple *aa;
4578 std::vector<double> bb;
4580 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4586 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4587 if(!self->getArray())
4588 throw INTERP_KERNEL::Exception(msg2);
4589 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4590 ret->applyLin(1./val,0);
4591 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4592 ret2->setArray(ret);
4597 if(!self->getArray())
4598 throw INTERP_KERNEL::Exception(msg2);
4599 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4600 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4601 ret2->setArray(ret);
4606 if(!self->getArray())
4607 throw INTERP_KERNEL::Exception(msg2);
4608 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4609 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4610 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4611 ret2->setArray(ret);
4616 if(!self->getArray())
4617 throw INTERP_KERNEL::Exception(msg2);
4618 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4619 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4620 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4621 ret2->setArray(ret);
4625 { throw INTERP_KERNEL::Exception(msg); }
4629 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4631 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4634 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4636 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.";
4637 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4640 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4642 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4644 return (*self)^(*other);
4646 throw INTERP_KERNEL::Exception(msg);
4651 DataArrayDoubleTuple *aa;
4652 std::vector<double> bb;
4654 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4659 if(!self->getArray())
4660 throw INTERP_KERNEL::Exception(msg2);
4661 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4663 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4664 ret2->setArray(ret);
4669 if(!self->getArray())
4670 throw INTERP_KERNEL::Exception(msg2);
4671 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4672 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4673 ret2->setArray(ret);
4678 if(!self->getArray())
4679 throw INTERP_KERNEL::Exception(msg2);
4680 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4681 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4682 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4683 ret2->setArray(ret);
4688 if(!self->getArray())
4689 throw INTERP_KERNEL::Exception(msg2);
4690 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4691 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4692 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4693 ret2->setArray(ret);
4697 { throw INTERP_KERNEL::Exception(msg); }
4701 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4703 return self->negate();
4706 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4708 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.";
4709 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4712 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4714 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4718 Py_XINCREF(trueSelf);
4722 throw INTERP_KERNEL::Exception(msg);
4727 DataArrayDoubleTuple *aa;
4728 std::vector<double> bb;
4730 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4735 if(!self->getArray())
4736 throw INTERP_KERNEL::Exception(msg2);
4737 self->getArray()->applyLin(1.,val);
4738 Py_XINCREF(trueSelf);
4743 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4746 Py_XINCREF(trueSelf);
4751 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4752 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4753 ret2->setArray(aaa);
4755 Py_XINCREF(trueSelf);
4760 if(!self->getArray())
4761 throw INTERP_KERNEL::Exception(msg2);
4762 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4763 self->getArray()->addEqual(aaa);
4764 Py_XINCREF(trueSelf);
4768 { throw INTERP_KERNEL::Exception(msg); }
4772 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4774 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.";
4775 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4778 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4780 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4784 Py_XINCREF(trueSelf);
4788 throw INTERP_KERNEL::Exception(msg);
4793 DataArrayDoubleTuple *aa;
4794 std::vector<double> bb;
4796 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4801 if(!self->getArray())
4802 throw INTERP_KERNEL::Exception(msg2);
4803 self->getArray()->applyLin(1.,-val);
4804 Py_XINCREF(trueSelf);
4809 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4812 Py_XINCREF(trueSelf);
4817 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4818 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4819 ret2->setArray(aaa);
4821 Py_XINCREF(trueSelf);
4826 if(!self->getArray())
4827 throw INTERP_KERNEL::Exception(msg2);
4828 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4829 self->getArray()->substractEqual(aaa);
4830 Py_XINCREF(trueSelf);
4834 { throw INTERP_KERNEL::Exception(msg); }
4838 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4840 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.";
4841 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4844 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4846 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4850 Py_XINCREF(trueSelf);
4854 throw INTERP_KERNEL::Exception(msg);
4859 DataArrayDoubleTuple *aa;
4860 std::vector<double> bb;
4862 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4867 if(!self->getArray())
4868 throw INTERP_KERNEL::Exception(msg2);
4869 self->getArray()->applyLin(val,0);
4870 Py_XINCREF(trueSelf);
4875 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4878 Py_XINCREF(trueSelf);
4883 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4884 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4885 ret2->setArray(aaa);
4887 Py_XINCREF(trueSelf);
4892 if(!self->getArray())
4893 throw INTERP_KERNEL::Exception(msg2);
4894 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4895 self->getArray()->multiplyEqual(aaa);
4896 Py_XINCREF(trueSelf);
4900 { throw INTERP_KERNEL::Exception(msg); }
4904 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4906 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.";
4907 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4910 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4912 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4916 Py_XINCREF(trueSelf);
4920 throw INTERP_KERNEL::Exception(msg);
4925 DataArrayDoubleTuple *aa;
4926 std::vector<double> bb;
4928 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4934 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4935 if(!self->getArray())
4936 throw INTERP_KERNEL::Exception(msg2);
4937 self->getArray()->applyLin(1./val,0);
4938 Py_XINCREF(trueSelf);
4943 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4946 Py_XINCREF(trueSelf);
4951 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4952 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4953 ret2->setArray(aaa);
4955 Py_XINCREF(trueSelf);
4960 if(!self->getArray())
4961 throw INTERP_KERNEL::Exception(msg2);
4962 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4963 self->getArray()->divideEqual(aaa);
4964 Py_XINCREF(trueSelf);
4968 { throw INTERP_KERNEL::Exception(msg); }
4972 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4974 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.";
4975 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4978 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4980 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4984 Py_XINCREF(trueSelf);
4988 throw INTERP_KERNEL::Exception(msg);
4993 DataArrayDoubleTuple *aa;
4994 std::vector<double> bb;
4996 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
5001 if(!self->getArray())
5002 throw INTERP_KERNEL::Exception(msg2);
5003 self->getArray()->applyPow(val);
5004 Py_XINCREF(trueSelf);
5009 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
5012 Py_XINCREF(trueSelf);
5017 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
5018 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
5019 ret2->setArray(aaa);
5021 Py_XINCREF(trueSelf);
5026 if(!self->getArray())
5027 throw INTERP_KERNEL::Exception(msg2);
5028 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
5029 self->getArray()->powEqual(aaa);
5030 Py_XINCREF(trueSelf);
5034 { throw INTERP_KERNEL::Exception(msg); }
5038 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5040 std::vector<const MEDCouplingFieldDouble *> tmp;
5041 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5042 return MEDCouplingFieldDouble::MergeFields(tmp);
5045 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
5047 std::vector<const MEDCouplingFieldDouble *> tmp;
5048 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5049 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
5052 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
5054 return field_getTinySerializationInformation<MEDCouplingFieldDouble>(self);
5057 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5059 return field_serialize<double>(self);
5062 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5064 return field__getstate__<MEDCouplingFieldDouble>(self,MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldDouble_serialize);
5067 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5069 field__setstate__<double>(self,inp);
5074 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5077 int getNumberOfFields() const;
5078 MEDCouplingMultiFields *deepCopy() const;
5079 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5080 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5081 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5082 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5083 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5086 std::string __str__() const throw(INTERP_KERNEL::Exception)
5088 return self->simpleRepr();
5090 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5092 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5093 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5095 std::vector<MEDCouplingFieldDouble *> fs(sz);
5096 for(int i=0;i<sz;i++)
5097 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5098 return MEDCouplingMultiFields::New(fs);
5100 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5102 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5103 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5105 std::vector<MEDCouplingFieldDouble *> fs(sz);
5106 for(int i=0;i<sz;i++)
5107 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5108 return MEDCouplingMultiFields::New(fs);
5110 PyObject *getFields() const
5112 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5113 int sz=fields.size();
5114 PyObject *res = PyList_New(sz);
5115 for(int i=0;i<sz;i++)
5119 fields[i]->incrRef();
5120 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5124 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5129 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5131 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5135 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5138 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5140 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5142 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5144 PyObject *res = PyList_New(sz);
5145 for(int i=0;i<sz;i++)
5150 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5154 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5159 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5161 std::vector<int> refs;
5162 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5164 PyObject *res = PyList_New(sz);
5165 for(int i=0;i<sz;i++)
5170 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5174 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5178 PyObject *ret=PyTuple_New(2);
5179 PyTuple_SetItem(ret,0,res);
5180 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5183 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5185 std::vector<DataArrayDouble *> ms=self->getArrays();
5187 PyObject *res = PyList_New(sz);
5188 for(int i=0;i<sz;i++)
5193 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5197 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5202 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5204 std::vector< std::vector<int> > refs;
5205 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5207 PyObject *res = PyList_New(sz);
5208 PyObject *res2 = PyList_New(sz);
5209 for(int i=0;i<sz;i++)
5214 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5218 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5220 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5223 PyObject *ret=PyTuple_New(2);
5224 PyTuple_SetItem(ret,0,res);
5225 PyTuple_SetItem(ret,1,res2);
5231 class MEDCouplingFieldInt : public MEDCouplingFieldT<int>
5234 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5235 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5236 bool isEqual(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const throw(INTERP_KERNEL::Exception);
5237 bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const throw(INTERP_KERNEL::Exception);
5238 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5239 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5240 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5241 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5242 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5243 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5244 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5245 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5246 MEDCouplingFieldInt *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
5248 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5250 return MEDCouplingFieldInt::New(type,td);
5253 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5255 return MEDCouplingFieldInt::New(ft,td);
5258 PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const throw(INTERP_KERNEL::Exception)
5261 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5262 PyObject *ret=PyTuple_New(2);
5263 PyObject *ret0Py=ret0?Py_True:Py_False;
5265 PyTuple_SetItem(ret,0,ret0Py);
5266 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5270 std::string __str__() const throw(INTERP_KERNEL::Exception)
5272 return self->simpleRepr();
5275 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5277 std::ostringstream oss;
5278 self->reprQuickOverview(oss);
5282 MEDCouplingFieldInt *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
5284 return fieldT_buildSubPart(self,li);
5287 MEDCouplingFieldInt *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
5289 return fieldT__getitem__(self,li);
5292 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5294 DataArrayInt *ret=self->getArray();
5300 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5303 double tmp0=self->getTime(tmp1,tmp2);
5304 PyObject *res = PyList_New(3);
5305 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5306 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5307 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5311 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
5313 return field_getTinySerializationInformation<MEDCouplingFieldInt>(self);
5316 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5318 return field_serialize<int>(self);
5321 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5323 return field__getstate__<MEDCouplingFieldInt>(self,MEDCoupling_MEDCouplingFieldInt_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt_serialize);
5326 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5328 field__setstate__<int>(self,inp);
5333 class MEDCouplingFieldFloat : public MEDCouplingFieldT<float>
5336 static MEDCouplingFieldFloat *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5337 static MEDCouplingFieldFloat *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5338 bool isEqual(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const throw(INTERP_KERNEL::Exception);
5339 bool isEqualWithoutConsideringStr(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const throw(INTERP_KERNEL::Exception);
5340 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5341 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5342 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5343 void setArray(DataArrayFloat *array) throw(INTERP_KERNEL::Exception);
5344 MEDCouplingFieldFloat *deepCopy() const throw(INTERP_KERNEL::Exception);
5345 MEDCouplingFieldFloat *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5346 MEDCouplingFieldFloat *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5347 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5348 MEDCouplingFieldFloat *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
5350 MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5352 return MEDCouplingFieldFloat::New(type,td);
5355 MEDCouplingFieldFloat(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5357 return MEDCouplingFieldFloat::New(ft,td);
5360 PyObject *isEqualIfNotWhy(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const throw(INTERP_KERNEL::Exception)
5363 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5364 PyObject *ret=PyTuple_New(2);
5365 PyObject *ret0Py=ret0?Py_True:Py_False;
5367 PyTuple_SetItem(ret,0,ret0Py);
5368 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5372 std::string __str__() const throw(INTERP_KERNEL::Exception)
5374 return self->simpleRepr();
5377 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5379 std::ostringstream oss;
5380 self->reprQuickOverview(oss);
5384 MEDCouplingFieldFloat *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
5386 return fieldT_buildSubPart(self,li);
5389 MEDCouplingFieldFloat *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
5391 return fieldT__getitem__(self,li);
5394 DataArrayFloat *getArray() throw(INTERP_KERNEL::Exception)
5396 DataArrayFloat *ret=self->getArray();
5402 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5405 double tmp0=self->getTime(tmp1,tmp2);
5406 PyObject *res = PyList_New(3);
5407 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5408 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5409 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5413 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
5415 return field_getTinySerializationInformation<MEDCouplingFieldFloat>(self);
5418 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5420 return field_serialize<float>(self);
5423 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5425 return field__getstate__<MEDCouplingFieldFloat>(self,MEDCoupling_MEDCouplingFieldFloat_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldFloat_serialize);
5428 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5430 field__setstate__<float>(self,inp);
5435 class MEDCouplingDefinitionTime
5438 MEDCouplingDefinitionTime();
5439 void assign(const MEDCouplingDefinitionTime& other);
5440 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5441 double getTimeResolution() const;
5442 std::vector<double> getHotSpotsTime() const;
5445 std::string __str__() const throw(INTERP_KERNEL::Exception)
5447 std::ostringstream oss;
5448 self->appendRepr(oss);
5452 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5454 int meshId,arrId,arrIdInField,fieldId;
5455 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5456 PyObject *res=PyList_New(4);
5457 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5458 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5459 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5460 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5464 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5466 int meshId,arrId,arrIdInField,fieldId;
5467 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5468 PyObject *res=PyList_New(4);
5469 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5470 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5471 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5472 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5478 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5481 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5482 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5486 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5488 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5489 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5491 std::vector<MEDCouplingFieldDouble *> fs(sz);
5492 for(int i=0;i<sz;i++)
5493 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5494 return MEDCouplingFieldOverTime::New(fs);
5496 std::string __str__() const throw(INTERP_KERNEL::Exception)
5498 return self->simpleRepr();
5500 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5502 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5503 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5505 std::vector<MEDCouplingFieldDouble *> fs(sz);
5506 for(int i=0;i<sz;i++)
5507 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5508 return MEDCouplingFieldOverTime::New(fs);
5513 class MEDCouplingCartesianAMRMesh;
5515 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5518 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5519 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5520 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5523 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5525 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5533 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5536 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5537 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5538 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5541 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5543 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5544 return convertFromVectorPairInt(ret);
5547 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5549 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5550 return convertFromVectorPairInt(ret);
5553 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5555 std::vector< std::pair<int,int> > inp;
5556 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5557 self->addPatch(inp,factors);
5560 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5562 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5564 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5565 if(patchId==mesh->getNumberOfPatches())
5567 std::ostringstream oss;
5568 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5569 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5572 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5578 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5580 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5582 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5583 mesh->removePatch(patchId);
5586 int __len__() const throw(INTERP_KERNEL::Exception)
5588 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5590 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5591 return mesh->getNumberOfPatches();
5596 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5600 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5603 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5604 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5605 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5606 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5607 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5608 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5609 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5610 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5611 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5612 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5613 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5614 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5615 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5617 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5618 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5619 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5620 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5621 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5622 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5623 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5624 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5625 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5626 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5627 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5628 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5629 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5630 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5631 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5632 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5633 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5634 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5635 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5636 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5639 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5641 std::vector< std::pair<int,int> > inp;
5642 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5643 self->addPatch(inp,factors);
5646 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5648 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5650 PyObject *ret = PyList_New(sz);
5651 for(int i=0;i<sz;i++)
5653 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5656 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5661 // agy : don't know why typemap fails here ??? let it in the extend section
5662 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5664 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5667 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5669 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5670 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5676 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5678 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5679 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5685 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5687 std::vector<int> out1;
5688 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5689 PyObject *ret(PyTuple_New(2));
5690 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5691 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5695 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5697 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5699 PyObject *ret = PyList_New(sz);
5700 for(int i=0;i<sz;i++)
5701 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5705 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5707 std::vector<const DataArrayDouble *> inp;
5708 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5709 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5712 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5714 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5720 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5722 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5728 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5730 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5736 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5738 const MEDCouplingIMesh *ret(self->getImageMesh());
5741 return const_cast<MEDCouplingIMesh *>(ret);
5744 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5746 if(patchId==self->getNumberOfPatches())
5748 std::ostringstream oss;
5749 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5750 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5753 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5759 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5761 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5762 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5763 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5766 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5768 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5769 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5770 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5773 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5775 self->removePatch(patchId);
5778 int __len__() const throw(INTERP_KERNEL::Exception)
5780 return self->getNumberOfPatches();
5785 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5789 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5792 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5795 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5797 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5798 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5799 const int *nodeStrctPtr(0);
5800 const double *originPtr(0),*dxyzPtr(0);
5802 std::vector<int> bb0;
5803 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
5806 std::vector<double> bb,bb2;
5808 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5809 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5811 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5814 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5816 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5817 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5818 std::vector< std::vector<int> > inp2;
5819 convertPyToVectorOfVectorOfInt(factors,inp2);
5820 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5823 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5825 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5828 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5830 return MEDCouplingCartesianAMRMesh::New(mesh);
5835 class MEDCouplingDataForGodFather : public RefCountObject
5838 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5839 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5840 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5841 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5842 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5843 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5844 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5845 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5846 virtual void alloc() throw(INTERP_KERNEL::Exception);
5847 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5850 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5852 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5860 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5863 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5864 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5865 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5866 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5867 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5868 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5869 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5870 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5871 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5874 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5876 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5877 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5878 MEDCouplingAMRAttribute *ret(0);
5881 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5882 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5884 catch(INTERP_KERNEL::Exception&)
5886 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5887 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5892 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5894 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5897 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5899 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5900 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5906 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5908 std::vector< std::vector<std::string> > compNamesCpp;
5909 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5910 self->spillInfoOnComponents(compNamesCpp);
5913 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5915 std::vector<int> inp0;
5916 if(!fillIntVector(nfs,inp0))
5917 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5918 std::size_t sz(inp0.size());
5919 std::vector<NatureOfField> inp00(sz);
5920 for(std::size_t i=0;i<sz;i++)
5921 inp00[i]=(NatureOfField)inp0[i];
5922 self->spillNatures(inp00);
5925 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5927 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5928 int sz((int)ret.size());
5929 PyObject *retPy(PyList_New(sz));
5930 for(int i=0;i<sz;i++)
5931 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5937 class DenseMatrix : public RefCountObject, public TimeLabel
5940 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5941 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5942 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5943 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5945 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5946 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5947 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5948 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5949 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5950 void transpose() throw(INTERP_KERNEL::Exception);
5952 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5953 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5954 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5957 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5959 return DenseMatrix::New(nbRows,nbCols);
5962 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5964 return DenseMatrix::New(array,nbRows,nbCols);
5967 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5970 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5971 PyObject *ret=PyTuple_New(2);
5972 PyObject *ret0Py=ret0?Py_True:Py_False;
5974 PyTuple_SetItem(ret,0,ret0Py);
5975 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5979 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5981 DataArrayDouble *ret(self->getData());
5987 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5989 return MEDCoupling::DenseMatrix::Add(self,other);
5992 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5994 return MEDCoupling::DenseMatrix::Substract(self,other);
5997 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5999 return MEDCoupling::DenseMatrix::Multiply(self,other);
6002 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
6004 return MEDCoupling::DenseMatrix::Multiply(self,other);
6007 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6009 self->addEqual(other);
6010 Py_XINCREF(trueSelf);
6014 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6016 self->substractEqual(other);
6017 Py_XINCREF(trueSelf);
6021 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
6023 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
6032 def MEDCouplingUMeshReduce(self):
6033 return MEDCouplingStdReduceFunct,(MEDCouplingUMesh,((),(self.__getstate__()),))
6034 def MEDCouplingCMeshReduce(self):
6035 return MEDCouplingStdReduceFunct,(MEDCouplingCMesh,((),(self.__getstate__()),))
6036 def MEDCouplingIMeshReduce(self):
6037 return MEDCouplingStdReduceFunct,(MEDCouplingIMesh,((),(self.__getstate__()),))
6038 def MEDCouplingMappedExtrudedMeshReduce(self):
6039 return MEDCouplingStdReduceFunct,(MEDCouplingMappedExtrudedMesh,((),(self.__getstate__()),))
6040 def MEDCouplingCurveLinearMeshReduce(self):
6041 return MEDCouplingStdReduceFunct,(MEDCouplingCurveLinearMesh,((),(self.__getstate__()),))
6042 def MEDCoupling1SGTUMeshReduce(self):
6043 return MEDCouplingStdReduceFunct,(MEDCoupling1SGTUMesh,((),(self.__getstate__()),))
6044 def MEDCoupling1DGTUMeshReduce(self):
6045 return MEDCouplingStdReduceFunct,(MEDCoupling1DGTUMesh,((),(self.__getstate__()),))
6046 def MEDCouplingFieldDoubleReduce(self):
6047 self.checkConsistencyLight()
6048 d=(self.getTypeOfField(),self.getTimeDiscretization())
6049 return MEDCouplingStdReduceFunct,(MEDCouplingFieldDouble,(d,(self.__getstate__()),))
6050 def MEDCouplingFieldIntReduce(self):
6051 self.checkConsistencyLight()
6052 d=(self.getTypeOfField(),self.getTimeDiscretization())
6053 return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt,(d,(self.__getstate__()),))
6054 def MEDCouplingFieldFloatReduce(self):
6055 self.checkConsistencyLight()
6056 d=(self.getTypeOfField(),self.getTimeDiscretization())
6057 return MEDCouplingStdReduceFunct,(MEDCouplingFieldFloat,(d,(self.__getstate__()),))
6062 __filename=os.environ.get('PYTHONSTARTUP')
6063 if __filename and os.path.isfile(__filename):
6064 exec(open(__filename).read())