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 removeDegenerated1DCells() throw(INTERP_KERNEL::Exception);
1983 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1984 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1985 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1986 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1987 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1988 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1989 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1990 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1991 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1992 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1993 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1994 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1995 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1996 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1997 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1998 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1999 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
2000 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
2001 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
2002 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
2003 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);
2004 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
2005 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2006 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2007 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
2008 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
2010 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
2012 return MEDCouplingUMesh::New();
2015 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
2017 return MEDCouplingUMesh::New(meshName,meshDim);
2020 std::string __str__() const throw(INTERP_KERNEL::Exception)
2022 return self->simpleRepr();
2025 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2027 std::ostringstream oss;
2028 self->reprQuickOverview(oss);
2032 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
2034 return self->cellIterator();
2037 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
2039 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
2043 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
2045 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
2046 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2047 PyObject *res=PyList_New(result.size());
2048 for(int i=0;iL!=result.end(); i++, iL++)
2049 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2053 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2057 std::vector<int> multiVal;
2058 std::pair<int, std::pair<int,int> > slic;
2059 MEDCoupling::DataArrayInt *daIntTyypp=0;
2060 int nbc=self->getNumberOfCells();
2061 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2068 std::ostringstream oss;
2069 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2070 throw INTERP_KERNEL::Exception(oss.str().c_str());
2074 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2081 int tmp=nbc+singleVal;
2082 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2087 std::ostringstream oss;
2088 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2089 throw INTERP_KERNEL::Exception(oss.str().c_str());
2095 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2101 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2102 daIntTyypp->checkAllocated();
2103 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2107 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
2111 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2115 std::vector<int> multiVal;
2116 std::pair<int, std::pair<int,int> > slic;
2117 MEDCoupling::DataArrayInt *daIntTyypp=0;
2118 int nbc=self->getNumberOfCells();
2119 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2126 std::ostringstream oss;
2127 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2128 throw INTERP_KERNEL::Exception(oss.str().c_str());
2132 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2139 int tmp=nbc+singleVal;
2140 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2145 std::ostringstream oss;
2146 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2147 throw INTERP_KERNEL::Exception(oss.str().c_str());
2153 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2158 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2164 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2165 daIntTyypp->checkAllocated();
2166 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2170 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2174 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2176 int szArr,sw,iTypppArr;
2177 std::vector<int> stdvecTyyppArr;
2178 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2181 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2182 throw INTERP_KERNEL::Exception(oss.str().c_str());
2184 self->insertNextCell(type,size,tmp);
2187 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2189 int szArr,sw,iTypppArr;
2190 std::vector<int> stdvecTyyppArr;
2191 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2192 self->insertNextCell(type,szArr,tmp);
2195 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2197 DataArrayInt *ret=self->getNodalConnectivity();
2202 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2204 DataArrayInt *ret=self->getNodalConnectivityIndex();
2210 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2212 int szArr,sw,iTypppArr;
2213 std::vector<int> stdvecTyyppArr;
2214 const int *seedPtr=convertIntStarLikePyObjToCppIntStar(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2215 int nbOfDepthPeelingPerformed=0;
2216 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2217 PyObject *res=PyTuple_New(2);
2218 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2219 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2223 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2225 DataArrayInt *v0=0,*v1=0;
2226 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2227 PyObject *res = PyList_New(2);
2228 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2229 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2233 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2237 DataArrayDoubleTuple *aa;
2238 std::vector<double> bb;
2240 int nbOfCompo=self->getSpaceDimension();
2241 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2244 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2245 PyObject *ret=PyTuple_New(2);
2246 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2247 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2251 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2253 DataArrayInt *ret1=0;
2254 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2255 PyObject *ret=PyTuple_New(2);
2256 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2257 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2261 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2264 DataArrayInt *ret1(0);
2265 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2266 PyObject *ret=PyTuple_New(3);
2267 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2268 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2269 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2273 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2275 std::vector<int> cells;
2276 self->checkButterflyCells(cells,eps);
2277 DataArrayInt *ret=DataArrayInt::New();
2278 ret->alloc((int)cells.size(),1);
2279 std::copy(cells.begin(),cells.end(),ret->getPointer());
2280 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2283 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2285 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2287 PyObject *ret = PyList_New(sz);
2288 for(int i=0;i<sz;i++)
2289 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2293 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2295 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2296 int sz=retCpp.size();
2297 PyObject *ret=PyList_New(sz);
2298 for(int i=0;i<sz;i++)
2299 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2303 static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2305 std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2306 int sz=retCpp.size();
2307 PyObject *ret=PyList_New(sz);
2308 for(int i=0;i<sz;i++)
2309 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2313 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2316 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2317 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2318 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2321 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2324 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2325 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2329 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2332 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2333 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2337 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2339 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2340 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2341 PyObject *ret=PyTuple_New(3);
2342 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2343 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2344 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2348 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2350 DataArrayInt *tmp0=0,*tmp1=0;
2351 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2352 PyObject *ret=PyTuple_New(2);
2353 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2354 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2358 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2362 std::vector<int> multiVal;
2363 std::pair<int, std::pair<int,int> > slic;
2364 MEDCoupling::DataArrayInt *daIntTyypp=0;
2365 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2369 return self->duplicateNodes(&singleVal,&singleVal+1);
2371 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2373 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2375 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2379 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2383 std::vector<int> multiVal;
2384 std::pair<int, std::pair<int,int> > slic;
2385 MEDCoupling::DataArrayInt *daIntTyypp=0;
2386 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2390 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2392 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2394 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2396 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2400 void attractSeg3MidPtsAroundNodes(double ratio, PyObject *nodeIds) throw(INTERP_KERNEL::Exception)
2402 int szArr,sw,iTypppArr;
2403 std::vector<int> stdvecTyyppArr;
2404 const int *nodeIdsPtr(convertIntStarLikePyObjToCppIntStar(nodeIds,sw,szArr,iTypppArr,stdvecTyyppArr));
2405 self->attractSeg3MidPtsAroundNodes(ratio,nodeIdsPtr,nodeIdsPtr+szArr);
2408 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2411 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2412 DataArrayInt *tmp0,*tmp1=0;
2413 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2414 PyObject *ret=PyTuple_New(2);
2415 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2416 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2420 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2422 DataArrayInt *ret0=0,*ret1=0;
2423 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2424 PyObject *ret=PyTuple_New(2);
2425 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2426 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2430 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2432 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2433 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2434 DataArrayInt *ret1=0,*ret2=0;
2435 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2436 PyObject *ret=PyTuple_New(3);
2437 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2438 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2439 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2443 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2445 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2446 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2447 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2448 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2451 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2454 std::vector<const MEDCouplingUMesh *> meshes;
2455 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2456 std::vector<DataArrayInt *> corr;
2457 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2459 PyObject *ret1=PyList_New(sz);
2460 for(int i=0;i<sz;i++)
2461 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2462 PyObject *ret=PyList_New(2);
2463 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2464 PyList_SetItem(ret,1,ret1);
2468 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2470 std::vector<MEDCouplingUMesh *> meshes;
2471 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2472 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2475 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2477 std::vector<MEDCouplingUMesh *> meshes;
2478 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2479 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2482 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2486 std::vector<int> multiVal;
2487 std::pair<int, std::pair<int,int> > slic;
2488 MEDCoupling::DataArrayInt *daIntTyypp=0;
2490 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2491 convertIntStarOrSliceLikePyObjToCpp(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2495 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2497 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2499 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2501 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2505 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2507 DataArrayInt *arrOut=0,*arrIndexOut=0;
2510 std::vector<int> multiVal;
2511 std::pair<int, std::pair<int,int> > slic;
2512 MEDCoupling::DataArrayInt *daIntTyypp=0;
2514 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2515 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2520 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2525 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2530 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2534 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2536 PyObject *ret=PyTuple_New(2);
2537 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2538 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2542 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2544 DataArrayInt *arrOut=0,*arrIndexOut=0;
2545 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2546 PyObject *ret=PyTuple_New(2);
2547 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2548 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2552 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2554 if(!PySlice_Check(slic))
2555 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2556 Py_ssize_t strt=2,stp=2,step=2;
2558 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2559 arrIndxIn->checkAllocated();
2560 if(arrIndxIn->getNumberOfComponents()!=1)
2561 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2562 GetIndicesOfSlice(slic,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2563 DataArrayInt *arrOut=0,*arrIndexOut=0;
2564 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2565 PyObject *ret=PyTuple_New(2);
2566 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2567 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2571 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2572 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2573 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2575 DataArrayInt *arrOut=0,*arrIndexOut=0;
2578 std::vector<int> multiVal;
2579 std::pair<int, std::pair<int,int> > slic;
2580 MEDCoupling::DataArrayInt *daIntTyypp=0;
2582 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2583 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2588 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2593 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2598 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2602 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2604 PyObject *ret=PyTuple_New(2);
2605 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2606 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2610 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2611 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2615 std::vector<int> multiVal;
2616 std::pair<int, std::pair<int,int> > slic;
2617 MEDCoupling::DataArrayInt *daIntTyypp=0;
2619 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2620 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2625 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2630 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2635 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2639 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2643 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2647 DataArrayDoubleTuple *aa;
2648 std::vector<double> bb;
2650 int spaceDim=self->getSpaceDimension();
2651 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2652 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2654 std::vector<int> cells;
2655 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2656 DataArrayInt *ret=DataArrayInt::New();
2657 ret->alloc((int)cells.size(),1);
2658 std::copy(cells.begin(),cells.end(),ret->getPointer());
2659 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2662 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2666 DataArrayDoubleTuple *aa;
2667 std::vector<double> bb;
2669 int spaceDim=self->getSpaceDimension();
2670 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2671 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2672 self->orientCorrectly2DCells(v,polyOnly);
2675 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2677 std::vector<int> cells;
2678 self->arePolyhedronsNotCorrectlyOriented(cells);
2679 DataArrayInt *ret=DataArrayInt::New();
2680 ret->alloc((int)cells.size(),1);
2681 std::copy(cells.begin(),cells.end(),ret->getPointer());
2682 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2685 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2689 self->getFastAveragePlaneOfThis(vec,pos);
2691 std::copy(vec,vec+3,vals);
2692 std::copy(pos,pos+3,vals+3);
2693 return convertDblArrToPyListOfTuple<double>(vals,3,2);
2696 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2698 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2699 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2700 return MEDCouplingUMesh::MergeUMeshes(tmp);
2703 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2706 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2707 PyObject *ret=PyTuple_New(2);
2708 PyObject *ret0Py=ret0?Py_True:Py_False;
2710 PyTuple_SetItem(ret,0,ret0Py);
2711 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2715 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2718 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2719 PyObject *ret=PyTuple_New(2);
2720 PyObject *ret0Py=ret0?Py_True:Py_False;
2722 PyTuple_SetItem(ret,0,ret0Py);
2723 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2727 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2729 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2730 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2731 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2732 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2733 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2734 PyObject *ret=PyTuple_New(5);
2735 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2736 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2737 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2738 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2739 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2743 PyObject *explodeIntoEdges() const throw(INTERP_KERNEL::Exception)
2745 MCAuto<DataArrayInt> desc,descIndex,revDesc,revDescIndx;
2746 MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2747 PyObject *ret=PyTuple_New(5);
2748 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2749 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2750 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2751 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2752 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2756 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2758 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2759 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2760 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2761 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2762 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2763 PyObject *ret=PyTuple_New(5);
2764 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2765 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2766 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2767 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2768 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2772 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2774 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2775 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2776 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2777 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2778 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2779 PyObject *ret=PyTuple_New(5);
2780 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2781 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2782 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2783 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2784 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2788 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2790 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2791 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2792 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2793 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2794 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2795 PyObject *ret=PyTuple_New(5);
2796 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2797 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2798 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2799 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2800 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2804 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2806 DataArrayInt *neighbors=0,*neighborsIdx=0;
2807 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2808 PyObject *ret=PyTuple_New(2);
2809 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2810 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2814 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2816 DataArrayInt *neighbors=0,*neighborsIdx=0;
2817 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2818 PyObject *ret=PyTuple_New(2);
2819 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2820 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2824 PyObject *computeEnlargedNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2826 MCAuto<DataArrayInt> neighbors,neighborsIdx;
2827 self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2828 PyObject *ret=PyTuple_New(2);
2829 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2830 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2834 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const throw(INTERP_KERNEL::Exception)
2836 MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
2837 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2838 PyObject *ret=PyTuple_New(2);
2839 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2840 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2844 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2846 DataArrayInt *neighbors=0,*neighborsIdx=0;
2847 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2848 PyObject *ret=PyTuple_New(2);
2849 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2850 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2854 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2856 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2857 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2858 DataArrayInt *d2,*d3,*d4,*dd5;
2859 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2860 PyObject *ret=PyTuple_New(7);
2861 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2862 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2863 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2864 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2865 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2866 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2867 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2871 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2874 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2875 da->checkAllocated();
2876 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2879 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2882 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2883 da->checkAllocated();
2884 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2887 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2890 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2891 da->checkAllocated();
2892 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2895 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2898 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2899 da->checkAllocated();
2900 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2901 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2902 PyObject *res = PyList_New(result.size());
2903 for (int i=0;iL!=result.end(); i++, iL++)
2904 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2908 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2911 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2912 da->checkAllocated();
2913 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2914 ret->setName(da->getName().c_str());
2918 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2920 DataArrayInt *cellNb1=0,*cellNb2=0;
2921 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2922 PyObject *ret=PyTuple_New(3);
2923 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2924 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2925 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2929 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2931 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2932 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2933 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2934 PyObject *ret(PyTuple_New(4));
2935 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2936 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2937 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2938 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2942 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2944 int spaceDim=self->getSpaceDimension();
2946 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2948 DataArrayDouble *a,*a2;
2949 DataArrayDoubleTuple *aa,*aa2;
2950 std::vector<double> bb,bb2;
2952 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st parameter for origin.";
2953 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd parameter for vector.";
2954 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2955 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2957 DataArrayInt *cellIds=0;
2958 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2959 PyObject *ret=PyTuple_New(2);
2960 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2961 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2965 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2967 int spaceDim=self->getSpaceDimension();
2969 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2971 DataArrayDouble *a,*a2;
2972 DataArrayDoubleTuple *aa,*aa2;
2973 std::vector<double> bb,bb2;
2975 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st parameter for origin.";
2976 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd parameter for vector.";
2977 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2978 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2980 DataArrayInt *cellIds=0;
2981 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2982 PyObject *ret=PyTuple_New(2);
2983 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2984 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2988 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2991 DataArrayDouble *a,*a2;
2992 DataArrayDoubleTuple *aa,*aa2;
2993 std::vector<double> bb,bb2;
2995 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st parameter for origin.";
2996 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd parameter for vector.";
2997 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2998 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2999 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
3003 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3005 int spaceDim=self->getSpaceDimension();
3007 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
3009 DataArrayDouble *a,*a2;
3010 DataArrayDoubleTuple *aa,*aa2;
3011 std::vector<double> bb,bb2;
3013 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st parameter for origin.";
3014 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd parameter for vector.";
3015 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3016 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3017 return self->getCellIdsCrossingPlane(orig,vect,eps);
3020 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
3024 std::vector<int> pos2;
3025 DataArrayInt *pos3=0;
3026 DataArrayIntTuple *pos4=0;
3027 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
3032 self->convertToPolyTypes(&pos1,&pos1+1);
3039 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
3044 self->convertToPolyTypes(pos3->begin(),pos3->end());
3048 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
3052 void convertAllToPoly();
3053 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
3054 bool unPolyze() throw(INTERP_KERNEL::Exception);
3055 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
3056 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
3057 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
3060 //== MEDCouplingUMesh End
3062 //== MEDCouplingMappedExtrudedMesh
3064 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
3067 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
3068 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
3069 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
3070 int get2DCellIdForExtrusion() const;
3072 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
3074 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3077 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
3079 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3082 MEDCouplingMappedExtrudedMesh()
3084 return MEDCouplingMappedExtrudedMesh::New();
3087 std::string __str__() const throw(INTERP_KERNEL::Exception)
3089 return self->simpleRepr();
3092 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3094 std::ostringstream oss;
3095 self->reprQuickOverview(oss);
3099 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
3101 MEDCouplingUMesh *ret=self->getMesh2D();
3104 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3106 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
3108 MEDCouplingUMesh *ret=self->getMesh1D();
3111 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3113 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
3115 DataArrayInt *ret=self->getMesh3DIds();
3118 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3123 //== MEDCouplingMappedExtrudedMesh End
3125 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3128 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3129 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3130 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
3131 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
3132 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
3133 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
3136 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
3138 int szArr,sw,iTypppArr;
3139 std::vector<int> stdvecTyyppArr;
3140 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3141 self->insertNextCell(tmp,tmp+szArr);
3144 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3146 DataArrayInt *ret=self->getNodalConnectivity();
3147 if(ret) ret->incrRef();
3151 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3153 std::vector< const MEDCoupling1GTUMesh *> parts;
3154 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3155 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3160 //== MEDCoupling1SGTUMesh
3162 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3165 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3166 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3167 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
3168 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
3169 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
3170 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3171 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
3172 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
3173 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
3176 MEDCoupling1SGTUMesh()
3178 return MEDCoupling1SGTUMesh::New();
3181 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3183 return MEDCoupling1SGTUMesh::New(name,type);
3186 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3188 return MEDCoupling1SGTUMesh::New(m);
3191 std::string __str__() const throw(INTERP_KERNEL::Exception)
3193 return self->simpleRepr();
3196 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3198 std::ostringstream oss;
3199 self->reprQuickOverview(oss);
3203 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3205 DataArrayInt *cellPerm(0),*nodePerm(0);
3206 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3207 PyObject *ret(PyTuple_New(3));
3208 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3209 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3210 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3214 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3216 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3217 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3218 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3221 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3223 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3224 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3225 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3230 //== MEDCoupling1SGTUMesh End
3232 //== MEDCoupling1DGTUMesh
3234 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3237 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3238 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3239 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3240 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3241 bool isPacked() const throw(INTERP_KERNEL::Exception);
3244 MEDCoupling1DGTUMesh()
3246 return MEDCoupling1DGTUMesh::New();
3248 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3250 return MEDCoupling1DGTUMesh::New(name,type);
3253 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3255 return MEDCoupling1DGTUMesh::New(m);
3258 std::string __str__() const throw(INTERP_KERNEL::Exception)
3260 return self->simpleRepr();
3263 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3265 std::ostringstream oss;
3266 self->reprQuickOverview(oss);
3270 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3272 DataArrayInt *ret=self->getNodalConnectivityIndex();
3273 if(ret) ret->incrRef();
3277 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3279 DataArrayInt *ret1=0,*ret2=0;
3280 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3281 PyObject *ret0Py=ret0?Py_True:Py_False;
3283 PyObject *ret=PyTuple_New(3);
3284 PyTuple_SetItem(ret,0,ret0Py);
3285 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3286 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3290 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3293 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3294 PyObject *ret=PyTuple_New(2);
3295 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3296 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3297 PyTuple_SetItem(ret,1,ret1Py);
3301 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3303 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3304 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3305 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3308 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3310 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3311 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3312 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3315 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3317 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3318 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3319 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3324 //== MEDCoupling1DGTUMeshEnd
3326 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3329 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3330 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3331 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3332 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3333 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3334 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3335 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3336 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3337 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3338 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3339 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3340 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3341 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3342 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3343 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3346 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3348 int tmpp1=-1,tmpp2=-1;
3349 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3350 std::vector< std::pair<int,int> > inp;
3354 for(int i=0;i<tmpp1;i++)
3355 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3360 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3361 inp.resize(tmpp1/2);
3362 for(int i=0;i<tmpp1/2;i++)
3363 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3366 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3367 return self->buildStructuredSubPart(inp);
3370 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3372 std::vector< std::pair<int,int> > inp;
3373 convertPyToVectorPairInt(part,inp);
3375 int szArr,sw,iTypppArr;
3376 std::vector<int> stdvecTyyppArr;
3377 const int *tmp4=convertIntStarLikePyObjToCppIntStar(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3378 std::vector<int> tmp5(tmp4,tmp4+szArr);
3380 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3383 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3385 std::vector< std::pair<int,int> > inp;
3386 convertPyToVectorPairInt(part,inp);
3387 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3390 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3392 std::vector< std::pair<int,int> > inp;
3393 convertPyToVectorPairInt(part,inp);
3394 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3397 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3399 std::vector< std::pair<int,int> > inp;
3400 convertPyToVectorPairInt(part,inp);
3401 std::vector<int> stWithGhost;
3402 std::vector< std::pair<int,int> > partWithGhost;
3403 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3404 PyObject *ret(PyTuple_New(2));
3405 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3406 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3410 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3412 std::vector< std::pair<int,int> > inp;
3413 convertPyToVectorPairInt(partCompactFormat,inp);
3414 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3417 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3419 std::vector< std::pair<int,int> > inp;
3420 convertPyToVectorPairInt(partCompactFormat,inp);
3421 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3424 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3426 std::vector< std::pair<int,int> > inp;
3427 convertPyToVectorPairInt(part,inp);
3428 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3431 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3433 int szArr,sw,iTypppArr;
3434 std::vector<int> stdvecTyyppArr;
3435 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3436 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3439 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3441 int szArr,sw,iTypppArr;
3442 std::vector<int> stdvecTyyppArr;
3443 const int *tmp(convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3444 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3447 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3449 std::vector< std::pair<int,int> > inp;
3450 convertPyToVectorPairInt(partCompactFormat,inp);
3451 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3454 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3456 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3457 PyObject *retPy=PyList_New(ret.size());
3458 for(std::size_t i=0;i<ret.size();i++)
3460 PyObject *tmp=PyTuple_New(2);
3461 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3462 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3463 PyList_SetItem(retPy,i,tmp);
3468 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3470 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3471 convertPyToVectorPairInt(r1,r1Cpp);
3472 convertPyToVectorPairInt(r2,r2Cpp);
3473 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3474 PyObject *retPy=PyList_New(ret.size());
3475 for(std::size_t i=0;i<ret.size();i++)
3477 PyObject *tmp=PyTuple_New(2);
3478 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3479 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3480 PyList_SetItem(retPy,i,tmp);
3485 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3487 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3488 convertPyToVectorPairInt(r1,r1Cpp);
3489 convertPyToVectorPairInt(r2,r2Cpp);
3490 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3493 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3495 int szArr,sw,iTypppArr;
3496 std::vector<int> stdvecTyyppArr;
3497 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3498 int szArr2,sw2,iTypppArr2;
3499 std::vector<int> stdvecTyyppArr2;
3500 const int *tmp2=convertIntStarLikePyObjToCppIntStar(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3501 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3502 std::vector< std::pair<int,int> > partCompactFormat;
3503 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3504 PyObject *ret=PyTuple_New(2);
3505 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3506 PyTuple_SetItem(ret,0,ret0Py);
3507 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3508 for(std::size_t i=0;i<partCompactFormat.size();i++)
3510 PyObject *tmp4=PyTuple_New(2);
3511 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3512 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3513 PyList_SetItem(ret1Py,i,tmp4);
3515 PyTuple_SetItem(ret,1,ret1Py);
3519 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3521 std::vector< std::pair<int,int> > param0,param1,ret;
3522 convertPyToVectorPairInt(bigInAbs,param0);
3523 convertPyToVectorPairInt(partOfBigInAbs,param1);
3524 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3525 PyObject *retPy(PyList_New(ret.size()));
3526 for(std::size_t i=0;i<ret.size();i++)
3528 PyObject *tmp(PyTuple_New(2));
3529 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3530 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3531 PyList_SetItem(retPy,i,tmp);
3536 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3538 std::vector< std::pair<int,int> > param0;
3539 convertPyToVectorPairInt(part,param0);
3540 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3541 PyObject *retPy(PyList_New(ret.size()));
3542 for(std::size_t i=0;i<ret.size();i++)
3544 PyObject *tmp(PyTuple_New(2));
3545 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3546 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3547 PyList_SetItem(retPy,i,tmp);
3552 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3554 std::vector< std::pair<int,int> > param0,param1;
3555 convertPyToVectorPairInt(startingFrom,param0);
3556 convertPyToVectorPairInt(goingTo,param1);
3557 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3560 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3562 std::vector< std::pair<int,int> > param0,param1,ret;
3563 convertPyToVectorPairInt(bigInAbs,param0);
3564 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3565 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3566 PyObject *retPy(PyList_New(ret.size()));
3567 for(std::size_t i=0;i<ret.size();i++)
3569 PyObject *tmp(PyTuple_New(2));
3570 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3571 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3572 PyList_SetItem(retPy,i,tmp);
3579 class MEDCouplingCurveLinearMesh;
3581 //== MEDCouplingCMesh
3583 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3586 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3587 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3588 void setCoords(const DataArrayDouble *coordsX,
3589 const DataArrayDouble *coordsY=0,
3590 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3591 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3592 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3594 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3596 return MEDCouplingCMesh::New();
3598 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3600 return MEDCouplingCMesh::New(meshName);
3602 std::string __str__() const throw(INTERP_KERNEL::Exception)
3604 return self->simpleRepr();
3606 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3608 std::ostringstream oss;
3609 self->reprQuickOverview(oss);
3612 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3614 DataArrayDouble *ret=self->getCoordsAt(i);
3622 //== MEDCouplingCMesh End
3624 //== MEDCouplingCurveLinearMesh
3626 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3629 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3630 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3631 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3633 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3635 return MEDCouplingCurveLinearMesh::New();
3637 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3639 return MEDCouplingCurveLinearMesh::New(meshName);
3641 std::string __str__() const throw(INTERP_KERNEL::Exception)
3643 return self->simpleRepr();
3645 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3647 std::ostringstream oss;
3648 self->reprQuickOverview(oss);
3651 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3653 DataArrayDouble *ret=self->getCoords();
3658 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3660 int szArr,sw,iTypppArr;
3661 std::vector<int> stdvecTyyppArr;
3662 const int *tmp=convertIntStarLikePyObjToCppIntStar(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3663 self->setNodeGridStructure(tmp,tmp+szArr);
3668 //== MEDCouplingCurveLinearMesh End
3670 //== MEDCouplingIMesh
3672 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3675 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3677 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3678 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3679 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3680 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3681 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3682 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3683 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3684 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3685 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3686 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3687 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3692 return MEDCouplingIMesh::New();
3694 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3696 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3697 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3698 const int *nodeStrctPtr(0);
3699 const double *originPtr(0),*dxyzPtr(0);
3701 std::vector<int> bb0;
3702 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
3705 std::vector<double> bb,bb2;
3707 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3708 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3710 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3713 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3715 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3718 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3721 std::vector<int> bb0;
3722 const int *nodeStrctPtr(convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0));
3723 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3726 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3728 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3731 DataArrayDoubleTuple *aa;
3732 std::vector<double> bb;
3734 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3735 self->setOrigin(originPtr,originPtr+nbTuples);
3738 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3740 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3743 DataArrayDoubleTuple *aa;
3744 std::vector<double> bb;
3746 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3747 self->setDXYZ(originPtr,originPtr+nbTuples);
3750 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3752 std::vector< std::pair<int,int> > inp;
3753 convertPyToVectorPairInt(fineLocInCoarse,inp);
3754 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3757 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)
3759 std::vector< std::pair<int,int> > inp;
3760 convertPyToVectorPairInt(fineLocInCoarse,inp);
3761 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3764 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3766 std::vector< std::pair<int,int> > inp;
3767 convertPyToVectorPairInt(fineLocInCoarse,inp);
3768 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3771 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)
3773 std::vector< std::pair<int,int> > inp;
3774 convertPyToVectorPairInt(fineLocInCoarse,inp);
3775 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3778 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)
3780 std::vector< std::pair<int,int> > inp;
3781 convertPyToVectorPairInt(fineLocInCoarse,inp);
3782 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3785 std::string __str__() const throw(INTERP_KERNEL::Exception)
3787 return self->simpleRepr();
3789 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3791 std::ostringstream oss;
3792 self->reprQuickOverview(oss);
3798 //== MEDCouplingIMesh End
3802 namespace MEDCoupling
3804 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3807 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3808 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3809 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3810 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3811 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3812 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3813 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3814 std::string getName() const throw(INTERP_KERNEL::Exception);
3815 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3816 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3817 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3818 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3819 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3820 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3821 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3822 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3823 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3824 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3825 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3826 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3827 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3828 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3829 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3830 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3832 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3834 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3837 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3840 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3842 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3845 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3848 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3850 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3851 return convertIntArrToPyList3(ret);
3854 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3856 DataArrayInt *ret1=0;
3857 MEDCouplingMesh *ret0=0;
3859 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3860 if (!SWIG_IsOK(res1))
3863 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3864 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3868 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3870 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3871 da2->checkAllocated();
3872 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3874 PyObject *res = PyList_New(2);
3875 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3876 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3880 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3882 DataArrayInt *ret1=0;
3884 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3885 PyObject *res=PyTuple_New(2);
3886 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3888 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3891 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3892 PyTuple_SetItem(res,1,res1);
3897 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3900 int v0; std::vector<int> v1;
3901 const int *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
3902 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3905 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3906 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3909 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3910 if (!SWIG_IsOK(res1))
3913 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3914 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3918 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3920 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3921 da2->checkAllocated();
3922 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3926 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3928 std::vector<int> tmp;
3929 self->getCellIdsHavingGaussLocalization(locId,tmp);
3930 DataArrayInt *ret=DataArrayInt::New();
3931 ret->alloc((int)tmp.size(),1);
3932 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3933 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3936 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3938 std::vector<int> inp0;
3939 convertPyToNewIntArr4(code,1,3,inp0);
3940 std::vector<const DataArrayInt *> inp1;
3941 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3942 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3947 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3950 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3951 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f) throw(INTERP_KERNEL::Exception);
3952 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3953 static MEDCouplingFieldTemplate *New(TypeOfField type);
3954 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3955 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3956 bool isEqual(const MEDCouplingFieldTemplate *other, double meshPrec) const throw(INTERP_KERNEL::Exception);
3957 bool isEqualWithoutConsideringStr(const MEDCouplingFieldTemplate *other, double meshPrec) const throw(INTERP_KERNEL::Exception);
3960 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3962 return MEDCouplingFieldTemplate::New(f);
3965 MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f) throw(INTERP_KERNEL::Exception)
3967 return MEDCouplingFieldTemplate::New(f);
3970 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3972 return MEDCouplingFieldTemplate::New(f);
3975 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3977 return MEDCouplingFieldTemplate::New(type);
3980 std::string __str__() const throw(INTERP_KERNEL::Exception)
3982 return self->simpleRepr();
3985 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3987 std::ostringstream oss;
3988 self->reprQuickOverview(oss);
3992 PyObject *isEqualIfNotWhy(const MEDCouplingFieldTemplate *other, double meshPrec) const throw(INTERP_KERNEL::Exception)
3995 bool ret0=self->isEqualIfNotWhy(other,meshPrec,ret1);
3996 PyObject *ret=PyTuple_New(2);
3997 PyObject *ret0Py=ret0?Py_True:Py_False;
3999 PyTuple_SetItem(ret,0,ret0Py);
4000 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4007 class MEDCouplingFieldT : public MEDCoupling::MEDCouplingField
4010 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
4012 MEDCouplingFieldT();
4013 ~MEDCouplingFieldT();
4016 %template(MEDCouplingFieldTdouble) MEDCoupling::MEDCouplingFieldT<double>;
4017 %template(MEDCouplingFieldTfloat) MEDCoupling::MEDCouplingFieldT<float>;
4018 %template(MEDCouplingFieldTint) MEDCoupling::MEDCouplingFieldT<int>;
4020 class MEDCouplingFieldInt;
4021 class MEDCouplingFieldFloat;
4023 class MEDCouplingFieldDouble : public MEDCouplingFieldT<double>
4026 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
4027 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
4028 bool isEqual(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
4029 bool isEqualWithoutConsideringStr(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
4030 void setTimeUnit(const std::string& unit);
4031 std::string getTimeUnit() const;
4032 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
4033 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
4034 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
4035 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4036 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4037 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
4038 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
4039 MEDCouplingFieldFloat *convertToFloatField() const throw(INTERP_KERNEL::Exception);
4040 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
4041 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
4042 MEDCouplingFieldDouble *deepCopy() const;
4043 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
4044 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
4045 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
4046 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
4047 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
4048 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
4049 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
4050 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
4051 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4052 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4053 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4054 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
4055 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
4056 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
4057 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
4058 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
4059 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
4060 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4061 void setIteration(int it) throw(INTERP_KERNEL::Exception);
4062 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
4063 void setOrder(int order) throw(INTERP_KERNEL::Exception);
4064 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
4065 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
4066 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
4067 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4068 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4069 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4070 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4071 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4072 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4073 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
4074 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
4075 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
4076 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
4077 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
4078 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
4079 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
4080 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
4081 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
4082 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
4083 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
4084 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
4085 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
4086 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4087 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4088 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4089 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4090 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4091 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4092 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
4093 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
4094 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
4095 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
4096 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
4097 double getMaxValue() const throw(INTERP_KERNEL::Exception);
4098 double getMinValue() const throw(INTERP_KERNEL::Exception);
4099 double getAverageValue() const throw(INTERP_KERNEL::Exception);
4100 double norm2() const throw(INTERP_KERNEL::Exception);
4101 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4102 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4103 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4104 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
4105 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
4106 double normMax(int compId) const throw(INTERP_KERNEL::Exception);
4107 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
4108 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
4109 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4110 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4111 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4112 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4113 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4114 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4115 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4116 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4117 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4118 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4119 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4120 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4121 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4122 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4123 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
4125 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4127 return MEDCouplingFieldDouble::New(type,td);
4130 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4132 return MEDCouplingFieldDouble::New(ft,td);
4135 std::string __str__() const throw(INTERP_KERNEL::Exception)
4137 return self->simpleRepr();
4140 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4142 std::ostringstream oss;
4143 self->reprQuickOverview(oss);
4147 PyObject *isEqualIfNotWhy(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
4150 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
4151 PyObject *ret=PyTuple_New(2);
4152 PyObject *ret0Py=ret0?Py_True:Py_False;
4154 PyTuple_SetItem(ret,0,ret0Py);
4155 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4159 MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
4161 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4165 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
4167 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4171 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4173 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4175 DataArrayDouble *a,*a2;
4176 DataArrayDoubleTuple *aa,*aa2;
4177 std::vector<double> bb,bb2;
4179 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4180 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4181 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4184 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
4186 DataArrayDouble *ret=self->getArray();
4192 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4194 std::vector<DataArrayDouble *> arrs=self->getArrays();
4195 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4199 PyObject *ret=PyTuple_New(sz);
4200 for(int i=0;i<sz;i++)
4203 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4205 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4210 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4212 std::vector<const DataArrayDouble *> tmp;
4213 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4215 std::vector<DataArrayDouble *> arrs(sz);
4216 for(int i=0;i<sz;i++)
4217 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4218 self->setArrays(arrs);
4221 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4223 DataArrayDouble *ret=self->getEndArray();
4229 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4233 DataArrayDoubleTuple *aa;
4234 std::vector<double> bb;
4236 const MEDCouplingMesh *mesh=self->getMesh();
4238 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4239 int spaceDim=mesh->getSpaceDimension();
4240 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4241 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4243 int sz=self->getNumberOfComponents();
4244 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4245 self->getValueOn(spaceLoc,res);
4246 return convertDblArrToPyList<double>(res,sz);
4249 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4251 int sz=self->getNumberOfComponents();
4252 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4253 self->getValueOnPos(i,j,k,res);
4254 return convertDblArrToPyList<double>(res,sz);
4257 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4259 const MEDCouplingMesh *mesh(self->getMesh());
4261 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4264 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4265 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4266 mesh->getSpaceDimension(),true,nbPts);
4267 return self->getValueOnMulti(inp,nbPts);
4270 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4274 DataArrayDoubleTuple *aa;
4275 std::vector<double> bb;
4277 const MEDCouplingMesh *mesh=self->getMesh();
4279 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4280 int spaceDim=mesh->getSpaceDimension();
4281 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4282 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4285 int sz=self->getNumberOfComponents();
4286 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4287 self->getValueOn(spaceLoc,time,res);
4288 return convertDblArrToPyList<double>(res,sz);
4291 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4293 if(self->getArray()!=0)
4294 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4297 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4298 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4299 self->setArray(arr);
4303 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4306 double tmp0=self->getTime(tmp1,tmp2);
4307 PyObject *res = PyList_New(3);
4308 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4309 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4310 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4314 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4317 double tmp0=self->getStartTime(tmp1,tmp2);
4318 PyObject *res = PyList_New(3);
4319 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4320 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4321 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4325 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4328 double tmp0=self->getEndTime(tmp1,tmp2);
4329 PyObject *res = PyList_New(3);
4330 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4331 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4332 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4335 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4337 int sz=self->getNumberOfComponents();
4338 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4339 self->accumulate(tmp);
4340 return convertDblArrToPyList<double>(tmp,sz);
4342 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4344 int sz=self->getNumberOfComponents();
4345 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4346 self->integral(isWAbs,tmp);
4347 return convertDblArrToPyList<double>(tmp,sz);
4349 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4351 int sz=self->getNumberOfComponents();
4352 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4353 self->getWeightedAverageValue(tmp,isWAbs);
4354 return convertDblArrToPyList<double>(tmp,sz);
4356 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4358 int sz=self->getNumberOfComponents();
4359 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4361 return convertDblArrToPyList<double>(tmp,sz);
4363 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4365 int sz=self->getNumberOfComponents();
4366 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4368 return convertDblArrToPyList<double>(tmp,sz);
4370 PyObject *normMax() const throw(INTERP_KERNEL::Exception)
4372 int sz=self->getNumberOfComponents();
4373 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4375 return convertDblArrToPyList<double>(tmp,sz);
4377 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4379 int szArr,sw,iTypppArr;
4380 std::vector<int> stdvecTyyppArr;
4381 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4382 self->renumberCells(tmp,check);
4385 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4387 int szArr,sw,iTypppArr;
4388 std::vector<int> stdvecTyyppArr;
4389 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4390 self->renumberCellsWithoutMesh(tmp,check);
4393 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4395 int szArr,sw,iTypppArr;
4396 std::vector<int> stdvecTyyppArr;
4397 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4398 self->renumberNodes(tmp,eps);
4401 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4403 int szArr,sw,iTypppArr;
4404 std::vector<int> stdvecTyyppArr;
4405 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4406 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4409 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4411 return fieldT_buildSubPart(self,li);
4414 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4416 return fieldT__getitem__(self,li);
4419 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4422 double r1=self->getMaxValue2(tmp);
4423 PyObject *ret=PyTuple_New(2);
4424 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4425 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4429 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4432 double r1=self->getMinValue2(tmp);
4433 PyObject *ret=PyTuple_New(2);
4434 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4435 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4439 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4441 std::vector<int> tmp;
4442 convertPyToNewIntArr3(li,tmp);
4443 return self->keepSelectedComponents(tmp);
4446 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4448 std::vector<int> tmp;
4449 convertPyToNewIntArr3(li,tmp);
4450 self->setSelectedComponents(f,tmp);
4453 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4456 DataArrayDouble *a,*a2;
4457 DataArrayDoubleTuple *aa,*aa2;
4458 std::vector<double> bb,bb2;
4461 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st parameter for origin.";
4462 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd parameter for vector.";
4463 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4464 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4466 return self->extractSlice3D(orig,vect,eps);
4469 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4471 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4474 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4476 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4479 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4481 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.";
4482 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4485 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4487 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4489 return (*self)-(*other);
4491 throw INTERP_KERNEL::Exception(msg);
4496 DataArrayDoubleTuple *aa;
4497 std::vector<double> bb;
4499 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4504 if(!self->getArray())
4505 throw INTERP_KERNEL::Exception(msg2);
4506 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4507 ret->applyLin(1.,-val);
4508 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4509 ret2->setArray(ret);
4514 if(!self->getArray())
4515 throw INTERP_KERNEL::Exception(msg2);
4516 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4517 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4518 ret2->setArray(ret);
4523 if(!self->getArray())
4524 throw INTERP_KERNEL::Exception(msg2);
4525 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4526 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4527 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4528 ret2->setArray(ret);
4533 if(!self->getArray())
4534 throw INTERP_KERNEL::Exception(msg2);
4535 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4536 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4537 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4538 ret2->setArray(ret);
4542 { throw INTERP_KERNEL::Exception(msg); }
4546 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4548 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4551 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4553 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4556 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4558 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4561 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4563 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.";
4564 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4567 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4569 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4571 return (*self)/(*other);
4573 throw INTERP_KERNEL::Exception(msg);
4578 DataArrayDoubleTuple *aa;
4579 std::vector<double> bb;
4581 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4587 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4588 if(!self->getArray())
4589 throw INTERP_KERNEL::Exception(msg2);
4590 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4591 ret->applyLin(1./val,0);
4592 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4593 ret2->setArray(ret);
4598 if(!self->getArray())
4599 throw INTERP_KERNEL::Exception(msg2);
4600 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4601 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4602 ret2->setArray(ret);
4607 if(!self->getArray())
4608 throw INTERP_KERNEL::Exception(msg2);
4609 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4610 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4611 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4612 ret2->setArray(ret);
4617 if(!self->getArray())
4618 throw INTERP_KERNEL::Exception(msg2);
4619 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4620 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4621 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4622 ret2->setArray(ret);
4626 { throw INTERP_KERNEL::Exception(msg); }
4630 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4632 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4635 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4637 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.";
4638 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4641 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4643 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4645 return (*self)^(*other);
4647 throw INTERP_KERNEL::Exception(msg);
4652 DataArrayDoubleTuple *aa;
4653 std::vector<double> bb;
4655 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4660 if(!self->getArray())
4661 throw INTERP_KERNEL::Exception(msg2);
4662 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4664 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4665 ret2->setArray(ret);
4670 if(!self->getArray())
4671 throw INTERP_KERNEL::Exception(msg2);
4672 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4673 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4674 ret2->setArray(ret);
4679 if(!self->getArray())
4680 throw INTERP_KERNEL::Exception(msg2);
4681 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4682 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4683 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4684 ret2->setArray(ret);
4689 if(!self->getArray())
4690 throw INTERP_KERNEL::Exception(msg2);
4691 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4692 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4693 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4694 ret2->setArray(ret);
4698 { throw INTERP_KERNEL::Exception(msg); }
4702 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4704 return self->negate();
4707 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4709 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.";
4710 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4713 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4715 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4719 Py_XINCREF(trueSelf);
4723 throw INTERP_KERNEL::Exception(msg);
4728 DataArrayDoubleTuple *aa;
4729 std::vector<double> bb;
4731 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4736 if(!self->getArray())
4737 throw INTERP_KERNEL::Exception(msg2);
4738 self->getArray()->applyLin(1.,val);
4739 Py_XINCREF(trueSelf);
4744 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4747 Py_XINCREF(trueSelf);
4752 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4753 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4754 ret2->setArray(aaa);
4756 Py_XINCREF(trueSelf);
4761 if(!self->getArray())
4762 throw INTERP_KERNEL::Exception(msg2);
4763 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4764 self->getArray()->addEqual(aaa);
4765 Py_XINCREF(trueSelf);
4769 { throw INTERP_KERNEL::Exception(msg); }
4773 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4775 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.";
4776 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4779 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4781 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4785 Py_XINCREF(trueSelf);
4789 throw INTERP_KERNEL::Exception(msg);
4794 DataArrayDoubleTuple *aa;
4795 std::vector<double> bb;
4797 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4802 if(!self->getArray())
4803 throw INTERP_KERNEL::Exception(msg2);
4804 self->getArray()->applyLin(1.,-val);
4805 Py_XINCREF(trueSelf);
4810 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4813 Py_XINCREF(trueSelf);
4818 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4819 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4820 ret2->setArray(aaa);
4822 Py_XINCREF(trueSelf);
4827 if(!self->getArray())
4828 throw INTERP_KERNEL::Exception(msg2);
4829 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4830 self->getArray()->substractEqual(aaa);
4831 Py_XINCREF(trueSelf);
4835 { throw INTERP_KERNEL::Exception(msg); }
4839 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4841 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.";
4842 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4845 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4847 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4851 Py_XINCREF(trueSelf);
4855 throw INTERP_KERNEL::Exception(msg);
4860 DataArrayDoubleTuple *aa;
4861 std::vector<double> bb;
4863 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4868 if(!self->getArray())
4869 throw INTERP_KERNEL::Exception(msg2);
4870 self->getArray()->applyLin(val,0);
4871 Py_XINCREF(trueSelf);
4876 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4879 Py_XINCREF(trueSelf);
4884 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4885 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4886 ret2->setArray(aaa);
4888 Py_XINCREF(trueSelf);
4893 if(!self->getArray())
4894 throw INTERP_KERNEL::Exception(msg2);
4895 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4896 self->getArray()->multiplyEqual(aaa);
4897 Py_XINCREF(trueSelf);
4901 { throw INTERP_KERNEL::Exception(msg); }
4905 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4907 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.";
4908 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4911 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4913 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4917 Py_XINCREF(trueSelf);
4921 throw INTERP_KERNEL::Exception(msg);
4926 DataArrayDoubleTuple *aa;
4927 std::vector<double> bb;
4929 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4935 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4936 if(!self->getArray())
4937 throw INTERP_KERNEL::Exception(msg2);
4938 self->getArray()->applyLin(1./val,0);
4939 Py_XINCREF(trueSelf);
4944 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4947 Py_XINCREF(trueSelf);
4952 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4953 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4954 ret2->setArray(aaa);
4956 Py_XINCREF(trueSelf);
4961 if(!self->getArray())
4962 throw INTERP_KERNEL::Exception(msg2);
4963 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4964 self->getArray()->divideEqual(aaa);
4965 Py_XINCREF(trueSelf);
4969 { throw INTERP_KERNEL::Exception(msg); }
4973 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4975 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.";
4976 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4979 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4981 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4985 Py_XINCREF(trueSelf);
4989 throw INTERP_KERNEL::Exception(msg);
4994 DataArrayDoubleTuple *aa;
4995 std::vector<double> bb;
4997 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
5002 if(!self->getArray())
5003 throw INTERP_KERNEL::Exception(msg2);
5004 self->getArray()->applyPow(val);
5005 Py_XINCREF(trueSelf);
5010 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
5013 Py_XINCREF(trueSelf);
5018 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
5019 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
5020 ret2->setArray(aaa);
5022 Py_XINCREF(trueSelf);
5027 if(!self->getArray())
5028 throw INTERP_KERNEL::Exception(msg2);
5029 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
5030 self->getArray()->powEqual(aaa);
5031 Py_XINCREF(trueSelf);
5035 { throw INTERP_KERNEL::Exception(msg); }
5039 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5041 std::vector<const MEDCouplingFieldDouble *> tmp;
5042 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5043 return MEDCouplingFieldDouble::MergeFields(tmp);
5046 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
5048 std::vector<const MEDCouplingFieldDouble *> tmp;
5049 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5050 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
5053 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
5055 return field_getTinySerializationInformation<MEDCouplingFieldDouble>(self);
5058 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5060 return field_serialize<double>(self);
5063 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5065 return field__getstate__<MEDCouplingFieldDouble>(self,MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldDouble_serialize);
5068 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5070 field__setstate__<double>(self,inp);
5075 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5078 int getNumberOfFields() const;
5079 MEDCouplingMultiFields *deepCopy() const;
5080 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5081 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5082 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5083 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5084 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5087 std::string __str__() const throw(INTERP_KERNEL::Exception)
5089 return self->simpleRepr();
5091 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5093 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5094 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5096 std::vector<MEDCouplingFieldDouble *> fs(sz);
5097 for(int i=0;i<sz;i++)
5098 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5099 return MEDCouplingMultiFields::New(fs);
5101 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5103 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5104 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5106 std::vector<MEDCouplingFieldDouble *> fs(sz);
5107 for(int i=0;i<sz;i++)
5108 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5109 return MEDCouplingMultiFields::New(fs);
5111 PyObject *getFields() const
5113 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5114 int sz=fields.size();
5115 PyObject *res = PyList_New(sz);
5116 for(int i=0;i<sz;i++)
5120 fields[i]->incrRef();
5121 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5125 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5130 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5132 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5136 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5139 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5141 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5143 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5145 PyObject *res = PyList_New(sz);
5146 for(int i=0;i<sz;i++)
5151 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5155 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5160 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5162 std::vector<int> refs;
5163 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5165 PyObject *res = PyList_New(sz);
5166 for(int i=0;i<sz;i++)
5171 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5175 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5179 PyObject *ret=PyTuple_New(2);
5180 PyTuple_SetItem(ret,0,res);
5181 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5184 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5186 std::vector<DataArrayDouble *> ms=self->getArrays();
5188 PyObject *res = PyList_New(sz);
5189 for(int i=0;i<sz;i++)
5194 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5198 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5203 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5205 std::vector< std::vector<int> > refs;
5206 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5208 PyObject *res = PyList_New(sz);
5209 PyObject *res2 = PyList_New(sz);
5210 for(int i=0;i<sz;i++)
5215 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5219 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5221 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5224 PyObject *ret=PyTuple_New(2);
5225 PyTuple_SetItem(ret,0,res);
5226 PyTuple_SetItem(ret,1,res2);
5232 class MEDCouplingFieldInt : public MEDCouplingFieldT<int>
5235 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5236 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5237 bool isEqual(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const throw(INTERP_KERNEL::Exception);
5238 bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const throw(INTERP_KERNEL::Exception);
5239 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5240 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5241 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5242 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5243 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5244 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5245 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5246 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5247 MEDCouplingFieldInt *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
5249 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5251 return MEDCouplingFieldInt::New(type,td);
5254 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5256 return MEDCouplingFieldInt::New(ft,td);
5259 PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const throw(INTERP_KERNEL::Exception)
5262 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5263 PyObject *ret=PyTuple_New(2);
5264 PyObject *ret0Py=ret0?Py_True:Py_False;
5266 PyTuple_SetItem(ret,0,ret0Py);
5267 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5271 std::string __str__() const throw(INTERP_KERNEL::Exception)
5273 return self->simpleRepr();
5276 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5278 std::ostringstream oss;
5279 self->reprQuickOverview(oss);
5283 MEDCouplingFieldInt *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
5285 return fieldT_buildSubPart(self,li);
5288 MEDCouplingFieldInt *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
5290 return fieldT__getitem__(self,li);
5293 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5295 DataArrayInt *ret=self->getArray();
5301 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5304 double tmp0=self->getTime(tmp1,tmp2);
5305 PyObject *res = PyList_New(3);
5306 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5307 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5308 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5312 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
5314 return field_getTinySerializationInformation<MEDCouplingFieldInt>(self);
5317 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5319 return field_serialize<int>(self);
5322 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5324 return field__getstate__<MEDCouplingFieldInt>(self,MEDCoupling_MEDCouplingFieldInt_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt_serialize);
5327 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5329 field__setstate__<int>(self,inp);
5334 class MEDCouplingFieldFloat : public MEDCouplingFieldT<float>
5337 static MEDCouplingFieldFloat *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5338 static MEDCouplingFieldFloat *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5339 bool isEqual(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const throw(INTERP_KERNEL::Exception);
5340 bool isEqualWithoutConsideringStr(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const throw(INTERP_KERNEL::Exception);
5341 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5342 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5343 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5344 void setArray(DataArrayFloat *array) throw(INTERP_KERNEL::Exception);
5345 MEDCouplingFieldFloat *deepCopy() const throw(INTERP_KERNEL::Exception);
5346 MEDCouplingFieldFloat *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5347 MEDCouplingFieldFloat *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5348 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5349 MEDCouplingFieldFloat *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
5351 MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5353 return MEDCouplingFieldFloat::New(type,td);
5356 MEDCouplingFieldFloat(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5358 return MEDCouplingFieldFloat::New(ft,td);
5361 PyObject *isEqualIfNotWhy(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const throw(INTERP_KERNEL::Exception)
5364 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5365 PyObject *ret=PyTuple_New(2);
5366 PyObject *ret0Py=ret0?Py_True:Py_False;
5368 PyTuple_SetItem(ret,0,ret0Py);
5369 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5373 std::string __str__() const throw(INTERP_KERNEL::Exception)
5375 return self->simpleRepr();
5378 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5380 std::ostringstream oss;
5381 self->reprQuickOverview(oss);
5385 MEDCouplingFieldFloat *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
5387 return fieldT_buildSubPart(self,li);
5390 MEDCouplingFieldFloat *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
5392 return fieldT__getitem__(self,li);
5395 DataArrayFloat *getArray() throw(INTERP_KERNEL::Exception)
5397 DataArrayFloat *ret=self->getArray();
5403 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5406 double tmp0=self->getTime(tmp1,tmp2);
5407 PyObject *res = PyList_New(3);
5408 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5409 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5410 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5414 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
5416 return field_getTinySerializationInformation<MEDCouplingFieldFloat>(self);
5419 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5421 return field_serialize<float>(self);
5424 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5426 return field__getstate__<MEDCouplingFieldFloat>(self,MEDCoupling_MEDCouplingFieldFloat_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldFloat_serialize);
5429 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5431 field__setstate__<float>(self,inp);
5436 class MEDCouplingDefinitionTime
5439 MEDCouplingDefinitionTime();
5440 void assign(const MEDCouplingDefinitionTime& other);
5441 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5442 double getTimeResolution() const;
5443 std::vector<double> getHotSpotsTime() const;
5446 std::string __str__() const throw(INTERP_KERNEL::Exception)
5448 std::ostringstream oss;
5449 self->appendRepr(oss);
5453 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5455 int meshId,arrId,arrIdInField,fieldId;
5456 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5457 PyObject *res=PyList_New(4);
5458 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5459 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5460 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5461 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5465 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5467 int meshId,arrId,arrIdInField,fieldId;
5468 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5469 PyObject *res=PyList_New(4);
5470 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5471 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5472 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5473 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5479 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5482 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5483 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5487 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5489 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5490 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5492 std::vector<MEDCouplingFieldDouble *> fs(sz);
5493 for(int i=0;i<sz;i++)
5494 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5495 return MEDCouplingFieldOverTime::New(fs);
5497 std::string __str__() const throw(INTERP_KERNEL::Exception)
5499 return self->simpleRepr();
5501 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5503 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5504 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5506 std::vector<MEDCouplingFieldDouble *> fs(sz);
5507 for(int i=0;i<sz;i++)
5508 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5509 return MEDCouplingFieldOverTime::New(fs);
5514 class MEDCouplingCartesianAMRMesh;
5516 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5519 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5520 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5521 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5524 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5526 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5534 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5537 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5538 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5539 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5542 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5544 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5545 return convertFromVectorPairInt(ret);
5548 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5550 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5551 return convertFromVectorPairInt(ret);
5554 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5556 std::vector< std::pair<int,int> > inp;
5557 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5558 self->addPatch(inp,factors);
5561 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5563 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5565 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5566 if(patchId==mesh->getNumberOfPatches())
5568 std::ostringstream oss;
5569 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5570 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5573 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5579 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5581 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5583 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5584 mesh->removePatch(patchId);
5587 int __len__() const throw(INTERP_KERNEL::Exception)
5589 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5591 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5592 return mesh->getNumberOfPatches();
5597 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5601 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5604 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5605 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5606 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5607 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5608 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5609 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5610 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5611 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5612 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5613 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5614 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5615 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5616 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5618 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5619 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5620 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5621 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5622 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5623 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5624 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5625 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5626 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5627 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5628 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5629 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5630 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5631 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5632 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5633 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5634 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5635 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5636 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5637 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5640 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5642 std::vector< std::pair<int,int> > inp;
5643 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5644 self->addPatch(inp,factors);
5647 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5649 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5651 PyObject *ret = PyList_New(sz);
5652 for(int i=0;i<sz;i++)
5654 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5657 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5662 // agy : don't know why typemap fails here ??? let it in the extend section
5663 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5665 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5668 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5670 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5671 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5677 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5679 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5680 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5686 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5688 std::vector<int> out1;
5689 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5690 PyObject *ret(PyTuple_New(2));
5691 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5692 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5696 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5698 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5700 PyObject *ret = PyList_New(sz);
5701 for(int i=0;i<sz;i++)
5702 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5706 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5708 std::vector<const DataArrayDouble *> inp;
5709 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5710 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5713 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5715 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5721 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5723 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5729 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5731 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5737 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5739 const MEDCouplingIMesh *ret(self->getImageMesh());
5742 return const_cast<MEDCouplingIMesh *>(ret);
5745 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5747 if(patchId==self->getNumberOfPatches())
5749 std::ostringstream oss;
5750 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5751 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5754 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5760 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5762 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5763 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5764 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5767 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5769 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5770 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5771 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5774 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5776 self->removePatch(patchId);
5779 int __len__() const throw(INTERP_KERNEL::Exception)
5781 return self->getNumberOfPatches();
5786 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5790 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5793 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5796 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5798 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5799 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5800 const int *nodeStrctPtr(0);
5801 const double *originPtr(0),*dxyzPtr(0);
5803 std::vector<int> bb0;
5804 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
5807 std::vector<double> bb,bb2;
5809 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5810 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5812 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5815 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5817 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5818 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5819 std::vector< std::vector<int> > inp2;
5820 convertPyToVectorOfVectorOfInt(factors,inp2);
5821 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5824 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5826 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5829 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5831 return MEDCouplingCartesianAMRMesh::New(mesh);
5836 class MEDCouplingDataForGodFather : public RefCountObject
5839 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5840 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5841 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5842 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5843 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5844 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5845 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5846 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5847 virtual void alloc() throw(INTERP_KERNEL::Exception);
5848 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5851 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5853 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5861 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5864 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5865 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5866 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5867 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5868 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5869 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5870 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5871 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5872 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5875 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5877 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5878 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5879 MEDCouplingAMRAttribute *ret(0);
5882 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5883 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5885 catch(INTERP_KERNEL::Exception&)
5887 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5888 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5893 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5895 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5898 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5900 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5901 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5907 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5909 std::vector< std::vector<std::string> > compNamesCpp;
5910 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5911 self->spillInfoOnComponents(compNamesCpp);
5914 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5916 std::vector<int> inp0;
5917 if(!fillIntVector(nfs,inp0))
5918 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5919 std::size_t sz(inp0.size());
5920 std::vector<NatureOfField> inp00(sz);
5921 for(std::size_t i=0;i<sz;i++)
5922 inp00[i]=(NatureOfField)inp0[i];
5923 self->spillNatures(inp00);
5926 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5928 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5929 int sz((int)ret.size());
5930 PyObject *retPy(PyList_New(sz));
5931 for(int i=0;i<sz;i++)
5932 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5938 class DenseMatrix : public RefCountObject, public TimeLabel
5941 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5942 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5943 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5944 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5946 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5947 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5948 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5949 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5950 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5951 void transpose() throw(INTERP_KERNEL::Exception);
5953 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5954 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5955 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5958 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5960 return DenseMatrix::New(nbRows,nbCols);
5963 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5965 return DenseMatrix::New(array,nbRows,nbCols);
5968 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5971 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5972 PyObject *ret=PyTuple_New(2);
5973 PyObject *ret0Py=ret0?Py_True:Py_False;
5975 PyTuple_SetItem(ret,0,ret0Py);
5976 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5980 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5982 DataArrayDouble *ret(self->getData());
5988 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5990 return MEDCoupling::DenseMatrix::Add(self,other);
5993 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5995 return MEDCoupling::DenseMatrix::Substract(self,other);
5998 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6000 return MEDCoupling::DenseMatrix::Multiply(self,other);
6003 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
6005 return MEDCoupling::DenseMatrix::Multiply(self,other);
6008 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6010 self->addEqual(other);
6011 Py_XINCREF(trueSelf);
6015 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6017 self->substractEqual(other);
6018 Py_XINCREF(trueSelf);
6022 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
6024 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
6033 def MEDCouplingUMeshReduce(self):
6034 return MEDCouplingStdReduceFunct,(MEDCouplingUMesh,((),(self.__getstate__()),))
6035 def MEDCouplingCMeshReduce(self):
6036 return MEDCouplingStdReduceFunct,(MEDCouplingCMesh,((),(self.__getstate__()),))
6037 def MEDCouplingIMeshReduce(self):
6038 return MEDCouplingStdReduceFunct,(MEDCouplingIMesh,((),(self.__getstate__()),))
6039 def MEDCouplingMappedExtrudedMeshReduce(self):
6040 return MEDCouplingStdReduceFunct,(MEDCouplingMappedExtrudedMesh,((),(self.__getstate__()),))
6041 def MEDCouplingCurveLinearMeshReduce(self):
6042 return MEDCouplingStdReduceFunct,(MEDCouplingCurveLinearMesh,((),(self.__getstate__()),))
6043 def MEDCoupling1SGTUMeshReduce(self):
6044 return MEDCouplingStdReduceFunct,(MEDCoupling1SGTUMesh,((),(self.__getstate__()),))
6045 def MEDCoupling1DGTUMeshReduce(self):
6046 return MEDCouplingStdReduceFunct,(MEDCoupling1DGTUMesh,((),(self.__getstate__()),))
6047 def MEDCouplingFieldDoubleReduce(self):
6048 self.checkConsistencyLight()
6049 d=(self.getTypeOfField(),self.getTimeDiscretization())
6050 return MEDCouplingStdReduceFunct,(MEDCouplingFieldDouble,(d,(self.__getstate__()),))
6051 def MEDCouplingFieldIntReduce(self):
6052 self.checkConsistencyLight()
6053 d=(self.getTypeOfField(),self.getTimeDiscretization())
6054 return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt,(d,(self.__getstate__()),))
6055 def MEDCouplingFieldFloatReduce(self):
6056 self.checkConsistencyLight()
6057 d=(self.getTypeOfField(),self.getTimeDiscretization())
6058 return MEDCouplingStdReduceFunct,(MEDCouplingFieldFloat,(d,(self.__getstate__()),))
6063 __filename=os.environ.get('PYTHONSTARTUP')
6064 if __filename and os.path.isfile(__filename):
6065 exec(open(__filename).read())