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);
2830 int get2DCellIdForExtrusion() const;
2832 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2834 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2837 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
2839 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
2842 MEDCouplingMappedExtrudedMesh()
2844 return MEDCouplingMappedExtrudedMesh::New();
2847 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2849 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
2852 std::string __str__() const throw(INTERP_KERNEL::Exception)
2854 return self->simpleRepr();
2857 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2859 std::ostringstream oss;
2860 self->reprQuickOverview(oss);
2864 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2866 MEDCouplingUMesh *ret=self->getMesh2D();
2869 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2871 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2873 MEDCouplingUMesh *ret=self->getMesh1D();
2876 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2878 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2880 DataArrayInt *ret=self->getMesh3DIds();
2883 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2888 //== MEDCouplingMappedExtrudedMesh End
2890 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
2893 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2894 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2895 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2896 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2897 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2898 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2901 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2903 int szArr,sw,iTypppArr;
2904 std::vector<int> stdvecTyyppArr;
2905 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2906 self->insertNextCell(tmp,tmp+szArr);
2909 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2911 DataArrayInt *ret=self->getNodalConnectivity();
2912 if(ret) ret->incrRef();
2916 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2918 std::vector< const MEDCoupling1GTUMesh *> parts;
2919 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2920 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2925 //== MEDCoupling1SGTUMesh
2927 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
2930 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2931 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2932 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2933 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2934 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2935 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2936 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2937 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
2938 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
2941 MEDCoupling1SGTUMesh()
2943 return MEDCoupling1SGTUMesh::New();
2946 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2948 return MEDCoupling1SGTUMesh::New(name,type);
2951 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2953 return MEDCoupling1SGTUMesh::New(m);
2956 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2958 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
2961 std::string __str__() const throw(INTERP_KERNEL::Exception)
2963 return self->simpleRepr();
2966 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2968 std::ostringstream oss;
2969 self->reprQuickOverview(oss);
2973 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
2975 DataArrayInt *cellPerm(0),*nodePerm(0);
2976 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
2977 PyObject *ret(PyTuple_New(3));
2978 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
2979 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2980 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2984 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2986 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
2987 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2988 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2991 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2993 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
2994 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2995 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3000 //== MEDCoupling1SGTUMesh End
3002 //== MEDCoupling1DGTUMesh
3004 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3007 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3008 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3009 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3010 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3011 bool isPacked() const throw(INTERP_KERNEL::Exception);
3014 MEDCoupling1DGTUMesh()
3016 return MEDCoupling1DGTUMesh::New();
3018 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3020 return MEDCoupling1DGTUMesh::New(name,type);
3023 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3025 return MEDCoupling1DGTUMesh::New(m);
3028 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3030 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3033 std::string __str__() const throw(INTERP_KERNEL::Exception)
3035 return self->simpleRepr();
3038 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3040 std::ostringstream oss;
3041 self->reprQuickOverview(oss);
3045 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3047 DataArrayInt *ret=self->getNodalConnectivityIndex();
3048 if(ret) ret->incrRef();
3052 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3054 DataArrayInt *ret1=0,*ret2=0;
3055 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3056 PyObject *ret0Py=ret0?Py_True:Py_False;
3058 PyObject *ret=PyTuple_New(3);
3059 PyTuple_SetItem(ret,0,ret0Py);
3060 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3061 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3065 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3068 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3069 PyObject *ret=PyTuple_New(2);
3070 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3071 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3072 PyTuple_SetItem(ret,1,ret1Py);
3076 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3078 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3079 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3080 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3083 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3085 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3086 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3087 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3090 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3092 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3093 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3094 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3099 //== MEDCoupling1DGTUMeshEnd
3101 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3104 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3105 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3106 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3107 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3108 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3109 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3110 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3111 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3112 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3113 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3114 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3115 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3116 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3117 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3118 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3121 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3123 int tmpp1=-1,tmpp2=-1;
3124 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3125 std::vector< std::pair<int,int> > inp;
3129 for(int i=0;i<tmpp1;i++)
3130 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3135 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3136 inp.resize(tmpp1/2);
3137 for(int i=0;i<tmpp1/2;i++)
3138 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3141 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3142 return self->buildStructuredSubPart(inp);
3145 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3147 std::vector< std::pair<int,int> > inp;
3148 convertPyToVectorPairInt(part,inp);
3150 int szArr,sw,iTypppArr;
3151 std::vector<int> stdvecTyyppArr;
3152 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3153 std::vector<int> tmp5(tmp4,tmp4+szArr);
3155 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3158 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3160 std::vector< std::pair<int,int> > inp;
3161 convertPyToVectorPairInt(part,inp);
3162 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3165 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3167 std::vector< std::pair<int,int> > inp;
3168 convertPyToVectorPairInt(part,inp);
3169 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3172 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3174 std::vector< std::pair<int,int> > inp;
3175 convertPyToVectorPairInt(part,inp);
3176 std::vector<int> stWithGhost;
3177 std::vector< std::pair<int,int> > partWithGhost;
3178 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3179 PyObject *ret(PyTuple_New(2));
3180 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3181 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3185 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3187 std::vector< std::pair<int,int> > inp;
3188 convertPyToVectorPairInt(partCompactFormat,inp);
3189 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3192 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3194 std::vector< std::pair<int,int> > inp;
3195 convertPyToVectorPairInt(partCompactFormat,inp);
3196 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3199 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3201 std::vector< std::pair<int,int> > inp;
3202 convertPyToVectorPairInt(part,inp);
3203 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3206 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3208 int szArr,sw,iTypppArr;
3209 std::vector<int> stdvecTyyppArr;
3210 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3211 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3214 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3216 int szArr,sw,iTypppArr;
3217 std::vector<int> stdvecTyyppArr;
3218 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3219 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3222 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3224 std::vector< std::pair<int,int> > inp;
3225 convertPyToVectorPairInt(partCompactFormat,inp);
3226 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3229 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3231 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3232 PyObject *retPy=PyList_New(ret.size());
3233 for(std::size_t i=0;i<ret.size();i++)
3235 PyObject *tmp=PyTuple_New(2);
3236 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3237 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3238 PyList_SetItem(retPy,i,tmp);
3243 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3245 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3246 convertPyToVectorPairInt(r1,r1Cpp);
3247 convertPyToVectorPairInt(r2,r2Cpp);
3248 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3249 PyObject *retPy=PyList_New(ret.size());
3250 for(std::size_t i=0;i<ret.size();i++)
3252 PyObject *tmp=PyTuple_New(2);
3253 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3254 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3255 PyList_SetItem(retPy,i,tmp);
3260 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3262 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3263 convertPyToVectorPairInt(r1,r1Cpp);
3264 convertPyToVectorPairInt(r2,r2Cpp);
3265 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3268 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3270 int szArr,sw,iTypppArr;
3271 std::vector<int> stdvecTyyppArr;
3272 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3273 int szArr2,sw2,iTypppArr2;
3274 std::vector<int> stdvecTyyppArr2;
3275 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3276 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3277 std::vector< std::pair<int,int> > partCompactFormat;
3278 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3279 PyObject *ret=PyTuple_New(2);
3280 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3281 PyTuple_SetItem(ret,0,ret0Py);
3282 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3283 for(std::size_t i=0;i<partCompactFormat.size();i++)
3285 PyObject *tmp4=PyTuple_New(2);
3286 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3287 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3288 PyList_SetItem(ret1Py,i,tmp4);
3290 PyTuple_SetItem(ret,1,ret1Py);
3294 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3296 std::vector< std::pair<int,int> > param0,param1,ret;
3297 convertPyToVectorPairInt(bigInAbs,param0);
3298 convertPyToVectorPairInt(partOfBigInAbs,param1);
3299 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3300 PyObject *retPy(PyList_New(ret.size()));
3301 for(std::size_t i=0;i<ret.size();i++)
3303 PyObject *tmp(PyTuple_New(2));
3304 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3305 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3306 PyList_SetItem(retPy,i,tmp);
3311 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3313 std::vector< std::pair<int,int> > param0;
3314 convertPyToVectorPairInt(part,param0);
3315 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3316 PyObject *retPy(PyList_New(ret.size()));
3317 for(std::size_t i=0;i<ret.size();i++)
3319 PyObject *tmp(PyTuple_New(2));
3320 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3321 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3322 PyList_SetItem(retPy,i,tmp);
3327 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3329 std::vector< std::pair<int,int> > param0,param1;
3330 convertPyToVectorPairInt(startingFrom,param0);
3331 convertPyToVectorPairInt(goingTo,param1);
3332 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3335 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3337 std::vector< std::pair<int,int> > param0,param1,ret;
3338 convertPyToVectorPairInt(bigInAbs,param0);
3339 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3340 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3341 PyObject *retPy(PyList_New(ret.size()));
3342 for(std::size_t i=0;i<ret.size();i++)
3344 PyObject *tmp(PyTuple_New(2));
3345 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3346 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3347 PyList_SetItem(retPy,i,tmp);
3354 class MEDCouplingCurveLinearMesh;
3356 //== MEDCouplingCMesh
3358 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3361 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3362 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3363 void setCoords(const DataArrayDouble *coordsX,
3364 const DataArrayDouble *coordsY=0,
3365 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3366 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3367 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3369 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3371 return MEDCouplingCMesh::New();
3373 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3375 return MEDCouplingCMesh::New(meshName);
3378 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3380 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3382 std::string __str__() const throw(INTERP_KERNEL::Exception)
3384 return self->simpleRepr();
3386 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3388 std::ostringstream oss;
3389 self->reprQuickOverview(oss);
3392 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3394 DataArrayDouble *ret=self->getCoordsAt(i);
3402 //== MEDCouplingCMesh End
3404 //== MEDCouplingCurveLinearMesh
3406 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3409 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3410 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3411 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3413 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3415 return MEDCouplingCurveLinearMesh::New();
3417 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3419 return MEDCouplingCurveLinearMesh::New(meshName);
3421 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3423 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3425 std::string __str__() const throw(INTERP_KERNEL::Exception)
3427 return self->simpleRepr();
3429 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3431 std::ostringstream oss;
3432 self->reprQuickOverview(oss);
3435 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3437 DataArrayDouble *ret=self->getCoords();
3442 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3444 int szArr,sw,iTypppArr;
3445 std::vector<int> stdvecTyyppArr;
3446 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3447 self->setNodeGridStructure(tmp,tmp+szArr);
3452 //== MEDCouplingCurveLinearMesh End
3454 //== MEDCouplingIMesh
3456 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3459 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3461 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3462 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3463 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3464 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3465 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3466 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3467 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3468 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3469 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3470 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3471 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3476 return MEDCouplingIMesh::New();
3478 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3480 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3481 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3482 const int *nodeStrctPtr(0);
3483 const double *originPtr(0),*dxyzPtr(0);
3485 std::vector<int> bb0;
3486 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3489 std::vector<double> bb,bb2;
3491 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3492 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3494 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3497 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3499 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3502 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3504 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3507 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3510 std::vector<int> bb0;
3511 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3512 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3515 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3517 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3520 DataArrayDoubleTuple *aa;
3521 std::vector<double> bb;
3523 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3524 self->setOrigin(originPtr,originPtr+nbTuples);
3527 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3529 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3532 DataArrayDoubleTuple *aa;
3533 std::vector<double> bb;
3535 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3536 self->setDXYZ(originPtr,originPtr+nbTuples);
3539 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3541 std::vector< std::pair<int,int> > inp;
3542 convertPyToVectorPairInt(fineLocInCoarse,inp);
3543 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3546 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)
3548 std::vector< std::pair<int,int> > inp;
3549 convertPyToVectorPairInt(fineLocInCoarse,inp);
3550 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3553 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3555 std::vector< std::pair<int,int> > inp;
3556 convertPyToVectorPairInt(fineLocInCoarse,inp);
3557 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3560 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)
3562 std::vector< std::pair<int,int> > inp;
3563 convertPyToVectorPairInt(fineLocInCoarse,inp);
3564 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3567 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)
3569 std::vector< std::pair<int,int> > inp;
3570 convertPyToVectorPairInt(fineLocInCoarse,inp);
3571 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3574 std::string __str__() const throw(INTERP_KERNEL::Exception)
3576 return self->simpleRepr();
3578 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3580 std::ostringstream oss;
3581 self->reprQuickOverview(oss);
3587 //== MEDCouplingIMesh End
3591 namespace MEDCoupling
3593 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3596 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3597 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3598 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3599 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3600 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3601 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3602 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3603 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3604 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3605 std::string getName() const throw(INTERP_KERNEL::Exception);
3606 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3607 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3608 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3609 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3610 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3611 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3612 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3613 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3614 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3615 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3616 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3617 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3618 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3619 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3620 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3621 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3623 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3625 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3628 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3631 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3633 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3636 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3639 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3641 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3642 return convertIntArrToPyList3(ret);
3645 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3648 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3649 PyObject *ret=PyTuple_New(2);
3650 PyObject *ret0Py=ret0?Py_True:Py_False;
3652 PyTuple_SetItem(ret,0,ret0Py);
3653 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3657 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3659 DataArrayInt *ret1=0;
3660 MEDCouplingMesh *ret0=0;
3662 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3663 if (!SWIG_IsOK(res1))
3666 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3667 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3671 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3673 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3674 da2->checkAllocated();
3675 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3677 PyObject *res = PyList_New(2);
3678 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3679 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3683 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3685 DataArrayInt *ret1=0;
3687 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3688 PyObject *res=PyTuple_New(2);
3689 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3691 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3694 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3695 PyTuple_SetItem(res,1,res1);
3700 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3703 int v0; std::vector<int> v1;
3704 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3705 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3708 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3709 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3712 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3713 if (!SWIG_IsOK(res1))
3716 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3717 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3721 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3723 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3724 da2->checkAllocated();
3725 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3729 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3731 std::vector<int> tmp;
3732 self->getCellIdsHavingGaussLocalization(locId,tmp);
3733 DataArrayInt *ret=DataArrayInt::New();
3734 ret->alloc((int)tmp.size(),1);
3735 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3736 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3739 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3741 std::vector<int> inp0;
3742 convertPyToNewIntArr4(code,1,3,inp0);
3743 std::vector<const DataArrayInt *> inp1;
3744 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3745 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3750 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3753 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3754 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3755 static MEDCouplingFieldTemplate *New(TypeOfField type);
3756 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3757 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3760 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3762 return MEDCouplingFieldTemplate::New(f);
3765 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3767 return MEDCouplingFieldTemplate::New(f);
3770 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3772 return MEDCouplingFieldTemplate::New(type);
3775 std::string __str__() const throw(INTERP_KERNEL::Exception)
3777 return self->simpleRepr();
3780 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3782 std::ostringstream oss;
3783 self->reprQuickOverview(oss);
3789 class MEDCouplingFieldInt;
3791 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3794 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3795 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3796 void setTimeUnit(const std::string& unit);
3797 std::string getTimeUnit() const;
3798 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3799 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3800 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3801 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3802 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3803 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3804 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
3805 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3806 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3807 MEDCouplingFieldDouble *deepCopy() const;
3808 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
3809 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3810 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3811 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3812 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3813 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3814 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3815 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3816 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3817 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3818 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3819 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3820 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3821 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3822 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3823 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3824 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3825 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3826 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3827 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3828 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3829 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3830 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3831 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3832 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3833 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3834 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3835 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3836 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3837 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3838 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3839 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3840 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3841 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3842 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3843 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3844 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3845 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3846 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3847 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3848 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3849 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3850 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3851 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3852 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3853 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3854 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3855 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3856 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3857 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3858 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3859 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3860 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3861 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3862 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3863 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3864 double getMinValue() const throw(INTERP_KERNEL::Exception);
3865 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3866 double norm2() const throw(INTERP_KERNEL::Exception);
3867 double normMax() const throw(INTERP_KERNEL::Exception);
3868 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3869 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3870 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3871 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3872 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3873 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3874 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3875 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3876 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3877 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3878 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3879 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3880 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3881 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3882 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3883 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3884 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3885 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3886 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3887 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3888 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3889 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3891 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3893 return MEDCouplingFieldDouble::New(type,td);
3896 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3898 return MEDCouplingFieldDouble::New(ft,td);
3901 std::string __str__() const throw(INTERP_KERNEL::Exception)
3903 return self->simpleRepr();
3906 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3908 std::ostringstream oss;
3909 self->reprQuickOverview(oss);
3913 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3915 DataArrayDouble *ret=self->getArray();
3921 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3923 std::vector<DataArrayDouble *> arrs=self->getArrays();
3924 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3928 PyObject *ret=PyTuple_New(sz);
3929 for(int i=0;i<sz;i++)
3932 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3934 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
3939 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3941 std::vector<const DataArrayDouble *> tmp;
3942 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
3944 std::vector<DataArrayDouble *> arrs(sz);
3945 for(int i=0;i<sz;i++)
3946 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3947 self->setArrays(arrs);
3950 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3952 DataArrayDouble *ret=self->getEndArray();
3958 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3962 DataArrayDoubleTuple *aa;
3963 std::vector<double> bb;
3965 const MEDCouplingMesh *mesh=self->getMesh();
3967 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3968 int spaceDim=mesh->getSpaceDimension();
3969 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3970 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3972 int sz=self->getNumberOfComponents();
3973 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3974 self->getValueOn(spaceLoc,res);
3975 return convertDblArrToPyList(res,sz);
3978 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3980 int sz=self->getNumberOfComponents();
3981 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3982 self->getValueOnPos(i,j,k,res);
3983 return convertDblArrToPyList(res,sz);
3986 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3988 const MEDCouplingMesh *mesh(self->getMesh());
3990 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3993 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3994 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3995 mesh->getSpaceDimension(),true,nbPts);
3996 return self->getValueOnMulti(inp,nbPts);
3999 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4003 DataArrayDoubleTuple *aa;
4004 std::vector<double> bb;
4006 const MEDCouplingMesh *mesh=self->getMesh();
4008 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4009 int spaceDim=mesh->getSpaceDimension();
4010 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4011 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4014 int sz=self->getNumberOfComponents();
4015 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4016 self->getValueOn(spaceLoc,time,res);
4017 return convertDblArrToPyList(res,sz);
4020 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4022 if(self->getArray()!=0)
4023 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4026 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4027 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4028 self->setArray(arr);
4032 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4035 double tmp0=self->getTime(tmp1,tmp2);
4036 PyObject *res = PyList_New(3);
4037 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4038 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4039 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4043 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4046 double tmp0=self->getStartTime(tmp1,tmp2);
4047 PyObject *res = PyList_New(3);
4048 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4049 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4050 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4054 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4057 double tmp0=self->getEndTime(tmp1,tmp2);
4058 PyObject *res = PyList_New(3);
4059 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4060 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4061 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4064 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4066 int sz=self->getNumberOfComponents();
4067 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4068 self->accumulate(tmp);
4069 return convertDblArrToPyList(tmp,sz);
4071 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4073 int sz=self->getNumberOfComponents();
4074 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4075 self->integral(isWAbs,tmp);
4076 return convertDblArrToPyList(tmp,sz);
4078 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4080 int sz=self->getNumberOfComponents();
4081 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4082 self->getWeightedAverageValue(tmp,isWAbs);
4083 return convertDblArrToPyList(tmp,sz);
4085 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4087 int sz=self->getNumberOfComponents();
4088 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4090 return convertDblArrToPyList(tmp,sz);
4092 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4094 int sz=self->getNumberOfComponents();
4095 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4097 return convertDblArrToPyList(tmp,sz);
4099 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4101 int szArr,sw,iTypppArr;
4102 std::vector<int> stdvecTyyppArr;
4103 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4104 self->renumberCells(tmp,check);
4107 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4109 int szArr,sw,iTypppArr;
4110 std::vector<int> stdvecTyyppArr;
4111 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4112 self->renumberCellsWithoutMesh(tmp,check);
4115 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4117 int szArr,sw,iTypppArr;
4118 std::vector<int> stdvecTyyppArr;
4119 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4120 self->renumberNodes(tmp,eps);
4123 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4125 int szArr,sw,iTypppArr;
4126 std::vector<int> stdvecTyyppArr;
4127 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4128 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4131 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4135 std::vector<int> multiVal;
4136 std::pair<int, std::pair<int,int> > slic;
4137 MEDCoupling::DataArrayInt *daIntTyypp=0;
4138 const MEDCouplingMesh *mesh=self->getMesh();
4140 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4141 int nbc=mesh->getNumberOfCells();
4142 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4149 std::ostringstream oss;
4150 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4151 throw INTERP_KERNEL::Exception(oss.str().c_str());
4154 return self->buildSubPart(&singleVal,&singleVal+1);
4159 int tmp=nbc+singleVal;
4160 return self->buildSubPart(&tmp,&tmp+1);
4164 std::ostringstream oss;
4165 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4166 throw INTERP_KERNEL::Exception(oss.str().c_str());
4172 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4176 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4181 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4182 daIntTyypp->checkAllocated();
4183 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4186 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4190 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4192 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";
4193 if(PyTuple_Check(li))
4195 Py_ssize_t sz=PyTuple_Size(li);
4197 throw INTERP_KERNEL::Exception(msg);
4198 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4201 std::vector<int> multiVal;
4202 std::pair<int, std::pair<int,int> > slic;
4203 MEDCoupling::DataArrayInt *daIntTyypp=0;
4204 if(!self->getArray())
4205 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4207 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4208 catch(INTERP_KERNEL::Exception& e)
4209 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4210 MCAuto<MEDCouplingFieldDouble> ret0=MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4211 DataArrayDouble *ret0Arr=ret0->getArray();
4213 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4218 std::vector<int> v2(1,singleVal);
4219 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4220 ret0->setArray(aarr);
4225 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4226 ret0->setArray(aarr);
4231 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4232 std::vector<int> v2(nbOfComp);
4233 for(int i=0;i<nbOfComp;i++)
4234 v2[i]=slic.first+i*slic.second.second;
4235 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4236 ret0->setArray(aarr);
4240 throw INTERP_KERNEL::Exception(msg);
4245 return MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,li);
4248 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4251 double r1=self->getMaxValue2(tmp);
4252 PyObject *ret=PyTuple_New(2);
4253 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4254 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4258 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4261 double r1=self->getMinValue2(tmp);
4262 PyObject *ret=PyTuple_New(2);
4263 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4264 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4268 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4270 std::vector<int> tmp;
4271 convertPyToNewIntArr3(li,tmp);
4272 return self->keepSelectedComponents(tmp);
4275 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4277 std::vector<int> tmp;
4278 convertPyToNewIntArr3(li,tmp);
4279 self->setSelectedComponents(f,tmp);
4282 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4285 DataArrayDouble *a,*a2;
4286 DataArrayDoubleTuple *aa,*aa2;
4287 std::vector<double> bb,bb2;
4290 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4291 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4292 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4293 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4295 return self->extractSlice3D(orig,vect,eps);
4298 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4300 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4303 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4305 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4308 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4310 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.";
4311 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4314 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4316 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4318 return (*self)-(*other);
4320 throw INTERP_KERNEL::Exception(msg);
4325 DataArrayDoubleTuple *aa;
4326 std::vector<double> bb;
4328 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4333 if(!self->getArray())
4334 throw INTERP_KERNEL::Exception(msg2);
4335 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4336 ret->applyLin(1.,-val);
4337 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4338 ret2->setArray(ret);
4343 if(!self->getArray())
4344 throw INTERP_KERNEL::Exception(msg2);
4345 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4346 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4347 ret2->setArray(ret);
4352 if(!self->getArray())
4353 throw INTERP_KERNEL::Exception(msg2);
4354 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4355 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4356 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4357 ret2->setArray(ret);
4362 if(!self->getArray())
4363 throw INTERP_KERNEL::Exception(msg2);
4364 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4365 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4366 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4367 ret2->setArray(ret);
4371 { throw INTERP_KERNEL::Exception(msg); }
4375 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4377 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4380 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4382 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4385 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4387 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4390 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4392 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.";
4393 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4396 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4398 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4400 return (*self)/(*other);
4402 throw INTERP_KERNEL::Exception(msg);
4407 DataArrayDoubleTuple *aa;
4408 std::vector<double> bb;
4410 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4416 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4417 if(!self->getArray())
4418 throw INTERP_KERNEL::Exception(msg2);
4419 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4420 ret->applyLin(1./val,0);
4421 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4422 ret2->setArray(ret);
4427 if(!self->getArray())
4428 throw INTERP_KERNEL::Exception(msg2);
4429 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4430 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4431 ret2->setArray(ret);
4436 if(!self->getArray())
4437 throw INTERP_KERNEL::Exception(msg2);
4438 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4439 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4440 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4441 ret2->setArray(ret);
4446 if(!self->getArray())
4447 throw INTERP_KERNEL::Exception(msg2);
4448 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4449 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4450 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4451 ret2->setArray(ret);
4455 { throw INTERP_KERNEL::Exception(msg); }
4459 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4461 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4464 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4466 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.";
4467 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4470 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4472 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4474 return (*self)^(*other);
4476 throw INTERP_KERNEL::Exception(msg);
4481 DataArrayDoubleTuple *aa;
4482 std::vector<double> bb;
4484 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4489 if(!self->getArray())
4490 throw INTERP_KERNEL::Exception(msg2);
4491 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4493 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4494 ret2->setArray(ret);
4499 if(!self->getArray())
4500 throw INTERP_KERNEL::Exception(msg2);
4501 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4502 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4503 ret2->setArray(ret);
4508 if(!self->getArray())
4509 throw INTERP_KERNEL::Exception(msg2);
4510 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4511 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4512 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4513 ret2->setArray(ret);
4518 if(!self->getArray())
4519 throw INTERP_KERNEL::Exception(msg2);
4520 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4521 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4522 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4523 ret2->setArray(ret);
4527 { throw INTERP_KERNEL::Exception(msg); }
4531 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4533 return self->negate();
4536 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4538 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.";
4539 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4542 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4544 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4548 Py_XINCREF(trueSelf);
4552 throw INTERP_KERNEL::Exception(msg);
4557 DataArrayDoubleTuple *aa;
4558 std::vector<double> bb;
4560 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4565 if(!self->getArray())
4566 throw INTERP_KERNEL::Exception(msg2);
4567 self->getArray()->applyLin(1.,val);
4568 Py_XINCREF(trueSelf);
4573 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4576 Py_XINCREF(trueSelf);
4581 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4582 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4583 ret2->setArray(aaa);
4585 Py_XINCREF(trueSelf);
4590 if(!self->getArray())
4591 throw INTERP_KERNEL::Exception(msg2);
4592 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4593 self->getArray()->addEqual(aaa);
4594 Py_XINCREF(trueSelf);
4598 { throw INTERP_KERNEL::Exception(msg); }
4602 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4604 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.";
4605 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4608 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4610 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4614 Py_XINCREF(trueSelf);
4618 throw INTERP_KERNEL::Exception(msg);
4623 DataArrayDoubleTuple *aa;
4624 std::vector<double> bb;
4626 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4631 if(!self->getArray())
4632 throw INTERP_KERNEL::Exception(msg2);
4633 self->getArray()->applyLin(1.,-val);
4634 Py_XINCREF(trueSelf);
4639 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4642 Py_XINCREF(trueSelf);
4647 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4648 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4649 ret2->setArray(aaa);
4651 Py_XINCREF(trueSelf);
4656 if(!self->getArray())
4657 throw INTERP_KERNEL::Exception(msg2);
4658 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4659 self->getArray()->substractEqual(aaa);
4660 Py_XINCREF(trueSelf);
4664 { throw INTERP_KERNEL::Exception(msg); }
4668 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4670 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.";
4671 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4674 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4676 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4680 Py_XINCREF(trueSelf);
4684 throw INTERP_KERNEL::Exception(msg);
4689 DataArrayDoubleTuple *aa;
4690 std::vector<double> bb;
4692 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4697 if(!self->getArray())
4698 throw INTERP_KERNEL::Exception(msg2);
4699 self->getArray()->applyLin(val,0);
4700 Py_XINCREF(trueSelf);
4705 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4708 Py_XINCREF(trueSelf);
4713 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4714 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4715 ret2->setArray(aaa);
4717 Py_XINCREF(trueSelf);
4722 if(!self->getArray())
4723 throw INTERP_KERNEL::Exception(msg2);
4724 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4725 self->getArray()->multiplyEqual(aaa);
4726 Py_XINCREF(trueSelf);
4730 { throw INTERP_KERNEL::Exception(msg); }
4734 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4736 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.";
4737 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4740 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4742 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4746 Py_XINCREF(trueSelf);
4750 throw INTERP_KERNEL::Exception(msg);
4755 DataArrayDoubleTuple *aa;
4756 std::vector<double> bb;
4758 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4764 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4765 if(!self->getArray())
4766 throw INTERP_KERNEL::Exception(msg2);
4767 self->getArray()->applyLin(1./val,0);
4768 Py_XINCREF(trueSelf);
4773 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4776 Py_XINCREF(trueSelf);
4781 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4782 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4783 ret2->setArray(aaa);
4785 Py_XINCREF(trueSelf);
4790 if(!self->getArray())
4791 throw INTERP_KERNEL::Exception(msg2);
4792 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4793 self->getArray()->divideEqual(aaa);
4794 Py_XINCREF(trueSelf);
4798 { throw INTERP_KERNEL::Exception(msg); }
4802 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4804 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.";
4805 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4808 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4810 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4814 Py_XINCREF(trueSelf);
4818 throw INTERP_KERNEL::Exception(msg);
4823 DataArrayDoubleTuple *aa;
4824 std::vector<double> bb;
4826 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4831 if(!self->getArray())
4832 throw INTERP_KERNEL::Exception(msg2);
4833 self->getArray()->applyPow(val);
4834 Py_XINCREF(trueSelf);
4839 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4842 Py_XINCREF(trueSelf);
4847 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4848 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4849 ret2->setArray(aaa);
4851 Py_XINCREF(trueSelf);
4856 if(!self->getArray())
4857 throw INTERP_KERNEL::Exception(msg2);
4858 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4859 self->getArray()->powEqual(aaa);
4860 Py_XINCREF(trueSelf);
4864 { throw INTERP_KERNEL::Exception(msg); }
4868 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4870 std::vector<const MEDCouplingFieldDouble *> tmp;
4871 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4872 return MEDCouplingFieldDouble::MergeFields(tmp);
4875 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4877 std::vector<const MEDCouplingFieldDouble *> tmp;
4878 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4879 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4882 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4884 std::vector<double> a0;
4885 std::vector<int> a1;
4886 std::vector<std::string> a2;
4887 self->getTinySerializationDbleInformation(a0);
4888 self->getTinySerializationIntInformation(a1);
4889 self->getTinySerializationStrInformation(a2);
4891 PyObject *ret(PyTuple_New(3));
4892 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4893 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
4895 PyObject *ret2(PyList_New(sz));
4897 for(int i=0;i<sz;i++)
4898 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
4900 PyTuple_SetItem(ret,2,ret2);
4904 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
4906 DataArrayInt *ret0(0);
4907 std::vector<DataArrayDouble *> ret1;
4908 self->serialize(ret0,ret1);
4911 std::size_t sz(ret1.size());
4912 PyObject *ret(PyTuple_New(2));
4913 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4914 PyObject *ret1Py(PyList_New(sz));
4915 for(std::size_t i=0;i<sz;i++)
4919 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4921 PyTuple_SetItem(ret,1,ret1Py);
4925 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
4927 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
4928 if(!PyTuple_Check(args))
4929 throw INTERP_KERNEL::Exception(MSG);
4930 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
4931 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
4932 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
4934 PyObject *tmp0(PyTuple_New(1));
4935 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
4936 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
4938 Py_DECREF(selfMeth);
4939 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
4940 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
4941 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
4943 PyObject *a(PyInt_FromLong(0));
4944 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
4947 throw INTERP_KERNEL::Exception(MSG);
4948 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
4949 throw INTERP_KERNEL::Exception(MSG);
4950 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
4953 Py_DECREF(initMeth);
4958 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
4959 {// put an empty dict in input to say to __new__ to call __init__...
4960 self->checkConsistencyLight();
4961 PyObject *ret(PyTuple_New(1));
4962 PyObject *ret0(PyDict_New());
4964 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
4965 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
4966 PyDict_SetItem(ret0,a,d);
4967 Py_DECREF(a); Py_DECREF(d);
4969 PyTuple_SetItem(ret,0,ret0);
4973 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
4975 self->checkConsistencyLight();
4976 PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
4977 PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
4978 const MEDCouplingMesh *mesh(self->getMesh());
4981 PyObject *ret(PyTuple_New(3));
4982 PyTuple_SetItem(ret,0,ret0);
4983 PyTuple_SetItem(ret,1,ret1);
4984 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
4988 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
4990 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
4991 if(!PyTuple_Check(inp))
4992 throw INTERP_KERNEL::Exception(MSG);
4993 int sz(PyTuple_Size(inp));
4995 throw INTERP_KERNEL::Exception(MSG);
4997 PyObject *elt2(PyTuple_GetItem(inp,2));
4999 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
5000 if(!SWIG_IsOK(status))
5001 throw INTERP_KERNEL::Exception(MSG);
5002 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
5004 PyObject *elt0(PyTuple_GetItem(inp,0));
5005 PyObject *elt1(PyTuple_GetItem(inp,1));
5006 std::vector<double> a0;
5007 std::vector<int> a1;
5008 std::vector<std::string> a2;
5009 DataArrayInt *b0(0);
5010 std::vector<DataArrayDouble *>b1;
5012 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5013 throw INTERP_KERNEL::Exception(MSG);
5014 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5016 fillArrayWithPyListDbl3(a0py,tmp,a0);
5017 convertPyToNewIntArr3(a1py,a1);
5018 fillStringVector(a2py,a2);
5021 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5022 throw INTERP_KERNEL::Exception(MSG);
5023 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5025 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5026 if(!SWIG_IsOK(status))
5027 throw INTERP_KERNEL::Exception(MSG);
5028 b0=reinterpret_cast<DataArrayInt *>(argp);
5029 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5031 self->checkForUnserialization(a1,b0,b1);
5032 // useless here to call resizeForUnserialization because arrays are well resized.
5033 self->finishUnserialization(a1,a0,a2);
5038 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5041 int getNumberOfFields() const;
5042 MEDCouplingMultiFields *deepCopy() const;
5043 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5044 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5045 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5046 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5047 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5050 std::string __str__() const throw(INTERP_KERNEL::Exception)
5052 return self->simpleRepr();
5054 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5056 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5057 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5059 std::vector<MEDCouplingFieldDouble *> fs(sz);
5060 for(int i=0;i<sz;i++)
5061 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5062 return MEDCouplingMultiFields::New(fs);
5064 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5066 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5067 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5069 std::vector<MEDCouplingFieldDouble *> fs(sz);
5070 for(int i=0;i<sz;i++)
5071 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5072 return MEDCouplingMultiFields::New(fs);
5074 PyObject *getFields() const
5076 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5077 int sz=fields.size();
5078 PyObject *res = PyList_New(sz);
5079 for(int i=0;i<sz;i++)
5083 fields[i]->incrRef();
5084 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5088 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5093 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5095 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5099 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5102 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5104 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5106 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5108 PyObject *res = PyList_New(sz);
5109 for(int i=0;i<sz;i++)
5114 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5118 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5123 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5125 std::vector<int> refs;
5126 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5128 PyObject *res = PyList_New(sz);
5129 for(int i=0;i<sz;i++)
5134 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5138 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5142 PyObject *ret=PyTuple_New(2);
5143 PyTuple_SetItem(ret,0,res);
5144 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5147 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5149 std::vector<DataArrayDouble *> ms=self->getArrays();
5151 PyObject *res = PyList_New(sz);
5152 for(int i=0;i<sz;i++)
5157 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5161 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5166 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5168 std::vector< std::vector<int> > refs;
5169 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5171 PyObject *res = PyList_New(sz);
5172 PyObject *res2 = PyList_New(sz);
5173 for(int i=0;i<sz;i++)
5178 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5182 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5184 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5187 PyObject *ret=PyTuple_New(2);
5188 PyTuple_SetItem(ret,0,res);
5189 PyTuple_SetItem(ret,1,res2);
5195 class MEDCouplingFieldInt : public MEDCouplingField
5198 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5199 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5200 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5201 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5202 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5203 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5204 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5205 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5206 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5207 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5209 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5211 return MEDCouplingFieldInt::New(type,td);
5214 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5216 return MEDCouplingFieldInt::New(ft,td);
5219 std::string __str__() const throw(INTERP_KERNEL::Exception)
5221 return self->simpleRepr();
5224 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5226 std::ostringstream oss;
5227 self->reprQuickOverview(oss);
5231 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5233 DataArrayInt *ret=self->getArray();
5239 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5242 double tmp0=self->getTime(tmp1,tmp2);
5243 PyObject *res = PyList_New(3);
5244 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5245 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5246 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5252 class MEDCouplingDefinitionTime
5255 MEDCouplingDefinitionTime();
5256 void assign(const MEDCouplingDefinitionTime& other);
5257 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5258 double getTimeResolution() const;
5259 std::vector<double> getHotSpotsTime() const;
5262 std::string __str__() const throw(INTERP_KERNEL::Exception)
5264 std::ostringstream oss;
5265 self->appendRepr(oss);
5269 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5271 int meshId,arrId,arrIdInField,fieldId;
5272 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5273 PyObject *res=PyList_New(4);
5274 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5275 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5276 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5277 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5281 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5283 int meshId,arrId,arrIdInField,fieldId;
5284 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5285 PyObject *res=PyList_New(4);
5286 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5287 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5288 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5289 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5295 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5298 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5299 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5303 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5305 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5306 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5308 std::vector<MEDCouplingFieldDouble *> fs(sz);
5309 for(int i=0;i<sz;i++)
5310 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5311 return MEDCouplingFieldOverTime::New(fs);
5313 std::string __str__() const throw(INTERP_KERNEL::Exception)
5315 return self->simpleRepr();
5317 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5319 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5320 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5322 std::vector<MEDCouplingFieldDouble *> fs(sz);
5323 for(int i=0;i<sz;i++)
5324 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5325 return MEDCouplingFieldOverTime::New(fs);
5330 class MEDCouplingCartesianAMRMesh;
5332 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5335 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5336 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5337 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5340 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5342 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5350 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5353 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5354 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5355 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5358 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5360 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5361 return convertFromVectorPairInt(ret);
5364 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5366 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5367 return convertFromVectorPairInt(ret);
5370 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5372 std::vector< std::pair<int,int> > inp;
5373 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5374 self->addPatch(inp,factors);
5377 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5379 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5381 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5382 if(patchId==mesh->getNumberOfPatches())
5384 std::ostringstream oss;
5385 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5386 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5389 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5395 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5397 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5399 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5400 mesh->removePatch(patchId);
5403 int __len__() const throw(INTERP_KERNEL::Exception)
5405 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5407 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5408 return mesh->getNumberOfPatches();
5413 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5417 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5420 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5421 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5422 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5423 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5424 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5425 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5426 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5427 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5428 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5429 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5430 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5431 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5432 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5434 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5435 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5436 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5437 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5438 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5439 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5440 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5441 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5442 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5443 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5444 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5445 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5446 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5447 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5448 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5449 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5450 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5451 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5452 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5453 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5456 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5458 std::vector< std::pair<int,int> > inp;
5459 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5460 self->addPatch(inp,factors);
5463 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5465 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5467 PyObject *ret = PyList_New(sz);
5468 for(int i=0;i<sz;i++)
5470 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5473 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5478 // agy : don't know why typemap fails here ??? let it in the extend section
5479 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5481 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5484 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5486 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5487 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5493 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5495 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5496 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5502 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5504 std::vector<int> out1;
5505 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5506 PyObject *ret(PyTuple_New(2));
5507 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5508 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5512 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5514 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5516 PyObject *ret = PyList_New(sz);
5517 for(int i=0;i<sz;i++)
5518 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5522 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5524 std::vector<const DataArrayDouble *> inp;
5525 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5526 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5529 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5531 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5537 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5539 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5545 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5547 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5553 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5555 const MEDCouplingIMesh *ret(self->getImageMesh());
5558 return const_cast<MEDCouplingIMesh *>(ret);
5561 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5563 if(patchId==self->getNumberOfPatches())
5565 std::ostringstream oss;
5566 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5567 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5570 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5576 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5578 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5579 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5580 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5583 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5585 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5586 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5587 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5590 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5592 self->removePatch(patchId);
5595 int __len__() const throw(INTERP_KERNEL::Exception)
5597 return self->getNumberOfPatches();
5602 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5606 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5609 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5612 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5614 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5615 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5616 const int *nodeStrctPtr(0);
5617 const double *originPtr(0),*dxyzPtr(0);
5619 std::vector<int> bb0;
5620 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5623 std::vector<double> bb,bb2;
5625 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5626 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5628 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5631 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5633 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5634 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5635 std::vector< std::vector<int> > inp2;
5636 convertPyToVectorOfVectorOfInt(factors,inp2);
5637 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5640 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5642 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5645 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5647 return MEDCouplingCartesianAMRMesh::New(mesh);
5652 class MEDCouplingDataForGodFather : public RefCountObject
5655 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5656 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5657 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5658 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5659 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5660 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5661 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5662 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5663 virtual void alloc() throw(INTERP_KERNEL::Exception);
5664 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5667 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5669 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5677 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5680 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5681 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5682 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5683 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5684 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5685 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5686 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5687 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5688 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5691 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5693 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5694 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5695 MEDCouplingAMRAttribute *ret(0);
5698 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5699 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5701 catch(INTERP_KERNEL::Exception&)
5703 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5704 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5709 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5711 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5714 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5716 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5717 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5723 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5725 std::vector< std::vector<std::string> > compNamesCpp;
5726 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5727 self->spillInfoOnComponents(compNamesCpp);
5730 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5732 std::vector<int> inp0;
5733 if(!fillIntVector(nfs,inp0))
5734 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5735 std::size_t sz(inp0.size());
5736 std::vector<NatureOfField> inp00(sz);
5737 for(std::size_t i=0;i<sz;i++)
5738 inp00[i]=(NatureOfField)inp0[i];
5739 self->spillNatures(inp00);
5742 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5744 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5745 int sz((int)ret.size());
5746 PyObject *retPy(PyList_New(sz));
5747 for(int i=0;i<sz;i++)
5748 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5754 class DenseMatrix : public RefCountObject, public TimeLabel
5757 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5758 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5759 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5760 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5762 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5763 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5764 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5765 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5766 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5767 void transpose() throw(INTERP_KERNEL::Exception);
5769 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5770 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5771 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5774 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5776 return DenseMatrix::New(nbRows,nbCols);
5779 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5781 return DenseMatrix::New(array,nbRows,nbCols);
5784 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5787 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5788 PyObject *ret=PyTuple_New(2);
5789 PyObject *ret0Py=ret0?Py_True:Py_False;
5791 PyTuple_SetItem(ret,0,ret0Py);
5792 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5796 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5798 DataArrayDouble *ret(self->getData());
5804 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5806 return MEDCoupling::DenseMatrix::Add(self,other);
5809 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5811 return MEDCoupling::DenseMatrix::Substract(self,other);
5814 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5816 return MEDCoupling::DenseMatrix::Multiply(self,other);
5819 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5821 return MEDCoupling::DenseMatrix::Multiply(self,other);
5824 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5826 self->addEqual(other);
5827 Py_XINCREF(trueSelf);
5831 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5833 self->substractEqual(other);
5834 Py_XINCREF(trueSelf);
5838 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5840 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5847 class PartDefinition : public RefCountObject, public TimeLabel
5850 static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5851 static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5852 virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
5853 virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
5854 virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
5855 virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
5856 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5857 virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
5860 virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
5862 return (*self)+other;
5865 virtual PyObject *isEqual(const PartDefinition *other) const throw(INTERP_KERNEL::Exception)
5868 bool ret0(self->isEqual(other,ret1));
5869 PyObject *ret=PyTuple_New(2);
5870 PyObject *ret0Py=ret0?Py_True:Py_False;
5872 PyTuple_SetItem(ret,0,ret0Py);
5873 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5877 virtual PyObject *deepCopy() const throw(INTERP_KERNEL::Exception)
5879 return convertPartDefinition(self->deepCopy(),SWIG_POINTER_OWN | 0);
5883 virtual ~PartDefinition();
5886 class DataArrayPartDefinition : public PartDefinition
5889 static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5892 DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
5894 return DataArrayPartDefinition::New(listOfIds);
5897 std::string __str__() const throw(INTERP_KERNEL::Exception)
5899 return self->getRepr();
5902 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5904 std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
5905 oss << self->getRepr();
5910 virtual ~DataArrayPartDefinition();
5913 class SlicePartDefinition : public PartDefinition
5916 static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5917 int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
5920 SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
5922 return SlicePartDefinition::New(start,stop,step);
5925 PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
5928 self->getSlice(a,b,c);
5929 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
5932 std::string __str__() const throw(INTERP_KERNEL::Exception)
5934 return self->getRepr();
5937 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5939 std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
5940 oss << self->getRepr();
5945 virtual ~SlicePartDefinition();
5951 __filename=os.environ.get('PYTHONSTARTUP')
5952 if __filename and os.path.isfile(__filename):
5953 execfile(__filename)