1 // Copyright (C) 2007-2016 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 (CEA/DEN)
23 #ifdef WITH_DOCSTRINGS
24 %include MEDCoupling_doc.i
31 #include "MEDCouplingMemArray.hxx"
32 #include "MEDCouplingUMesh.hxx"
33 #include "MEDCouplingMappedExtrudedMesh.hxx"
34 #include "MEDCouplingCMesh.hxx"
35 #include "MEDCouplingIMesh.hxx"
36 #include "MEDCouplingCurveLinearMesh.hxx"
37 #include "MEDCoupling1GTUMesh.hxx"
38 #include "MEDCouplingField.hxx"
39 #include "MEDCouplingFieldDouble.hxx"
40 #include "MEDCouplingFieldInt.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::MEDCouplingMultiFields*
151 $result=convertMultiFields($1,$owner);
154 %typemap(out) MEDCouplingMultiFields*
156 $result=convertMultiFields($1,$owner);
161 %typemap(out) MEDCoupling::PartDefinition*
163 $result=convertPartDefinition($1,$owner);
166 %typemap(out) PartDefinition*
168 $result=convertPartDefinition($1,$owner);
173 %init %{ import_array(); %}
176 %feature("autodoc", "1");
177 %feature("docstring");
179 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
180 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
181 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
182 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
183 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
184 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
185 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
186 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
187 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
188 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
189 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
190 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
191 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
192 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
193 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
194 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
195 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
196 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
197 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
198 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
199 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
200 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
201 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
202 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
203 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
204 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
205 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
206 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
207 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
208 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
209 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
210 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
211 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
212 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
213 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
214 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
215 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
216 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
217 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
218 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
233 %newobject MEDCoupling::MEDCouplingFieldInt::New;
234 %newobject MEDCoupling::MEDCouplingFieldInt::convertToDblField;
235 %newobject MEDCoupling::MEDCouplingFieldInt::getArray;
236 %newobject MEDCoupling::MEDCouplingFieldInt::deepCopy;
237 %newobject MEDCoupling::MEDCouplingFieldInt::clone;
238 %newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh;
239 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
240 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
241 %newobject MEDCoupling::MEDCouplingMesh::clone;
242 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
243 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
244 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
245 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
246 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
247 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
248 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
249 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
250 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
251 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
252 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
253 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
254 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
255 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
256 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
257 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
258 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
259 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
260 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
261 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
262 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
263 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
264 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
265 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
266 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
267 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
268 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
269 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
270 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
271 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
272 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
273 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
274 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
275 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
276 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
277 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
278 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
279 %newobject MEDCoupling::MEDCouplingUMesh::New;
280 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
281 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
282 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
283 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
284 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
285 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
286 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
287 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
288 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
289 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
290 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
291 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
292 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
293 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
294 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
295 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
296 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
297 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
298 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
299 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
300 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
301 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
302 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
303 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
304 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
305 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
306 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
307 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
308 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
309 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
310 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
311 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
312 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
313 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
314 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
315 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
316 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
317 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
318 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
319 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
320 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
321 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
322 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
323 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
324 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
325 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
326 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
327 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
328 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
329 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
330 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
331 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
332 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
333 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
334 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
335 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
336 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
337 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
338 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
339 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
340 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
341 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
342 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
343 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
344 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
345 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
346 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
347 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
348 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
349 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
350 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
351 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
352 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
353 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
354 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
355 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
356 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
357 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
358 %newobject MEDCoupling::MEDCouplingCMesh::New;
359 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
360 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
361 %newobject MEDCoupling::MEDCouplingIMesh::New;
362 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
363 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
364 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
365 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
366 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
367 %newobject MEDCoupling::MEDCouplingMultiFields::New;
368 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
369 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
370 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
371 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
372 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
373 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
374 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
375 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
376 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
377 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
378 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
379 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
380 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
381 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
382 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
383 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
384 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
385 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
386 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
387 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
388 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
389 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
390 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
391 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
392 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
393 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
394 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
395 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
396 %newobject MEDCoupling::DenseMatrix::New;
397 %newobject MEDCoupling::DenseMatrix::deepCopy;
398 %newobject MEDCoupling::DenseMatrix::shallowCpy;
399 %newobject MEDCoupling::DenseMatrix::getData;
400 %newobject MEDCoupling::DenseMatrix::matVecMult;
401 %newobject MEDCoupling::DenseMatrix::MatVecMult;
402 %newobject MEDCoupling::DenseMatrix::__add__;
403 %newobject MEDCoupling::DenseMatrix::__sub__;
404 %newobject MEDCoupling::DenseMatrix::__mul__;
405 %newobject MEDCoupling::PartDefinition::New;
406 %newobject MEDCoupling::PartDefinition::toDAI;
407 %newobject MEDCoupling::PartDefinition::__add__;
408 %newobject MEDCoupling::PartDefinition::composeWith;
409 %newobject MEDCoupling::PartDefinition::tryToSimplify;
410 %newobject MEDCoupling::DataArrayPartDefinition::New;
411 %newobject MEDCoupling::SlicePartDefinition::New;
413 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
414 %feature("unref") MEDCouplingMesh "$this->decrRef();"
415 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
416 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
417 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
418 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
419 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
420 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
421 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
422 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
423 %feature("unref") MEDCouplingField "$this->decrRef();"
424 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
425 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
426 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
427 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
428 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
429 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
430 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
431 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
432 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
433 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
434 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
435 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
436 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
437 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
438 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
439 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
440 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
441 %feature("unref") DenseMatrix "$this->decrRef();"
442 %feature("unref") PartDefinition "$this->decrRef();"
443 %feature("unref") DataArrayPartDefinition "$this->decrRef();"
444 %feature("unref") SlicePartDefinition "$this->decrRef();"
446 %rename(assign) *::operator=;
447 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
448 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
449 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
450 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
454 %rename (InterpKernelException) INTERP_KERNEL::Exception;
456 %include "MEDCouplingRefCountObject.i"
457 %include "MEDCouplingMemArray.i"
459 namespace INTERP_KERNEL
462 * \class BoxSplittingOptions
463 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
465 class BoxSplittingOptions
468 BoxSplittingOptions();
469 void init() throw(INTERP_KERNEL::Exception);
470 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
471 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
472 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
473 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
474 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
475 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
476 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
477 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
478 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
479 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
480 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
481 std::string printOptions() const throw(INTERP_KERNEL::Exception);
484 std::string __str__() const throw(INTERP_KERNEL::Exception)
486 return self->printOptions();
492 namespace MEDCoupling
508 CONST_ON_TIME_INTERVAL = 7
509 } TypeOfTimeDiscretization;
517 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
518 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
520 } MEDCouplingMeshType;
523 class DataArrayDouble;
524 class MEDCouplingUMesh;
525 class MEDCouplingCMesh;
526 class MEDCouplingFieldDouble;
528 %extend RefCountObject
530 std::string getHiddenCppPointer() const
532 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
537 %extend MEDCouplingGaussLocalization
539 std::string __str__() const throw(INTERP_KERNEL::Exception)
541 return self->getStringRepr();
544 std::string __repr__() const throw(INTERP_KERNEL::Exception)
546 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
547 oss << self->getStringRepr();
554 class MEDCouplingMesh : public RefCountObject, public TimeLabel
557 void setName(const std::string& name);
558 std::string getName() const;
559 void setDescription(const std::string& descr);
560 std::string getDescription() const;
561 void setTime(double val, int iteration, int order);
562 void setTimeUnit(const std::string& unit);
563 std::string getTimeUnit() const;
564 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
565 bool isStructured() const throw(INTERP_KERNEL::Exception);
566 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
567 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
568 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
569 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
570 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
571 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
572 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
573 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
574 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
575 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
576 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
577 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
578 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
579 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
580 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
581 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
582 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
583 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
584 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
585 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
586 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
587 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
588 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
589 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
590 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
591 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
592 virtual std::string getVTKFileExtension() const;
593 std::string getVTKFileNameOf(const std::string& fileName) const;
595 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
596 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
597 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
598 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
599 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
600 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
601 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
602 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
603 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
604 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
605 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);
606 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
607 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
608 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
609 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
610 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
611 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
612 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
615 std::string __str__() const throw(INTERP_KERNEL::Exception)
617 return self->simpleRepr();
620 PyObject *getTime() throw(INTERP_KERNEL::Exception)
623 double tmp0=self->getTime(tmp1,tmp2);
624 PyObject *res = PyList_New(3);
625 PyList_SetItem(res,0,SWIG_From_double(tmp0));
626 PyList_SetItem(res,1,SWIG_From_int(tmp1));
627 PyList_SetItem(res,2,SWIG_From_int(tmp2));
631 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
635 DataArrayDoubleTuple *aa;
636 std::vector<double> bb;
638 int spaceDim=self->getSpaceDimension();
639 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
640 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
641 return self->getCellContainingPoint(pos,eps);
644 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
648 DataArrayDoubleTuple *aa;
649 std::vector<double> bb;
651 int spaceDim=self->getSpaceDimension();
652 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
653 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
654 MCAuto<DataArrayInt> elts,eltsIndex;
655 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
656 PyObject *ret=PyTuple_New(2);
657 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
658 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
662 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
664 MCAuto<DataArrayInt> elts,eltsIndex;
665 int spaceDim=self->getSpaceDimension();
667 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
668 if (!SWIG_IsOK(res1))
671 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
672 int nbOfPoints=size/spaceDim;
675 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
677 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
681 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
683 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
684 da2->checkAllocated();
685 int size=da2->getNumberOfTuples();
686 int nbOfCompo=da2->getNumberOfComponents();
687 if(nbOfCompo!=spaceDim)
689 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
691 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
693 PyObject *ret=PyTuple_New(2);
694 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
695 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
699 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
703 DataArrayDoubleTuple *aa;
704 std::vector<double> bb;
706 int spaceDim=self->getSpaceDimension();
707 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
708 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
709 std::vector<int> elts;
710 self->getCellsContainingPoint(pos,eps,elts);
711 DataArrayInt *ret=DataArrayInt::New();
712 ret->alloc((int)elts.size(),1);
713 std::copy(elts.begin(),elts.end(),ret->getPointer());
714 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
717 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
719 MCAuto<DataArrayInt> d0=DataArrayInt::New();
720 MCAuto<DataArrayInt> d1=DataArrayInt::New();
721 self->getReverseNodalConnectivity(d0,d1);
722 PyObject *ret=PyTuple_New(2);
723 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
724 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
728 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
731 int v0; std::vector<int> v1;
732 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
733 self->renumberCells(ids,check);
736 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
738 DataArrayInt *cellCor, *nodeCor;
739 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
740 PyObject *res = PyList_New(2);
741 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
742 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
746 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
748 DataArrayInt *cellCor=0,*nodeCor=0;
749 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
750 PyObject *res = PyList_New(2);
751 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
752 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
756 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
758 DataArrayInt *cellCor=0;
759 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
763 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
766 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
767 if (!SWIG_IsOK(res1))
770 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
771 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
775 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
777 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
778 da2->checkAllocated();
779 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
782 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
784 std::vector<int> conn;
785 self->getNodeIdsOfCell(cellId,conn);
786 return convertIntArrToPyList2(conn);
789 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
791 std::vector<double> coo;
792 self->getCoordinatesOfNode(nodeId,coo);
793 return convertDblArrToPyList2(coo);
796 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
800 DataArrayDoubleTuple *aa;
801 std::vector<double> bb;
803 int spaceDim=self->getSpaceDimension();
804 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
805 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
806 self->scale(pointPtr,factor);
809 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
811 int spaceDim=self->getSpaceDimension();
812 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
813 self->getBoundingBox(tmp);
814 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
818 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
821 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
822 PyObject *ret=PyTuple_New(2);
823 PyObject *ret0Py=ret0?Py_True:Py_False;
825 PyTuple_SetItem(ret,0,ret0Py);
826 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
830 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
832 int szArr,sw,iTypppArr;
833 std::vector<int> stdvecTyyppArr;
834 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
835 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
836 if(sw==3)//DataArrayInt
838 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
839 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
840 std::string name=argpt->getName();
842 ret->setName(name.c_str());
844 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
847 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
849 int szArr,sw,iTypppArr;
850 std::vector<int> stdvecTyyppArr;
852 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
853 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
854 if(sw==3)//DataArrayInt
856 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
857 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
858 std::string name=argpt->getName();
860 ret->setName(name.c_str());
863 PyObject *res = PyList_New(2);
864 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
865 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
866 PyList_SetItem(res,0,obj0);
867 PyList_SetItem(res,1,obj1);
871 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
875 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
876 PyObject *res = PyTuple_New(2);
877 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
880 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
882 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
883 PyTuple_SetItem(res,0,obj0);
884 PyTuple_SetItem(res,1,obj1);
888 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
890 std::vector<int> vals=self->getDistributionOfTypes();
892 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
893 PyObject *ret=PyList_New((int)vals.size()/3);
894 for(int j=0;j<(int)vals.size()/3;j++)
896 PyObject *ret1=PyList_New(3);
897 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
898 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
899 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
900 PyList_SetItem(ret,j,ret1);
905 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
907 std::vector<int> code;
908 std::vector<const DataArrayInt *> idsPerType;
909 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
910 convertPyToNewIntArr4(li,1,3,code);
911 return self->checkTypeConsistencyAndContig(code,idsPerType);
914 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
916 std::vector<int> code;
917 std::vector<DataArrayInt *> idsInPflPerType;
918 std::vector<DataArrayInt *> idsPerType;
919 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
920 PyObject *ret=PyTuple_New(3);
923 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
924 PyObject *ret0=PyList_New((int)code.size()/3);
925 for(int j=0;j<(int)code.size()/3;j++)
927 PyObject *ret00=PyList_New(3);
928 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
929 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
930 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
931 PyList_SetItem(ret0,j,ret00);
933 PyTuple_SetItem(ret,0,ret0);
935 PyObject *ret1=PyList_New(idsInPflPerType.size());
936 for(std::size_t j=0;j<idsInPflPerType.size();j++)
937 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
938 PyTuple_SetItem(ret,1,ret1);
939 int n=idsPerType.size();
940 PyObject *ret2=PyList_New(n);
942 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
943 PyTuple_SetItem(ret,2,ret2);
947 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
951 DataArrayDoubleTuple *aa;
952 std::vector<double> bb;
954 int spaceDim=self->getSpaceDimension();
955 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
956 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
957 self->translate(vectorPtr);
960 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
962 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
965 DataArrayDoubleTuple *aa;
966 std::vector<double> bb;
968 int spaceDim=self->getSpaceDimension();
969 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
970 self->rotate(centerPtr,0,alpha);
973 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
975 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
977 DataArrayDouble *a,*a2;
978 DataArrayDoubleTuple *aa,*aa2;
979 std::vector<double> bb,bb2;
981 int spaceDim=self->getSpaceDimension();
982 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
983 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
984 self->rotate(centerPtr,vectorPtr,alpha);
987 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
989 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
990 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
991 PyObject *res=PyList_New(result.size());
992 for(int i=0;iL!=result.end(); i++, iL++)
993 PyList_SetItem(res,i,PyInt_FromLong(*iL));
997 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
999 std::vector<double> a0;
1000 std::vector<int> a1;
1001 std::vector<std::string> a2;
1002 self->getTinySerializationInformation(a0,a1,a2);
1003 PyObject *ret(PyTuple_New(3));
1004 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1005 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1007 PyObject *ret2(PyList_New(sz));
1009 for(int i=0;i<sz;i++)
1010 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1012 PyTuple_SetItem(ret,2,ret2);
1016 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1018 DataArrayInt *a0Tmp(0);
1019 DataArrayDouble *a1Tmp(0);
1020 self->serialize(a0Tmp,a1Tmp);
1021 PyObject *ret(PyTuple_New(2));
1022 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1023 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1027 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1029 std::vector<std::string> littleStrings;
1030 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1033 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1034 {// put an empty dict in input to say to __new__ to call __init__...
1035 PyObject *ret(PyTuple_New(1));
1036 PyObject *ret0(PyDict_New());
1037 PyTuple_SetItem(ret,0,ret0);
1041 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1043 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1044 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1045 PyObject *ret(PyTuple_New(2));
1046 PyTuple_SetItem(ret,0,ret0);
1047 PyTuple_SetItem(ret,1,ret1);
1051 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1053 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1054 if(!PyTuple_Check(inp))
1055 throw INTERP_KERNEL::Exception(MSG);
1056 int sz(PyTuple_Size(inp));
1058 throw INTERP_KERNEL::Exception(MSG);
1059 PyObject *elt0(PyTuple_GetItem(inp,0));
1060 PyObject *elt1(PyTuple_GetItem(inp,1));
1061 std::vector<double> a0;
1062 std::vector<int> a1;
1063 std::vector<std::string> a2;
1064 DataArrayInt *b0(0);
1065 DataArrayDouble *b1(0);
1067 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1068 throw INTERP_KERNEL::Exception(MSG);
1069 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1071 fillArrayWithPyListDbl3(a0py,tmp,a0);
1072 convertPyToNewIntArr3(a1py,a1);
1073 fillStringVector(a2py,a2);
1076 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1077 throw INTERP_KERNEL::Exception(MSG);
1078 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1080 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1081 if(!SWIG_IsOK(status))
1082 throw INTERP_KERNEL::Exception(MSG);
1083 b0=reinterpret_cast<DataArrayInt *>(argp);
1084 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1085 if(!SWIG_IsOK(status))
1086 throw INTERP_KERNEL::Exception(MSG);
1087 b1=reinterpret_cast<DataArrayDouble *>(argp);
1089 // useless here to call resizeForUnserialization because arrays are well resized.
1090 self->unserialization(a0,a1,b0,b1,a2);
1093 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1095 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1096 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1097 return MEDCouplingMesh::MergeMeshes(tmp);
1103 //== MEDCouplingMesh End
1105 %include "NormalizedGeometricTypes"
1106 %include "MEDCouplingNatureOfFieldEnum"
1108 namespace MEDCoupling
1110 class MEDCouplingNatureOfField
1113 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1114 static std::string GetReprNoThrow(NatureOfField nat);
1115 static std::string GetAllPossibilitiesStr();
1119 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1120 // include "MEDCouplingTimeDiscretization.i"
1122 namespace MEDCoupling
1124 class MEDCouplingGaussLocalization
1127 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1128 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1129 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1130 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1131 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1132 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1133 int getDimension() const throw(INTERP_KERNEL::Exception);
1134 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1135 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1136 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1137 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1139 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1140 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1141 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1142 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1143 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1144 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1145 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1146 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1147 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1148 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1149 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1150 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1152 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1155 class MEDCouplingSkyLineArray
1158 MEDCouplingSkyLineArray();
1159 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray &myArray );
1160 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value );
1161 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value );
1163 void set( DataArrayInt* index, DataArrayInt* value );
1164 int getNumberOf() const;
1165 int getLength() const;
1166 DataArrayInt* getIndexArray() const;
1167 DataArrayInt* getValueArray() const;
1170 std::string __str__() const throw(INTERP_KERNEL::Exception)
1172 return self->simpleRepr();
1178 %include "MEDCouplingFieldDiscretization.i"
1180 //== MEDCouplingPointSet
1182 namespace MEDCoupling
1184 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1187 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1188 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1189 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1190 void zipCoords() throw(INTERP_KERNEL::Exception);
1191 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1192 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1193 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1194 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1195 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1196 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1197 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1198 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1199 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1200 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1201 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1202 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1203 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1204 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1205 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1206 virtual DataArrayInt *findBoundaryNodes() const;
1207 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1208 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1209 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1210 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1211 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1212 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1213 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1214 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1215 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1218 std::string __str__() const throw(INTERP_KERNEL::Exception)
1220 return self->simpleRepr();
1223 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1226 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1227 PyObject *res = PyList_New(2);
1228 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1229 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1233 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1235 DataArrayInt *comm, *commIndex;
1236 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1237 PyObject *res = PyList_New(2);
1238 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1239 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1243 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1245 DataArrayDouble *ret1=self->getCoords();
1248 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1251 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1253 int szArr,sw,iTypppArr;
1254 std::vector<int> stdvecTyyppArr;
1255 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1256 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1257 if(sw==3)//DataArrayInt
1259 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1260 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1261 std::string name=argpt->getName();
1263 ret->setName(name.c_str());
1265 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1268 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1270 int szArr,sw,iTypppArr;
1271 std::vector<int> stdvecTyyppArr;
1272 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1273 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1274 if(sw==3)//DataArrayInt
1276 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1277 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1278 std::string name=argpt->getName();
1280 ret->setName(name.c_str());
1282 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1285 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1287 int szArr,sw,iTypppArr;
1288 std::vector<int> stdvecTyyppArr;
1289 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1290 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1291 if(sw==3)//DataArrayInt
1293 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1294 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1295 std::string name=argpt->getName();
1297 ret->setName(name.c_str());
1299 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1302 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1304 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1305 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1308 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1310 int szArr,sw,iTypppArr;
1311 std::vector<int> stdvecTyyppArr;
1312 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1313 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1314 if(sw==3)//DataArrayInt
1316 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1317 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1318 std::string name=argpt->getName();
1320 ret->setName(name.c_str());
1322 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1325 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1327 int szArr,sw,iTypppArr;
1328 std::vector<int> stdvecTyyppArr;
1329 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1330 self->renumberNodes(tmp,newNbOfNodes);
1333 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1335 int szArr,sw,iTypppArr;
1336 std::vector<int> stdvecTyyppArr;
1337 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1338 self->renumberNodesCenter(tmp,newNbOfNodes);
1341 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1343 int spaceDim=self->getSpaceDimension();
1345 DataArrayDouble *a,*a2;
1346 DataArrayDoubleTuple *aa,*aa2;
1347 std::vector<double> bb,bb2;
1349 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1350 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1351 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1352 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1353 std::vector<int> nodes;
1354 self->findNodesOnLine(p,v,eps,nodes);
1355 DataArrayInt *ret=DataArrayInt::New();
1356 ret->alloc((int)nodes.size(),1);
1357 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1358 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1360 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1362 int spaceDim=self->getSpaceDimension();
1364 DataArrayDouble *a,*a2;
1365 DataArrayDoubleTuple *aa,*aa2;
1366 std::vector<double> bb,bb2;
1368 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1369 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1370 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1371 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1372 std::vector<int> nodes;
1373 self->findNodesOnPlane(p,v,eps,nodes);
1374 DataArrayInt *ret=DataArrayInt::New();
1375 ret->alloc((int)nodes.size(),1);
1376 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1377 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1380 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1384 DataArrayDoubleTuple *aa;
1385 std::vector<double> bb;
1387 int spaceDim=self->getSpaceDimension();
1388 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1389 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1390 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1391 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1394 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1396 DataArrayInt *c=0,*cI=0;
1400 DataArrayDoubleTuple *aa;
1401 std::vector<double> bb;
1403 int spaceDim=self->getSpaceDimension();
1404 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1405 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1406 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1407 PyObject *ret=PyTuple_New(2);
1408 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1409 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1413 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1415 DataArrayInt *c=0,*cI=0;
1416 int spaceDim=self->getSpaceDimension();
1419 DataArrayDoubleTuple *aa;
1420 std::vector<double> bb;
1423 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1424 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1426 PyObject *ret=PyTuple_New(2);
1427 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1428 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1432 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1436 DataArrayDoubleTuple *aa;
1437 std::vector<double> bb;
1439 int spaceDim=self->getSpaceDimension();
1440 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1441 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1443 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1444 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1447 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1451 std::vector<int> multiVal;
1452 std::pair<int, std::pair<int,int> > slic;
1453 MEDCoupling::DataArrayInt *daIntTyypp=0;
1454 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1458 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1460 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1462 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1464 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1468 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1470 DataArrayInt *v0=0,*v1=0;
1471 self->findCommonCells(compType,startCellId,v0,v1);
1472 PyObject *res = PyList_New(2);
1473 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1474 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1479 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1482 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1483 if (!SWIG_IsOK(res1))
1486 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1487 self->renumberNodesInConn(tmp);
1491 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1493 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1494 da2->checkAllocated();
1495 self->renumberNodesInConn(da2->getConstPointer());
1499 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1502 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1503 PyObject *ret=PyTuple_New(2);
1504 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1505 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1509 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1511 DataArrayInt *ret=0;
1513 int szArr,sw,iTypppArr;
1514 std::vector<int> stdvecTyyppArr;
1515 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1516 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1520 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1524 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1525 PyObject *res = PyList_New(3);
1526 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1527 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1528 PyList_SetItem(res,2,SWIG_From_int(ret2));
1532 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1536 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1537 PyObject *res = PyList_New(3);
1538 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1539 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1540 PyList_SetItem(res,2,SWIG_From_int(ret2));
1544 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1547 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1548 if (!SWIG_IsOK(res1))
1551 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1552 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1556 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1558 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1559 da2->checkAllocated();
1560 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1564 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1568 std::vector<int> multiVal;
1569 std::pair<int, std::pair<int,int> > slic;
1570 MEDCoupling::DataArrayInt *daIntTyypp=0;
1571 int nbc=self->getNumberOfCells();
1572 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1579 std::ostringstream oss;
1580 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1581 throw INTERP_KERNEL::Exception(oss.str().c_str());
1584 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1589 int tmp=nbc+singleVal;
1590 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1594 std::ostringstream oss;
1595 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1596 throw INTERP_KERNEL::Exception(oss.str().c_str());
1602 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1606 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1611 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1612 daIntTyypp->checkAllocated();
1613 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1616 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1620 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1623 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1624 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1625 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1626 for(int i=0;i<sz;i++)
1627 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1630 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1633 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1635 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1636 std::vector<double> val3;
1637 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1638 "Rotate2DAlg",2,true,nbNodes);
1640 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1641 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1644 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1647 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1648 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1649 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1650 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1651 for(int i=0;i<sz;i++)
1652 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1655 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1658 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1660 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1661 std::vector<double> val3;
1662 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1663 "Rotate3DAlg",3,true,nbNodes);
1665 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1666 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1667 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1672 //== MEDCouplingPointSet End
1674 class MEDCouplingUMeshCell
1677 INTERP_KERNEL::NormalizedCellType getType() const;
1680 std::string __str__() const throw(INTERP_KERNEL::Exception)
1682 return self->repr();
1685 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1688 const int *r=self->getAllConn(ret2);
1689 PyObject *ret=PyTuple_New(ret2);
1690 for(int i=0;i<ret2;i++)
1691 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1697 class MEDCouplingUMeshCellIterator
1704 MEDCouplingUMeshCell *ret=self->nextt();
1706 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1709 PyErr_SetString(PyExc_StopIteration,"No more data.");
1716 class MEDCouplingUMeshCellByTypeIterator
1719 ~MEDCouplingUMeshCellByTypeIterator();
1724 MEDCouplingUMeshCellEntry *ret=self->nextt();
1726 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1729 PyErr_SetString(PyExc_StopIteration,"No more data.");
1736 class MEDCouplingUMeshCellByTypeEntry
1739 ~MEDCouplingUMeshCellByTypeEntry();
1742 MEDCouplingUMeshCellByTypeIterator *__iter__()
1744 return self->iterator();
1749 class MEDCouplingUMeshCellEntry
1752 INTERP_KERNEL::NormalizedCellType getType() const;
1753 int getNumberOfElems() const;
1756 MEDCouplingUMeshCellIterator *__iter__()
1758 return self->iterator();
1763 //== MEDCouplingUMesh
1765 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1768 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1769 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1770 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1771 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1772 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1773 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1774 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1775 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1776 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1777 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1778 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1779 void computeTypes() throw(INTERP_KERNEL::Exception);
1780 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1781 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1783 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1784 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1785 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1786 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1787 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1788 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1789 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1790 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1791 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1792 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1793 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1794 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1795 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1796 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1797 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1798 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1799 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1800 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1801 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1802 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1803 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1804 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1805 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1806 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1807 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1808 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1809 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1810 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1811 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1812 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1813 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1814 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1815 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1816 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1817 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1818 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1819 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1820 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1821 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1822 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1823 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1824 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1825 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1826 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1827 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1828 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);
1829 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1830 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1831 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1832 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1833 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1835 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1837 return MEDCouplingUMesh::New();
1840 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1842 return MEDCouplingUMesh::New(meshName,meshDim);
1846 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1848 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1851 std::string __str__() const throw(INTERP_KERNEL::Exception)
1853 return self->simpleRepr();
1856 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1858 std::ostringstream oss;
1859 self->reprQuickOverview(oss);
1863 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1865 return self->cellIterator();
1868 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1870 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1871 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1872 PyObject *res=PyList_New(result.size());
1873 for(int i=0;iL!=result.end(); i++, iL++)
1874 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1878 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1882 std::vector<int> multiVal;
1883 std::pair<int, std::pair<int,int> > slic;
1884 MEDCoupling::DataArrayInt *daIntTyypp=0;
1885 int nbc=self->getNumberOfCells();
1886 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1893 std::ostringstream oss;
1894 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1895 throw INTERP_KERNEL::Exception(oss.str().c_str());
1899 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1906 int tmp=nbc+singleVal;
1907 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1912 std::ostringstream oss;
1913 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1914 throw INTERP_KERNEL::Exception(oss.str().c_str());
1920 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1926 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1927 daIntTyypp->checkAllocated();
1928 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1932 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1936 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1940 std::vector<int> multiVal;
1941 std::pair<int, std::pair<int,int> > slic;
1942 MEDCoupling::DataArrayInt *daIntTyypp=0;
1943 int nbc=self->getNumberOfCells();
1944 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1951 std::ostringstream oss;
1952 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1953 throw INTERP_KERNEL::Exception(oss.str().c_str());
1957 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1964 int tmp=nbc+singleVal;
1965 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1970 std::ostringstream oss;
1971 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1972 throw INTERP_KERNEL::Exception(oss.str().c_str());
1978 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1983 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1989 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1990 daIntTyypp->checkAllocated();
1991 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1995 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1999 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2001 int szArr,sw,iTypppArr;
2002 std::vector<int> stdvecTyyppArr;
2003 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2006 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2007 throw INTERP_KERNEL::Exception(oss.str().c_str());
2009 self->insertNextCell(type,size,tmp);
2012 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2014 int szArr,sw,iTypppArr;
2015 std::vector<int> stdvecTyyppArr;
2016 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2017 self->insertNextCell(type,szArr,tmp);
2020 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2022 DataArrayInt *ret=self->getNodalConnectivity();
2027 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2029 DataArrayInt *ret=self->getNodalConnectivityIndex();
2035 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2037 int szArr,sw,iTypppArr;
2038 std::vector<int> stdvecTyyppArr;
2039 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2040 int nbOfDepthPeelingPerformed=0;
2041 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2042 PyObject *res=PyTuple_New(2);
2043 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2044 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2048 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2050 DataArrayInt *v0=0,*v1=0;
2051 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2052 PyObject *res = PyList_New(2);
2053 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2054 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2058 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2062 DataArrayDoubleTuple *aa;
2063 std::vector<double> bb;
2065 int nbOfCompo=self->getSpaceDimension();
2066 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2069 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2070 PyObject *ret=PyTuple_New(2);
2071 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2072 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2076 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2078 DataArrayInt *ret1=0;
2079 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2080 PyObject *ret=PyTuple_New(2);
2081 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2082 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2086 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2089 DataArrayInt *ret1(0);
2090 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2091 PyObject *ret=PyTuple_New(3);
2092 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2093 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2094 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2098 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2100 std::vector<int> cells;
2101 self->checkButterflyCells(cells,eps);
2102 DataArrayInt *ret=DataArrayInt::New();
2103 ret->alloc((int)cells.size(),1);
2104 std::copy(cells.begin(),cells.end(),ret->getPointer());
2105 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2108 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2110 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2112 PyObject *ret = PyList_New(sz);
2113 for(int i=0;i<sz;i++)
2114 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2118 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2120 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2121 int sz=retCpp.size();
2122 PyObject *ret=PyList_New(sz);
2123 for(int i=0;i<sz;i++)
2124 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2128 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2131 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2132 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2133 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2136 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2139 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2140 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2144 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2147 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2148 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2152 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2154 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2155 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2156 PyObject *ret=PyTuple_New(3);
2157 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2158 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2159 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2163 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2165 DataArrayInt *tmp0=0,*tmp1=0;
2166 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2167 PyObject *ret=PyTuple_New(2);
2168 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2169 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2173 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2177 std::vector<int> multiVal;
2178 std::pair<int, std::pair<int,int> > slic;
2179 MEDCoupling::DataArrayInt *daIntTyypp=0;
2180 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2184 return self->duplicateNodes(&singleVal,&singleVal+1);
2186 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2188 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2190 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2194 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2198 std::vector<int> multiVal;
2199 std::pair<int, std::pair<int,int> > slic;
2200 MEDCoupling::DataArrayInt *daIntTyypp=0;
2201 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2205 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2207 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2209 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2211 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2215 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2218 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2219 DataArrayInt *tmp0,*tmp1=0;
2220 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2221 PyObject *ret=PyTuple_New(2);
2222 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2223 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2227 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2229 DataArrayInt *ret0=0,*ret1=0;
2230 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2231 PyObject *ret=PyTuple_New(2);
2232 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2233 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2237 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2239 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2240 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2241 DataArrayInt *ret1=0,*ret2=0;
2242 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2243 PyObject *ret=PyTuple_New(3);
2244 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2245 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2246 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2250 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2252 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2253 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2254 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2255 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2258 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2261 std::vector<const MEDCouplingUMesh *> meshes;
2262 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2263 std::vector<DataArrayInt *> corr;
2264 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2266 PyObject *ret1=PyList_New(sz);
2267 for(int i=0;i<sz;i++)
2268 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2269 PyObject *ret=PyList_New(2);
2270 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2271 PyList_SetItem(ret,1,ret1);
2275 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2277 std::vector<MEDCouplingUMesh *> meshes;
2278 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2279 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2282 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2284 std::vector<MEDCouplingUMesh *> meshes;
2285 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2286 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2289 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2293 std::vector<int> multiVal;
2294 std::pair<int, std::pair<int,int> > slic;
2295 MEDCoupling::DataArrayInt *daIntTyypp=0;
2297 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2298 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2302 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2304 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2306 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2308 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2312 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2314 DataArrayInt *arrOut=0,*arrIndexOut=0;
2317 std::vector<int> multiVal;
2318 std::pair<int, std::pair<int,int> > slic;
2319 MEDCoupling::DataArrayInt *daIntTyypp=0;
2321 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2322 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2327 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2332 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2337 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2341 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2343 PyObject *ret=PyTuple_New(2);
2344 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2345 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2349 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2351 DataArrayInt *arrOut=0,*arrIndexOut=0;
2352 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2353 PyObject *ret=PyTuple_New(2);
2354 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2355 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2359 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2361 if(!PySlice_Check(slic))
2362 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2363 Py_ssize_t strt=2,stp=2,step=2;
2364 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2366 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2367 arrIndxIn->checkAllocated();
2368 if(arrIndxIn->getNumberOfComponents()!=1)
2369 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2370 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2371 DataArrayInt *arrOut=0,*arrIndexOut=0;
2372 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2373 PyObject *ret=PyTuple_New(2);
2374 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2375 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2379 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2380 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2381 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2383 DataArrayInt *arrOut=0,*arrIndexOut=0;
2386 std::vector<int> multiVal;
2387 std::pair<int, std::pair<int,int> > slic;
2388 MEDCoupling::DataArrayInt *daIntTyypp=0;
2390 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2391 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2396 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2401 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2406 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2410 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2412 PyObject *ret=PyTuple_New(2);
2413 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2414 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2418 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2419 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2423 std::vector<int> multiVal;
2424 std::pair<int, std::pair<int,int> > slic;
2425 MEDCoupling::DataArrayInt *daIntTyypp=0;
2427 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2428 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2433 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2438 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2443 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2447 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2451 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2455 DataArrayDoubleTuple *aa;
2456 std::vector<double> bb;
2458 int spaceDim=self->getSpaceDimension();
2459 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2460 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2462 std::vector<int> cells;
2463 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2464 DataArrayInt *ret=DataArrayInt::New();
2465 ret->alloc((int)cells.size(),1);
2466 std::copy(cells.begin(),cells.end(),ret->getPointer());
2467 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2470 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2474 DataArrayDoubleTuple *aa;
2475 std::vector<double> bb;
2477 int spaceDim=self->getSpaceDimension();
2478 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2479 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2480 self->orientCorrectly2DCells(v,polyOnly);
2483 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2485 std::vector<int> cells;
2486 self->arePolyhedronsNotCorrectlyOriented(cells);
2487 DataArrayInt *ret=DataArrayInt::New();
2488 ret->alloc((int)cells.size(),1);
2489 std::copy(cells.begin(),cells.end(),ret->getPointer());
2490 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2493 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2497 self->getFastAveragePlaneOfThis(vec,pos);
2499 std::copy(vec,vec+3,vals);
2500 std::copy(pos,pos+3,vals+3);
2501 return convertDblArrToPyListOfTuple(vals,3,2);
2504 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2506 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2507 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2508 return MEDCouplingUMesh::MergeUMeshes(tmp);
2511 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2514 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2515 PyObject *ret=PyTuple_New(2);
2516 PyObject *ret0Py=ret0?Py_True:Py_False;
2518 PyTuple_SetItem(ret,0,ret0Py);
2519 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2523 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2526 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2527 PyObject *ret=PyTuple_New(2);
2528 PyObject *ret0Py=ret0?Py_True:Py_False;
2530 PyTuple_SetItem(ret,0,ret0Py);
2531 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2535 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2537 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2538 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2539 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2540 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2541 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2542 PyObject *ret=PyTuple_New(5);
2543 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2544 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2545 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2546 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2547 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2551 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2553 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2554 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2555 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2556 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2557 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2558 PyObject *ret=PyTuple_New(5);
2559 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2560 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2561 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2562 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2563 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2567 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2569 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2570 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2571 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2572 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2573 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2574 PyObject *ret=PyTuple_New(5);
2575 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2576 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2577 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2578 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2579 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2583 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2585 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2586 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2587 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2588 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2589 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2590 PyObject *ret=PyTuple_New(5);
2591 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2592 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2593 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2594 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2595 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2599 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2601 DataArrayInt *neighbors=0,*neighborsIdx=0;
2602 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2603 PyObject *ret=PyTuple_New(2);
2604 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2605 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2609 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2611 DataArrayInt *neighbors=0,*neighborsIdx=0;
2612 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2613 PyObject *ret=PyTuple_New(2);
2614 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2615 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2619 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2621 DataArrayInt *neighbors=0,*neighborsIdx=0;
2622 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2623 PyObject *ret=PyTuple_New(2);
2624 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2625 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2629 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2631 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2632 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2633 DataArrayInt *d2,*d3,*d4,*dd5;
2634 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2635 PyObject *ret=PyTuple_New(7);
2636 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2637 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2638 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2639 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2640 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2641 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2642 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2646 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2649 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2650 da->checkAllocated();
2651 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2654 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2657 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2658 da->checkAllocated();
2659 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2662 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2665 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2666 da->checkAllocated();
2667 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2670 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2673 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2674 da->checkAllocated();
2675 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2676 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2677 PyObject *res = PyList_New(result.size());
2678 for (int i=0;iL!=result.end(); i++, iL++)
2679 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2683 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2686 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2687 da->checkAllocated();
2688 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2689 ret->setName(da->getName().c_str());
2693 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2695 DataArrayInt *cellNb1=0,*cellNb2=0;
2696 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2697 PyObject *ret=PyTuple_New(3);
2698 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2699 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2700 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2704 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2706 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2707 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2708 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2709 PyObject *ret(PyTuple_New(4));
2710 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2711 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2712 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2713 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2717 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2719 int spaceDim=self->getSpaceDimension();
2721 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2723 DataArrayDouble *a,*a2;
2724 DataArrayDoubleTuple *aa,*aa2;
2725 std::vector<double> bb,bb2;
2727 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2728 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2729 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2730 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2732 DataArrayInt *cellIds=0;
2733 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2734 PyObject *ret=PyTuple_New(2);
2735 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2736 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2740 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2742 int spaceDim=self->getSpaceDimension();
2744 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2746 DataArrayDouble *a,*a2;
2747 DataArrayDoubleTuple *aa,*aa2;
2748 std::vector<double> bb,bb2;
2750 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2751 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2752 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2753 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2755 DataArrayInt *cellIds=0;
2756 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2757 PyObject *ret=PyTuple_New(2);
2758 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2759 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2763 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2765 int spaceDim=self->getSpaceDimension();
2767 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2769 DataArrayDouble *a,*a2;
2770 DataArrayDoubleTuple *aa,*aa2;
2771 std::vector<double> bb,bb2;
2773 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2774 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2775 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2776 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2777 return self->getCellIdsCrossingPlane(orig,vect,eps);
2780 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2784 std::vector<int> pos2;
2785 DataArrayInt *pos3=0;
2786 DataArrayIntTuple *pos4=0;
2787 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2792 self->convertToPolyTypes(&pos1,&pos1+1);
2799 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2804 self->convertToPolyTypes(pos3->begin(),pos3->end());
2808 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2812 void convertAllToPoly();
2813 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2814 bool unPolyze() throw(INTERP_KERNEL::Exception);
2815 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2816 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2817 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2820 //== MEDCouplingUMesh End
2822 //== MEDCouplingMappedExtrudedMesh
2824 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
2827 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2828 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
2829 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2831 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2833 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2836 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
2838 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
2841 MEDCouplingMappedExtrudedMesh()
2843 return MEDCouplingMappedExtrudedMesh::New();
2846 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2848 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
2851 std::string __str__() const throw(INTERP_KERNEL::Exception)
2853 return self->simpleRepr();
2856 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2858 std::ostringstream oss;
2859 self->reprQuickOverview(oss);
2863 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2865 MEDCouplingUMesh *ret=self->getMesh2D();
2868 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2870 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2872 MEDCouplingUMesh *ret=self->getMesh1D();
2875 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2877 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2879 DataArrayInt *ret=self->getMesh3DIds();
2882 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2887 //== MEDCouplingMappedExtrudedMesh End
2889 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
2892 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2893 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2894 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2895 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2896 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2897 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2900 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2902 int szArr,sw,iTypppArr;
2903 std::vector<int> stdvecTyyppArr;
2904 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2905 self->insertNextCell(tmp,tmp+szArr);
2908 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2910 DataArrayInt *ret=self->getNodalConnectivity();
2911 if(ret) ret->incrRef();
2915 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2917 std::vector< const MEDCoupling1GTUMesh *> parts;
2918 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2919 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2924 //== MEDCoupling1SGTUMesh
2926 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
2929 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2930 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2931 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2932 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2933 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2934 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2935 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2936 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
2937 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
2940 MEDCoupling1SGTUMesh()
2942 return MEDCoupling1SGTUMesh::New();
2945 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2947 return MEDCoupling1SGTUMesh::New(name,type);
2950 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2952 return MEDCoupling1SGTUMesh::New(m);
2955 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2957 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
2960 std::string __str__() const throw(INTERP_KERNEL::Exception)
2962 return self->simpleRepr();
2965 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2967 std::ostringstream oss;
2968 self->reprQuickOverview(oss);
2972 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
2974 DataArrayInt *cellPerm(0),*nodePerm(0);
2975 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
2976 PyObject *ret(PyTuple_New(3));
2977 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
2978 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2979 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2983 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2985 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
2986 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2987 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2990 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2992 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
2993 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2994 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2999 //== MEDCoupling1SGTUMesh End
3001 //== MEDCoupling1DGTUMesh
3003 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3006 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3007 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3008 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3009 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3010 bool isPacked() const throw(INTERP_KERNEL::Exception);
3013 MEDCoupling1DGTUMesh()
3015 return MEDCoupling1DGTUMesh::New();
3017 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3019 return MEDCoupling1DGTUMesh::New(name,type);
3022 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3024 return MEDCoupling1DGTUMesh::New(m);
3027 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3029 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3032 std::string __str__() const throw(INTERP_KERNEL::Exception)
3034 return self->simpleRepr();
3037 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3039 std::ostringstream oss;
3040 self->reprQuickOverview(oss);
3044 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3046 DataArrayInt *ret=self->getNodalConnectivityIndex();
3047 if(ret) ret->incrRef();
3051 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3053 DataArrayInt *ret1=0,*ret2=0;
3054 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3055 PyObject *ret0Py=ret0?Py_True:Py_False;
3057 PyObject *ret=PyTuple_New(3);
3058 PyTuple_SetItem(ret,0,ret0Py);
3059 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3060 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3064 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3067 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3068 PyObject *ret=PyTuple_New(2);
3069 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3070 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3071 PyTuple_SetItem(ret,1,ret1Py);
3075 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3077 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3078 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3079 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3082 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3084 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3085 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3086 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3089 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3091 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3092 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3093 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3098 //== MEDCoupling1DGTUMeshEnd
3100 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3103 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3104 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3105 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3106 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3107 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3108 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3109 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3110 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3111 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3112 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3113 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3114 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3115 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3116 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3117 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3120 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3122 int tmpp1=-1,tmpp2=-1;
3123 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3124 std::vector< std::pair<int,int> > inp;
3128 for(int i=0;i<tmpp1;i++)
3129 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3134 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3135 inp.resize(tmpp1/2);
3136 for(int i=0;i<tmpp1/2;i++)
3137 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3140 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3141 return self->buildStructuredSubPart(inp);
3144 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3146 std::vector< std::pair<int,int> > inp;
3147 convertPyToVectorPairInt(part,inp);
3149 int szArr,sw,iTypppArr;
3150 std::vector<int> stdvecTyyppArr;
3151 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3152 std::vector<int> tmp5(tmp4,tmp4+szArr);
3154 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3157 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3159 std::vector< std::pair<int,int> > inp;
3160 convertPyToVectorPairInt(part,inp);
3161 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3164 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3166 std::vector< std::pair<int,int> > inp;
3167 convertPyToVectorPairInt(part,inp);
3168 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3171 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3173 std::vector< std::pair<int,int> > inp;
3174 convertPyToVectorPairInt(part,inp);
3175 std::vector<int> stWithGhost;
3176 std::vector< std::pair<int,int> > partWithGhost;
3177 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3178 PyObject *ret(PyTuple_New(2));
3179 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3180 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3184 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3186 std::vector< std::pair<int,int> > inp;
3187 convertPyToVectorPairInt(partCompactFormat,inp);
3188 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3191 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3193 std::vector< std::pair<int,int> > inp;
3194 convertPyToVectorPairInt(partCompactFormat,inp);
3195 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3198 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3200 std::vector< std::pair<int,int> > inp;
3201 convertPyToVectorPairInt(part,inp);
3202 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3205 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3207 int szArr,sw,iTypppArr;
3208 std::vector<int> stdvecTyyppArr;
3209 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3210 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3213 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3215 int szArr,sw,iTypppArr;
3216 std::vector<int> stdvecTyyppArr;
3217 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3218 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3221 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3223 std::vector< std::pair<int,int> > inp;
3224 convertPyToVectorPairInt(partCompactFormat,inp);
3225 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3228 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3230 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3231 PyObject *retPy=PyList_New(ret.size());
3232 for(std::size_t i=0;i<ret.size();i++)
3234 PyObject *tmp=PyTuple_New(2);
3235 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3236 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3237 PyList_SetItem(retPy,i,tmp);
3242 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3244 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3245 convertPyToVectorPairInt(r1,r1Cpp);
3246 convertPyToVectorPairInt(r2,r2Cpp);
3247 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3248 PyObject *retPy=PyList_New(ret.size());
3249 for(std::size_t i=0;i<ret.size();i++)
3251 PyObject *tmp=PyTuple_New(2);
3252 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3253 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3254 PyList_SetItem(retPy,i,tmp);
3259 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3261 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3262 convertPyToVectorPairInt(r1,r1Cpp);
3263 convertPyToVectorPairInt(r2,r2Cpp);
3264 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3267 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3269 int szArr,sw,iTypppArr;
3270 std::vector<int> stdvecTyyppArr;
3271 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3272 int szArr2,sw2,iTypppArr2;
3273 std::vector<int> stdvecTyyppArr2;
3274 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3275 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3276 std::vector< std::pair<int,int> > partCompactFormat;
3277 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3278 PyObject *ret=PyTuple_New(2);
3279 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3280 PyTuple_SetItem(ret,0,ret0Py);
3281 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3282 for(std::size_t i=0;i<partCompactFormat.size();i++)
3284 PyObject *tmp4=PyTuple_New(2);
3285 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3286 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3287 PyList_SetItem(ret1Py,i,tmp4);
3289 PyTuple_SetItem(ret,1,ret1Py);
3293 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3295 std::vector< std::pair<int,int> > param0,param1,ret;
3296 convertPyToVectorPairInt(bigInAbs,param0);
3297 convertPyToVectorPairInt(partOfBigInAbs,param1);
3298 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3299 PyObject *retPy(PyList_New(ret.size()));
3300 for(std::size_t i=0;i<ret.size();i++)
3302 PyObject *tmp(PyTuple_New(2));
3303 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3304 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3305 PyList_SetItem(retPy,i,tmp);
3310 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3312 std::vector< std::pair<int,int> > param0;
3313 convertPyToVectorPairInt(part,param0);
3314 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3315 PyObject *retPy(PyList_New(ret.size()));
3316 for(std::size_t i=0;i<ret.size();i++)
3318 PyObject *tmp(PyTuple_New(2));
3319 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3320 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3321 PyList_SetItem(retPy,i,tmp);
3326 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3328 std::vector< std::pair<int,int> > param0,param1;
3329 convertPyToVectorPairInt(startingFrom,param0);
3330 convertPyToVectorPairInt(goingTo,param1);
3331 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3334 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3336 std::vector< std::pair<int,int> > param0,param1,ret;
3337 convertPyToVectorPairInt(bigInAbs,param0);
3338 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3339 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3340 PyObject *retPy(PyList_New(ret.size()));
3341 for(std::size_t i=0;i<ret.size();i++)
3343 PyObject *tmp(PyTuple_New(2));
3344 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3345 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3346 PyList_SetItem(retPy,i,tmp);
3353 class MEDCouplingCurveLinearMesh;
3355 //== MEDCouplingCMesh
3357 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3360 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3361 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3362 void setCoords(const DataArrayDouble *coordsX,
3363 const DataArrayDouble *coordsY=0,
3364 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3365 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3366 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3368 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3370 return MEDCouplingCMesh::New();
3372 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3374 return MEDCouplingCMesh::New(meshName);
3377 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3379 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3381 std::string __str__() const throw(INTERP_KERNEL::Exception)
3383 return self->simpleRepr();
3385 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3387 std::ostringstream oss;
3388 self->reprQuickOverview(oss);
3391 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3393 DataArrayDouble *ret=self->getCoordsAt(i);
3401 //== MEDCouplingCMesh End
3403 //== MEDCouplingCurveLinearMesh
3405 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3408 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3409 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3410 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3412 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3414 return MEDCouplingCurveLinearMesh::New();
3416 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3418 return MEDCouplingCurveLinearMesh::New(meshName);
3420 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3422 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3424 std::string __str__() const throw(INTERP_KERNEL::Exception)
3426 return self->simpleRepr();
3428 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3430 std::ostringstream oss;
3431 self->reprQuickOverview(oss);
3434 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3436 DataArrayDouble *ret=self->getCoords();
3441 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3443 int szArr,sw,iTypppArr;
3444 std::vector<int> stdvecTyyppArr;
3445 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3446 self->setNodeGridStructure(tmp,tmp+szArr);
3451 //== MEDCouplingCurveLinearMesh End
3453 //== MEDCouplingIMesh
3455 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3458 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3460 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3461 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3462 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3463 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3464 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3465 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3466 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3467 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3468 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3469 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3470 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3475 return MEDCouplingIMesh::New();
3477 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3479 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3480 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3481 const int *nodeStrctPtr(0);
3482 const double *originPtr(0),*dxyzPtr(0);
3484 std::vector<int> bb0;
3485 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3488 std::vector<double> bb,bb2;
3490 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3491 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3493 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3496 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3498 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3501 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3503 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3506 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3509 std::vector<int> bb0;
3510 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3511 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3514 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3516 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3519 DataArrayDoubleTuple *aa;
3520 std::vector<double> bb;
3522 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3523 self->setOrigin(originPtr,originPtr+nbTuples);
3526 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3528 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3531 DataArrayDoubleTuple *aa;
3532 std::vector<double> bb;
3534 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3535 self->setDXYZ(originPtr,originPtr+nbTuples);
3538 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3540 std::vector< std::pair<int,int> > inp;
3541 convertPyToVectorPairInt(fineLocInCoarse,inp);
3542 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3545 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)
3547 std::vector< std::pair<int,int> > inp;
3548 convertPyToVectorPairInt(fineLocInCoarse,inp);
3549 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3552 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3554 std::vector< std::pair<int,int> > inp;
3555 convertPyToVectorPairInt(fineLocInCoarse,inp);
3556 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3559 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)
3561 std::vector< std::pair<int,int> > inp;
3562 convertPyToVectorPairInt(fineLocInCoarse,inp);
3563 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3566 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)
3568 std::vector< std::pair<int,int> > inp;
3569 convertPyToVectorPairInt(fineLocInCoarse,inp);
3570 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3573 std::string __str__() const throw(INTERP_KERNEL::Exception)
3575 return self->simpleRepr();
3577 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3579 std::ostringstream oss;
3580 self->reprQuickOverview(oss);
3586 //== MEDCouplingIMesh End
3590 namespace MEDCoupling
3592 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3595 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3596 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3597 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3598 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3599 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3600 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3601 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3602 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3603 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3604 std::string getName() const throw(INTERP_KERNEL::Exception);
3605 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3606 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3607 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3608 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3609 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3610 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3611 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3612 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3613 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3614 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3615 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3616 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3617 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3618 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3619 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3620 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3622 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3624 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3627 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3630 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3632 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3635 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3638 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3640 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3641 return convertIntArrToPyList3(ret);
3644 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3647 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3648 PyObject *ret=PyTuple_New(2);
3649 PyObject *ret0Py=ret0?Py_True:Py_False;
3651 PyTuple_SetItem(ret,0,ret0Py);
3652 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3656 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3658 DataArrayInt *ret1=0;
3659 MEDCouplingMesh *ret0=0;
3661 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3662 if (!SWIG_IsOK(res1))
3665 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3666 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3670 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3672 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3673 da2->checkAllocated();
3674 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3676 PyObject *res = PyList_New(2);
3677 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3678 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3682 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3684 DataArrayInt *ret1=0;
3686 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3687 PyObject *res=PyTuple_New(2);
3688 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3690 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3693 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3694 PyTuple_SetItem(res,1,res1);
3699 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3702 int v0; std::vector<int> v1;
3703 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3704 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3707 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3708 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3711 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3712 if (!SWIG_IsOK(res1))
3715 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3716 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3720 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3722 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3723 da2->checkAllocated();
3724 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3728 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3730 std::vector<int> tmp;
3731 self->getCellIdsHavingGaussLocalization(locId,tmp);
3732 DataArrayInt *ret=DataArrayInt::New();
3733 ret->alloc((int)tmp.size(),1);
3734 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3735 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3738 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3740 std::vector<int> inp0;
3741 convertPyToNewIntArr4(code,1,3,inp0);
3742 std::vector<const DataArrayInt *> inp1;
3743 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3744 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3749 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3752 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3753 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3754 static MEDCouplingFieldTemplate *New(TypeOfField type);
3755 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3756 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3759 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3761 return MEDCouplingFieldTemplate::New(f);
3764 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3766 return MEDCouplingFieldTemplate::New(f);
3769 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3771 return MEDCouplingFieldTemplate::New(type);
3774 std::string __str__() const throw(INTERP_KERNEL::Exception)
3776 return self->simpleRepr();
3779 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3781 std::ostringstream oss;
3782 self->reprQuickOverview(oss);
3788 class MEDCouplingFieldInt;
3790 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3793 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3794 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3795 void setTimeUnit(const std::string& unit);
3796 std::string getTimeUnit() const;
3797 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3798 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3799 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3800 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3801 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3802 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3803 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
3804 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3805 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3806 MEDCouplingFieldDouble *deepCopy() const;
3807 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
3808 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3809 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3810 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3811 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3812 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3813 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3814 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3815 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3816 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3817 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3818 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3819 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3820 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3821 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3822 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3823 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3824 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3825 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3826 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3827 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3828 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3829 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3830 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3831 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3832 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3833 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3834 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3835 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3836 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3837 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3838 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3839 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3840 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3841 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3842 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3843 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3844 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3845 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3846 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3847 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3848 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3849 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3850 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3851 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3852 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3853 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3854 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3855 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3856 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3857 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3858 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3859 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3860 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3861 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3862 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3863 double getMinValue() const throw(INTERP_KERNEL::Exception);
3864 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3865 double norm2() const throw(INTERP_KERNEL::Exception);
3866 double normMax() const throw(INTERP_KERNEL::Exception);
3867 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3868 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3869 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3870 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3871 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3872 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3873 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3874 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3875 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3876 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3877 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3878 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3879 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3880 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3881 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3882 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3883 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3884 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3885 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3886 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3887 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3888 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3890 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3892 return MEDCouplingFieldDouble::New(type,td);
3895 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3897 return MEDCouplingFieldDouble::New(ft,td);
3900 std::string __str__() const throw(INTERP_KERNEL::Exception)
3902 return self->simpleRepr();
3905 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3907 std::ostringstream oss;
3908 self->reprQuickOverview(oss);
3912 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3914 DataArrayDouble *ret=self->getArray();
3920 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3922 std::vector<DataArrayDouble *> arrs=self->getArrays();
3923 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3927 PyObject *ret=PyTuple_New(sz);
3928 for(int i=0;i<sz;i++)
3931 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3933 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
3938 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3940 std::vector<const DataArrayDouble *> tmp;
3941 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
3943 std::vector<DataArrayDouble *> arrs(sz);
3944 for(int i=0;i<sz;i++)
3945 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3946 self->setArrays(arrs);
3949 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3951 DataArrayDouble *ret=self->getEndArray();
3957 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3961 DataArrayDoubleTuple *aa;
3962 std::vector<double> bb;
3964 const MEDCouplingMesh *mesh=self->getMesh();
3966 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3967 int spaceDim=mesh->getSpaceDimension();
3968 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3969 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3971 int sz=self->getNumberOfComponents();
3972 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3973 self->getValueOn(spaceLoc,res);
3974 return convertDblArrToPyList(res,sz);
3977 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3979 int sz=self->getNumberOfComponents();
3980 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3981 self->getValueOnPos(i,j,k,res);
3982 return convertDblArrToPyList(res,sz);
3985 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3987 const MEDCouplingMesh *mesh(self->getMesh());
3989 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3992 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3993 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3994 mesh->getSpaceDimension(),true,nbPts);
3995 return self->getValueOnMulti(inp,nbPts);
3998 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4002 DataArrayDoubleTuple *aa;
4003 std::vector<double> bb;
4005 const MEDCouplingMesh *mesh=self->getMesh();
4007 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4008 int spaceDim=mesh->getSpaceDimension();
4009 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4010 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4013 int sz=self->getNumberOfComponents();
4014 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4015 self->getValueOn(spaceLoc,time,res);
4016 return convertDblArrToPyList(res,sz);
4019 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4021 if(self->getArray()!=0)
4022 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4025 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4026 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4027 self->setArray(arr);
4031 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4034 double tmp0=self->getTime(tmp1,tmp2);
4035 PyObject *res = PyList_New(3);
4036 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4037 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4038 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4042 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4045 double tmp0=self->getStartTime(tmp1,tmp2);
4046 PyObject *res = PyList_New(3);
4047 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4048 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4049 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4053 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4056 double tmp0=self->getEndTime(tmp1,tmp2);
4057 PyObject *res = PyList_New(3);
4058 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4059 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4060 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4063 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4065 int sz=self->getNumberOfComponents();
4066 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4067 self->accumulate(tmp);
4068 return convertDblArrToPyList(tmp,sz);
4070 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4072 int sz=self->getNumberOfComponents();
4073 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4074 self->integral(isWAbs,tmp);
4075 return convertDblArrToPyList(tmp,sz);
4077 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4079 int sz=self->getNumberOfComponents();
4080 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4081 self->getWeightedAverageValue(tmp,isWAbs);
4082 return convertDblArrToPyList(tmp,sz);
4084 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4086 int sz=self->getNumberOfComponents();
4087 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4089 return convertDblArrToPyList(tmp,sz);
4091 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4093 int sz=self->getNumberOfComponents();
4094 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4096 return convertDblArrToPyList(tmp,sz);
4098 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4100 int szArr,sw,iTypppArr;
4101 std::vector<int> stdvecTyyppArr;
4102 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4103 self->renumberCells(tmp,check);
4106 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4108 int szArr,sw,iTypppArr;
4109 std::vector<int> stdvecTyyppArr;
4110 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4111 self->renumberCellsWithoutMesh(tmp,check);
4114 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4116 int szArr,sw,iTypppArr;
4117 std::vector<int> stdvecTyyppArr;
4118 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4119 self->renumberNodes(tmp,eps);
4122 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4124 int szArr,sw,iTypppArr;
4125 std::vector<int> stdvecTyyppArr;
4126 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4127 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4130 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4134 std::vector<int> multiVal;
4135 std::pair<int, std::pair<int,int> > slic;
4136 MEDCoupling::DataArrayInt *daIntTyypp=0;
4137 const MEDCouplingMesh *mesh=self->getMesh();
4139 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4140 int nbc=mesh->getNumberOfCells();
4141 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4148 std::ostringstream oss;
4149 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4150 throw INTERP_KERNEL::Exception(oss.str().c_str());
4153 return self->buildSubPart(&singleVal,&singleVal+1);
4158 int tmp=nbc+singleVal;
4159 return self->buildSubPart(&tmp,&tmp+1);
4163 std::ostringstream oss;
4164 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4165 throw INTERP_KERNEL::Exception(oss.str().c_str());
4171 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4175 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4180 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4181 daIntTyypp->checkAllocated();
4182 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4185 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4189 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4191 const char msg[]="MEDCouplingFieldDouble::__getitem__ : invalid call Available API are : \n-myField[dataArrayInt]\n-myField[slice]\n-myField[pythonListOfCellIds]\n-myField[integer]\n-myField[dataArrayInt,1]\n-myField[slice,1]\n-myField[pythonListOfCellIds,1]\n-myField[integer,1]\n";
4192 if(PyTuple_Check(li))
4194 Py_ssize_t sz=PyTuple_Size(li);
4196 throw INTERP_KERNEL::Exception(msg);
4197 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4200 std::vector<int> multiVal;
4201 std::pair<int, std::pair<int,int> > slic;
4202 MEDCoupling::DataArrayInt *daIntTyypp=0;
4203 if(!self->getArray())
4204 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4206 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4207 catch(INTERP_KERNEL::Exception& e)
4208 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4209 MCAuto<MEDCouplingFieldDouble> ret0=MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4210 DataArrayDouble *ret0Arr=ret0->getArray();
4212 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4217 std::vector<int> v2(1,singleVal);
4218 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4219 ret0->setArray(aarr);
4224 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4225 ret0->setArray(aarr);
4230 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4231 std::vector<int> v2(nbOfComp);
4232 for(int i=0;i<nbOfComp;i++)
4233 v2[i]=slic.first+i*slic.second.second;
4234 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4235 ret0->setArray(aarr);
4239 throw INTERP_KERNEL::Exception(msg);
4244 return MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,li);
4247 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4250 double r1=self->getMaxValue2(tmp);
4251 PyObject *ret=PyTuple_New(2);
4252 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4253 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4257 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4260 double r1=self->getMinValue2(tmp);
4261 PyObject *ret=PyTuple_New(2);
4262 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4263 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4267 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4269 std::vector<int> tmp;
4270 convertPyToNewIntArr3(li,tmp);
4271 return self->keepSelectedComponents(tmp);
4274 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4276 std::vector<int> tmp;
4277 convertPyToNewIntArr3(li,tmp);
4278 self->setSelectedComponents(f,tmp);
4281 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4284 DataArrayDouble *a,*a2;
4285 DataArrayDoubleTuple *aa,*aa2;
4286 std::vector<double> bb,bb2;
4289 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4290 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4291 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4292 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4294 return self->extractSlice3D(orig,vect,eps);
4297 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4299 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4302 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4304 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4307 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4309 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.";
4310 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4313 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4315 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4317 return (*self)-(*other);
4319 throw INTERP_KERNEL::Exception(msg);
4324 DataArrayDoubleTuple *aa;
4325 std::vector<double> bb;
4327 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4332 if(!self->getArray())
4333 throw INTERP_KERNEL::Exception(msg2);
4334 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4335 ret->applyLin(1.,-val);
4336 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4337 ret2->setArray(ret);
4342 if(!self->getArray())
4343 throw INTERP_KERNEL::Exception(msg2);
4344 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4345 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4346 ret2->setArray(ret);
4351 if(!self->getArray())
4352 throw INTERP_KERNEL::Exception(msg2);
4353 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4354 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4355 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4356 ret2->setArray(ret);
4361 if(!self->getArray())
4362 throw INTERP_KERNEL::Exception(msg2);
4363 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4364 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4365 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4366 ret2->setArray(ret);
4370 { throw INTERP_KERNEL::Exception(msg); }
4374 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4376 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4379 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4381 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4384 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4386 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4389 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4391 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.";
4392 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4395 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4397 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4399 return (*self)/(*other);
4401 throw INTERP_KERNEL::Exception(msg);
4406 DataArrayDoubleTuple *aa;
4407 std::vector<double> bb;
4409 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4415 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4416 if(!self->getArray())
4417 throw INTERP_KERNEL::Exception(msg2);
4418 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4419 ret->applyLin(1./val,0);
4420 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4421 ret2->setArray(ret);
4426 if(!self->getArray())
4427 throw INTERP_KERNEL::Exception(msg2);
4428 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4429 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4430 ret2->setArray(ret);
4435 if(!self->getArray())
4436 throw INTERP_KERNEL::Exception(msg2);
4437 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4438 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4439 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4440 ret2->setArray(ret);
4445 if(!self->getArray())
4446 throw INTERP_KERNEL::Exception(msg2);
4447 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4448 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4449 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4450 ret2->setArray(ret);
4454 { throw INTERP_KERNEL::Exception(msg); }
4458 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4460 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4463 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4465 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.";
4466 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4469 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4471 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4473 return (*self)^(*other);
4475 throw INTERP_KERNEL::Exception(msg);
4480 DataArrayDoubleTuple *aa;
4481 std::vector<double> bb;
4483 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4488 if(!self->getArray())
4489 throw INTERP_KERNEL::Exception(msg2);
4490 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4492 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4493 ret2->setArray(ret);
4498 if(!self->getArray())
4499 throw INTERP_KERNEL::Exception(msg2);
4500 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4501 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4502 ret2->setArray(ret);
4507 if(!self->getArray())
4508 throw INTERP_KERNEL::Exception(msg2);
4509 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4510 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4511 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4512 ret2->setArray(ret);
4517 if(!self->getArray())
4518 throw INTERP_KERNEL::Exception(msg2);
4519 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4520 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4521 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4522 ret2->setArray(ret);
4526 { throw INTERP_KERNEL::Exception(msg); }
4530 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4532 return self->negate();
4535 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4537 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.";
4538 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4541 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4543 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4547 Py_XINCREF(trueSelf);
4551 throw INTERP_KERNEL::Exception(msg);
4556 DataArrayDoubleTuple *aa;
4557 std::vector<double> bb;
4559 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4564 if(!self->getArray())
4565 throw INTERP_KERNEL::Exception(msg2);
4566 self->getArray()->applyLin(1.,val);
4567 Py_XINCREF(trueSelf);
4572 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4575 Py_XINCREF(trueSelf);
4580 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4581 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4582 ret2->setArray(aaa);
4584 Py_XINCREF(trueSelf);
4589 if(!self->getArray())
4590 throw INTERP_KERNEL::Exception(msg2);
4591 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4592 self->getArray()->addEqual(aaa);
4593 Py_XINCREF(trueSelf);
4597 { throw INTERP_KERNEL::Exception(msg); }
4601 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4603 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.";
4604 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4607 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4609 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4613 Py_XINCREF(trueSelf);
4617 throw INTERP_KERNEL::Exception(msg);
4622 DataArrayDoubleTuple *aa;
4623 std::vector<double> bb;
4625 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4630 if(!self->getArray())
4631 throw INTERP_KERNEL::Exception(msg2);
4632 self->getArray()->applyLin(1.,-val);
4633 Py_XINCREF(trueSelf);
4638 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4641 Py_XINCREF(trueSelf);
4646 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4647 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4648 ret2->setArray(aaa);
4650 Py_XINCREF(trueSelf);
4655 if(!self->getArray())
4656 throw INTERP_KERNEL::Exception(msg2);
4657 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4658 self->getArray()->substractEqual(aaa);
4659 Py_XINCREF(trueSelf);
4663 { throw INTERP_KERNEL::Exception(msg); }
4667 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4669 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.";
4670 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4673 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4675 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4679 Py_XINCREF(trueSelf);
4683 throw INTERP_KERNEL::Exception(msg);
4688 DataArrayDoubleTuple *aa;
4689 std::vector<double> bb;
4691 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4696 if(!self->getArray())
4697 throw INTERP_KERNEL::Exception(msg2);
4698 self->getArray()->applyLin(val,0);
4699 Py_XINCREF(trueSelf);
4704 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4707 Py_XINCREF(trueSelf);
4712 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4713 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4714 ret2->setArray(aaa);
4716 Py_XINCREF(trueSelf);
4721 if(!self->getArray())
4722 throw INTERP_KERNEL::Exception(msg2);
4723 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4724 self->getArray()->multiplyEqual(aaa);
4725 Py_XINCREF(trueSelf);
4729 { throw INTERP_KERNEL::Exception(msg); }
4733 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4735 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.";
4736 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4739 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4741 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4745 Py_XINCREF(trueSelf);
4749 throw INTERP_KERNEL::Exception(msg);
4754 DataArrayDoubleTuple *aa;
4755 std::vector<double> bb;
4757 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4763 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4764 if(!self->getArray())
4765 throw INTERP_KERNEL::Exception(msg2);
4766 self->getArray()->applyLin(1./val,0);
4767 Py_XINCREF(trueSelf);
4772 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4775 Py_XINCREF(trueSelf);
4780 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4781 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4782 ret2->setArray(aaa);
4784 Py_XINCREF(trueSelf);
4789 if(!self->getArray())
4790 throw INTERP_KERNEL::Exception(msg2);
4791 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4792 self->getArray()->divideEqual(aaa);
4793 Py_XINCREF(trueSelf);
4797 { throw INTERP_KERNEL::Exception(msg); }
4801 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4803 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.";
4804 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4807 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4809 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4813 Py_XINCREF(trueSelf);
4817 throw INTERP_KERNEL::Exception(msg);
4822 DataArrayDoubleTuple *aa;
4823 std::vector<double> bb;
4825 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4830 if(!self->getArray())
4831 throw INTERP_KERNEL::Exception(msg2);
4832 self->getArray()->applyPow(val);
4833 Py_XINCREF(trueSelf);
4838 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4841 Py_XINCREF(trueSelf);
4846 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4847 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4848 ret2->setArray(aaa);
4850 Py_XINCREF(trueSelf);
4855 if(!self->getArray())
4856 throw INTERP_KERNEL::Exception(msg2);
4857 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4858 self->getArray()->powEqual(aaa);
4859 Py_XINCREF(trueSelf);
4863 { throw INTERP_KERNEL::Exception(msg); }
4867 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4869 std::vector<const MEDCouplingFieldDouble *> tmp;
4870 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4871 return MEDCouplingFieldDouble::MergeFields(tmp);
4874 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4876 std::vector<const MEDCouplingFieldDouble *> tmp;
4877 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4878 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4881 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4883 std::vector<double> a0;
4884 std::vector<int> a1;
4885 std::vector<std::string> a2;
4886 self->getTinySerializationDbleInformation(a0);
4887 self->getTinySerializationIntInformation(a1);
4888 self->getTinySerializationStrInformation(a2);
4890 PyObject *ret(PyTuple_New(3));
4891 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4892 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
4894 PyObject *ret2(PyList_New(sz));
4896 for(int i=0;i<sz;i++)
4897 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
4899 PyTuple_SetItem(ret,2,ret2);
4903 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
4905 DataArrayInt *ret0(0);
4906 std::vector<DataArrayDouble *> ret1;
4907 self->serialize(ret0,ret1);
4910 std::size_t sz(ret1.size());
4911 PyObject *ret(PyTuple_New(2));
4912 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4913 PyObject *ret1Py(PyList_New(sz));
4914 for(std::size_t i=0;i<sz;i++)
4918 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4920 PyTuple_SetItem(ret,1,ret1Py);
4924 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
4926 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
4927 if(!PyTuple_Check(args))
4928 throw INTERP_KERNEL::Exception(MSG);
4929 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
4930 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
4931 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
4933 PyObject *tmp0(PyTuple_New(1));
4934 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
4935 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
4937 Py_DECREF(selfMeth);
4938 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
4939 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
4940 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
4942 PyObject *a(PyInt_FromLong(0));
4943 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
4946 throw INTERP_KERNEL::Exception(MSG);
4947 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
4948 throw INTERP_KERNEL::Exception(MSG);
4949 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
4952 Py_DECREF(initMeth);
4957 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
4958 {// put an empty dict in input to say to __new__ to call __init__...
4959 self->checkConsistencyLight();
4960 PyObject *ret(PyTuple_New(1));
4961 PyObject *ret0(PyDict_New());
4963 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
4964 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
4965 PyDict_SetItem(ret0,a,d);
4966 Py_DECREF(a); Py_DECREF(d);
4968 PyTuple_SetItem(ret,0,ret0);
4972 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
4974 self->checkConsistencyLight();
4975 PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
4976 PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
4977 const MEDCouplingMesh *mesh(self->getMesh());
4980 PyObject *ret(PyTuple_New(3));
4981 PyTuple_SetItem(ret,0,ret0);
4982 PyTuple_SetItem(ret,1,ret1);
4983 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
4987 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
4989 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
4990 if(!PyTuple_Check(inp))
4991 throw INTERP_KERNEL::Exception(MSG);
4992 int sz(PyTuple_Size(inp));
4994 throw INTERP_KERNEL::Exception(MSG);
4996 PyObject *elt2(PyTuple_GetItem(inp,2));
4998 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
4999 if(!SWIG_IsOK(status))
5000 throw INTERP_KERNEL::Exception(MSG);
5001 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
5003 PyObject *elt0(PyTuple_GetItem(inp,0));
5004 PyObject *elt1(PyTuple_GetItem(inp,1));
5005 std::vector<double> a0;
5006 std::vector<int> a1;
5007 std::vector<std::string> a2;
5008 DataArrayInt *b0(0);
5009 std::vector<DataArrayDouble *>b1;
5011 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5012 throw INTERP_KERNEL::Exception(MSG);
5013 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5015 fillArrayWithPyListDbl3(a0py,tmp,a0);
5016 convertPyToNewIntArr3(a1py,a1);
5017 fillStringVector(a2py,a2);
5020 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5021 throw INTERP_KERNEL::Exception(MSG);
5022 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5024 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5025 if(!SWIG_IsOK(status))
5026 throw INTERP_KERNEL::Exception(MSG);
5027 b0=reinterpret_cast<DataArrayInt *>(argp);
5028 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5030 self->checkForUnserialization(a1,b0,b1);
5031 // useless here to call resizeForUnserialization because arrays are well resized.
5032 self->finishUnserialization(a1,a0,a2);
5037 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5040 int getNumberOfFields() const;
5041 MEDCouplingMultiFields *deepCopy() const;
5042 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5043 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5044 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5045 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5046 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5049 std::string __str__() const throw(INTERP_KERNEL::Exception)
5051 return self->simpleRepr();
5053 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5055 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5056 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5058 std::vector<MEDCouplingFieldDouble *> fs(sz);
5059 for(int i=0;i<sz;i++)
5060 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5061 return MEDCouplingMultiFields::New(fs);
5063 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5065 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5066 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5068 std::vector<MEDCouplingFieldDouble *> fs(sz);
5069 for(int i=0;i<sz;i++)
5070 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5071 return MEDCouplingMultiFields::New(fs);
5073 PyObject *getFields() const
5075 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5076 int sz=fields.size();
5077 PyObject *res = PyList_New(sz);
5078 for(int i=0;i<sz;i++)
5082 fields[i]->incrRef();
5083 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5087 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5092 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5094 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5098 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5101 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5103 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5105 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5107 PyObject *res = PyList_New(sz);
5108 for(int i=0;i<sz;i++)
5113 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5117 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5122 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5124 std::vector<int> refs;
5125 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5127 PyObject *res = PyList_New(sz);
5128 for(int i=0;i<sz;i++)
5133 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5137 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5141 PyObject *ret=PyTuple_New(2);
5142 PyTuple_SetItem(ret,0,res);
5143 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5146 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5148 std::vector<DataArrayDouble *> ms=self->getArrays();
5150 PyObject *res = PyList_New(sz);
5151 for(int i=0;i<sz;i++)
5156 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5160 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5165 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5167 std::vector< std::vector<int> > refs;
5168 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5170 PyObject *res = PyList_New(sz);
5171 PyObject *res2 = PyList_New(sz);
5172 for(int i=0;i<sz;i++)
5177 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5181 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5183 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5186 PyObject *ret=PyTuple_New(2);
5187 PyTuple_SetItem(ret,0,res);
5188 PyTuple_SetItem(ret,1,res2);
5194 class MEDCouplingFieldInt : public MEDCouplingField
5197 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5198 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5199 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5200 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5201 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5202 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5203 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5204 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5205 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5206 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5208 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5210 return MEDCouplingFieldInt::New(type,td);
5213 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5215 return MEDCouplingFieldInt::New(ft,td);
5218 std::string __str__() const throw(INTERP_KERNEL::Exception)
5220 return self->simpleRepr();
5223 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5225 std::ostringstream oss;
5226 self->reprQuickOverview(oss);
5230 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5232 DataArrayInt *ret=self->getArray();
5238 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5241 double tmp0=self->getTime(tmp1,tmp2);
5242 PyObject *res = PyList_New(3);
5243 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5244 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5245 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5251 class MEDCouplingDefinitionTime
5254 MEDCouplingDefinitionTime();
5255 void assign(const MEDCouplingDefinitionTime& other);
5256 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5257 double getTimeResolution() const;
5258 std::vector<double> getHotSpotsTime() const;
5261 std::string __str__() const throw(INTERP_KERNEL::Exception)
5263 std::ostringstream oss;
5264 self->appendRepr(oss);
5268 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5270 int meshId,arrId,arrIdInField,fieldId;
5271 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5272 PyObject *res=PyList_New(4);
5273 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5274 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5275 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5276 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5280 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5282 int meshId,arrId,arrIdInField,fieldId;
5283 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5284 PyObject *res=PyList_New(4);
5285 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5286 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5287 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5288 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5294 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5297 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5298 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5302 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5304 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5305 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5307 std::vector<MEDCouplingFieldDouble *> fs(sz);
5308 for(int i=0;i<sz;i++)
5309 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5310 return MEDCouplingFieldOverTime::New(fs);
5312 std::string __str__() const throw(INTERP_KERNEL::Exception)
5314 return self->simpleRepr();
5316 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5318 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5319 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5321 std::vector<MEDCouplingFieldDouble *> fs(sz);
5322 for(int i=0;i<sz;i++)
5323 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5324 return MEDCouplingFieldOverTime::New(fs);
5329 class MEDCouplingCartesianAMRMesh;
5331 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5334 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5335 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5336 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5339 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5341 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5349 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5352 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5353 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5354 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5357 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5359 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5360 return convertFromVectorPairInt(ret);
5363 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5365 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5366 return convertFromVectorPairInt(ret);
5369 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5371 std::vector< std::pair<int,int> > inp;
5372 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5373 self->addPatch(inp,factors);
5376 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5378 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5380 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5381 if(patchId==mesh->getNumberOfPatches())
5383 std::ostringstream oss;
5384 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5385 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5388 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5394 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5396 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5398 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5399 mesh->removePatch(patchId);
5402 int __len__() const throw(INTERP_KERNEL::Exception)
5404 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5406 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5407 return mesh->getNumberOfPatches();
5412 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5416 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5419 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5420 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5421 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5422 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5423 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5424 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5425 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5426 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5427 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5428 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5429 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5430 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5431 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5433 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5434 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5435 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5436 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5437 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5438 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5439 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5440 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5441 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5442 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5443 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5444 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5445 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5446 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5447 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5448 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5449 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5450 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5451 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5452 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5455 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5457 std::vector< std::pair<int,int> > inp;
5458 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5459 self->addPatch(inp,factors);
5462 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5464 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5466 PyObject *ret = PyList_New(sz);
5467 for(int i=0;i<sz;i++)
5469 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5472 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5477 // agy : don't know why typemap fails here ??? let it in the extend section
5478 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5480 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5483 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5485 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5486 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5492 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5494 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5495 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5501 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5503 std::vector<int> out1;
5504 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5505 PyObject *ret(PyTuple_New(2));
5506 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5507 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5511 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5513 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5515 PyObject *ret = PyList_New(sz);
5516 for(int i=0;i<sz;i++)
5517 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5521 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5523 std::vector<const DataArrayDouble *> inp;
5524 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5525 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5528 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5530 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5536 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5538 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5544 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5546 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5552 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5554 const MEDCouplingIMesh *ret(self->getImageMesh());
5557 return const_cast<MEDCouplingIMesh *>(ret);
5560 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5562 if(patchId==self->getNumberOfPatches())
5564 std::ostringstream oss;
5565 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5566 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5569 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5575 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5577 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5578 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5579 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5582 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5584 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5585 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5586 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5589 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5591 self->removePatch(patchId);
5594 int __len__() const throw(INTERP_KERNEL::Exception)
5596 return self->getNumberOfPatches();
5601 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5605 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5608 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5611 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5613 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5614 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5615 const int *nodeStrctPtr(0);
5616 const double *originPtr(0),*dxyzPtr(0);
5618 std::vector<int> bb0;
5619 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5622 std::vector<double> bb,bb2;
5624 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5625 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5627 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5630 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5632 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5633 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5634 std::vector< std::vector<int> > inp2;
5635 convertPyToVectorOfVectorOfInt(factors,inp2);
5636 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5639 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5641 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5644 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5646 return MEDCouplingCartesianAMRMesh::New(mesh);
5651 class MEDCouplingDataForGodFather : public RefCountObject
5654 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5655 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5656 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5657 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5658 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5659 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5660 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5661 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5662 virtual void alloc() throw(INTERP_KERNEL::Exception);
5663 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5666 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5668 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5676 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5679 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5680 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5681 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5682 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5683 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5684 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5685 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5686 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5687 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5690 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5692 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5693 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5694 MEDCouplingAMRAttribute *ret(0);
5697 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5698 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5700 catch(INTERP_KERNEL::Exception&)
5702 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5703 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5708 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5710 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5713 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5715 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5716 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5722 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5724 std::vector< std::vector<std::string> > compNamesCpp;
5725 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5726 self->spillInfoOnComponents(compNamesCpp);
5729 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5731 std::vector<int> inp0;
5732 if(!fillIntVector(nfs,inp0))
5733 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5734 std::size_t sz(inp0.size());
5735 std::vector<NatureOfField> inp00(sz);
5736 for(std::size_t i=0;i<sz;i++)
5737 inp00[i]=(NatureOfField)inp0[i];
5738 self->spillNatures(inp00);
5741 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5743 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5744 int sz((int)ret.size());
5745 PyObject *retPy(PyList_New(sz));
5746 for(int i=0;i<sz;i++)
5747 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5753 class DenseMatrix : public RefCountObject, public TimeLabel
5756 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5757 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5758 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5759 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5761 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5762 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5763 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5764 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5765 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5766 void transpose() throw(INTERP_KERNEL::Exception);
5768 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5769 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5770 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5773 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5775 return DenseMatrix::New(nbRows,nbCols);
5778 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5780 return DenseMatrix::New(array,nbRows,nbCols);
5783 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5786 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5787 PyObject *ret=PyTuple_New(2);
5788 PyObject *ret0Py=ret0?Py_True:Py_False;
5790 PyTuple_SetItem(ret,0,ret0Py);
5791 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5795 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5797 DataArrayDouble *ret(self->getData());
5803 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5805 return MEDCoupling::DenseMatrix::Add(self,other);
5808 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5810 return MEDCoupling::DenseMatrix::Substract(self,other);
5813 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5815 return MEDCoupling::DenseMatrix::Multiply(self,other);
5818 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5820 return MEDCoupling::DenseMatrix::Multiply(self,other);
5823 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5825 self->addEqual(other);
5826 Py_XINCREF(trueSelf);
5830 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5832 self->substractEqual(other);
5833 Py_XINCREF(trueSelf);
5837 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5839 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5846 class PartDefinition : public RefCountObject, public TimeLabel
5849 static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5850 static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5851 virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
5852 virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
5853 virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
5854 virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
5855 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5856 virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
5859 virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
5861 return (*self)+other;
5864 virtual PyObject *isEqual(const PartDefinition *other) const throw(INTERP_KERNEL::Exception)
5867 bool ret0(self->isEqual(other,ret1));
5868 PyObject *ret=PyTuple_New(2);
5869 PyObject *ret0Py=ret0?Py_True:Py_False;
5871 PyTuple_SetItem(ret,0,ret0Py);
5872 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5876 virtual PyObject *deepCopy() const throw(INTERP_KERNEL::Exception)
5878 return convertPartDefinition(self->deepCopy(),SWIG_POINTER_OWN | 0);
5882 virtual ~PartDefinition();
5885 class DataArrayPartDefinition : public PartDefinition
5888 static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5891 DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
5893 return DataArrayPartDefinition::New(listOfIds);
5896 std::string __str__() const throw(INTERP_KERNEL::Exception)
5898 return self->getRepr();
5901 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5903 std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
5904 oss << self->getRepr();
5909 virtual ~DataArrayPartDefinition();
5912 class SlicePartDefinition : public PartDefinition
5915 static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5916 int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
5919 SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
5921 return SlicePartDefinition::New(start,stop,step);
5924 PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
5927 self->getSlice(a,b,c);
5928 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
5931 std::string __str__() const throw(INTERP_KERNEL::Exception)
5933 return self->getRepr();
5936 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5938 std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
5939 oss << self->getRepr();
5944 virtual ~SlicePartDefinition();
5950 __filename=os.environ.get('PYTHONSTARTUP')
5951 if __filename and os.path.isfile(__filename):
5952 execfile(__filename)