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 MEDCouplingFieldDouble;
527 %extend RefCountObject
529 std::string getHiddenCppPointer() const
531 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
536 %extend MEDCouplingGaussLocalization
538 std::string __str__() const throw(INTERP_KERNEL::Exception)
540 return self->getStringRepr();
543 std::string __repr__() const throw(INTERP_KERNEL::Exception)
545 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
546 oss << self->getStringRepr();
553 class MEDCouplingMesh : public RefCountObject, public TimeLabel
556 void setName(const std::string& name);
557 std::string getName() const;
558 void setDescription(const std::string& descr);
559 std::string getDescription() const;
560 void setTime(double val, int iteration, int order);
561 void setTimeUnit(const std::string& unit);
562 std::string getTimeUnit() const;
563 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
564 bool isStructured() const throw(INTERP_KERNEL::Exception);
565 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
566 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
567 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
568 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
569 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
570 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
571 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
572 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
573 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
574 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
575 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
576 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
577 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
578 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
579 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
580 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
581 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
582 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
583 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
584 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
585 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
586 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
587 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
588 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
589 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
590 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
591 virtual std::string getVTKFileExtension() const;
592 std::string getVTKFileNameOf(const std::string& fileName) const;
594 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
595 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
596 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
597 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
598 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
599 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
600 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
601 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
602 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
603 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
604 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);
605 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
606 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
607 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
608 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
609 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
610 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
611 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
614 std::string __str__() const throw(INTERP_KERNEL::Exception)
616 return self->simpleRepr();
619 PyObject *getTime() throw(INTERP_KERNEL::Exception)
622 double tmp0=self->getTime(tmp1,tmp2);
623 PyObject *res = PyList_New(3);
624 PyList_SetItem(res,0,SWIG_From_double(tmp0));
625 PyList_SetItem(res,1,SWIG_From_int(tmp1));
626 PyList_SetItem(res,2,SWIG_From_int(tmp2));
630 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
634 DataArrayDoubleTuple *aa;
635 std::vector<double> bb;
637 int spaceDim=self->getSpaceDimension();
638 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
639 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
640 return self->getCellContainingPoint(pos,eps);
643 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
647 DataArrayDoubleTuple *aa;
648 std::vector<double> bb;
650 int spaceDim=self->getSpaceDimension();
651 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
652 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
653 MCAuto<DataArrayInt> elts,eltsIndex;
654 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
655 PyObject *ret=PyTuple_New(2);
656 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
657 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
661 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
663 MCAuto<DataArrayInt> elts,eltsIndex;
664 int spaceDim=self->getSpaceDimension();
666 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
667 if (!SWIG_IsOK(res1))
670 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
671 int nbOfPoints=size/spaceDim;
674 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
676 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
680 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
682 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
683 da2->checkAllocated();
684 int size=da2->getNumberOfTuples();
685 int nbOfCompo=da2->getNumberOfComponents();
686 if(nbOfCompo!=spaceDim)
688 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
690 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
692 PyObject *ret=PyTuple_New(2);
693 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
694 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
698 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
702 DataArrayDoubleTuple *aa;
703 std::vector<double> bb;
705 int spaceDim=self->getSpaceDimension();
706 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
707 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
708 std::vector<int> elts;
709 self->getCellsContainingPoint(pos,eps,elts);
710 DataArrayInt *ret=DataArrayInt::New();
711 ret->alloc((int)elts.size(),1);
712 std::copy(elts.begin(),elts.end(),ret->getPointer());
713 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
716 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
718 MCAuto<DataArrayInt> d0=DataArrayInt::New();
719 MCAuto<DataArrayInt> d1=DataArrayInt::New();
720 self->getReverseNodalConnectivity(d0,d1);
721 PyObject *ret=PyTuple_New(2);
722 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
723 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
727 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
730 int v0; std::vector<int> v1;
731 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
732 self->renumberCells(ids,check);
735 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
737 DataArrayInt *cellCor, *nodeCor;
738 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
739 PyObject *res = PyList_New(2);
740 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
741 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
745 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
747 DataArrayInt *cellCor=0,*nodeCor=0;
748 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
749 PyObject *res = PyList_New(2);
750 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
751 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
755 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
757 DataArrayInt *cellCor=0;
758 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
762 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
765 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
766 if (!SWIG_IsOK(res1))
769 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
770 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
774 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
776 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
777 da2->checkAllocated();
778 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
781 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
783 std::vector<int> conn;
784 self->getNodeIdsOfCell(cellId,conn);
785 return convertIntArrToPyList2(conn);
788 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
790 std::vector<double> coo;
791 self->getCoordinatesOfNode(nodeId,coo);
792 return convertDblArrToPyList2(coo);
795 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
799 DataArrayDoubleTuple *aa;
800 std::vector<double> bb;
802 int spaceDim=self->getSpaceDimension();
803 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
804 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
805 self->scale(pointPtr,factor);
808 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
810 int spaceDim=self->getSpaceDimension();
811 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
812 self->getBoundingBox(tmp);
813 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
817 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
820 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
821 PyObject *ret=PyTuple_New(2);
822 PyObject *ret0Py=ret0?Py_True:Py_False;
824 PyTuple_SetItem(ret,0,ret0Py);
825 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
829 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
831 int szArr,sw,iTypppArr;
832 std::vector<int> stdvecTyyppArr;
833 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
834 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
835 if(sw==3)//DataArrayInt
837 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
838 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
839 std::string name=argpt->getName();
841 ret->setName(name.c_str());
843 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
846 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
848 int szArr,sw,iTypppArr;
849 std::vector<int> stdvecTyyppArr;
851 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
852 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
853 if(sw==3)//DataArrayInt
855 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
856 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
857 std::string name=argpt->getName();
859 ret->setName(name.c_str());
862 PyObject *res = PyList_New(2);
863 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
864 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
865 PyList_SetItem(res,0,obj0);
866 PyList_SetItem(res,1,obj1);
870 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
874 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
875 PyObject *res = PyTuple_New(2);
876 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
879 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
881 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
882 PyTuple_SetItem(res,0,obj0);
883 PyTuple_SetItem(res,1,obj1);
887 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
889 std::vector<int> vals=self->getDistributionOfTypes();
891 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
892 PyObject *ret=PyList_New((int)vals.size()/3);
893 for(int j=0;j<(int)vals.size()/3;j++)
895 PyObject *ret1=PyList_New(3);
896 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
897 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
898 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
899 PyList_SetItem(ret,j,ret1);
904 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
906 std::vector<int> code;
907 std::vector<const DataArrayInt *> idsPerType;
908 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
909 convertPyToNewIntArr4(li,1,3,code);
910 return self->checkTypeConsistencyAndContig(code,idsPerType);
913 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
915 std::vector<int> code;
916 std::vector<DataArrayInt *> idsInPflPerType;
917 std::vector<DataArrayInt *> idsPerType;
918 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
919 PyObject *ret=PyTuple_New(3);
922 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
923 PyObject *ret0=PyList_New((int)code.size()/3);
924 for(int j=0;j<(int)code.size()/3;j++)
926 PyObject *ret00=PyList_New(3);
927 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
928 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
929 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
930 PyList_SetItem(ret0,j,ret00);
932 PyTuple_SetItem(ret,0,ret0);
934 PyObject *ret1=PyList_New(idsInPflPerType.size());
935 for(std::size_t j=0;j<idsInPflPerType.size();j++)
936 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
937 PyTuple_SetItem(ret,1,ret1);
938 int n=idsPerType.size();
939 PyObject *ret2=PyList_New(n);
941 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
942 PyTuple_SetItem(ret,2,ret2);
946 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
950 DataArrayDoubleTuple *aa;
951 std::vector<double> bb;
953 int spaceDim=self->getSpaceDimension();
954 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
955 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
956 self->translate(vectorPtr);
959 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
961 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
964 DataArrayDoubleTuple *aa;
965 std::vector<double> bb;
967 int spaceDim=self->getSpaceDimension();
968 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
969 self->rotate(centerPtr,0,alpha);
972 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
974 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
976 DataArrayDouble *a,*a2;
977 DataArrayDoubleTuple *aa,*aa2;
978 std::vector<double> bb,bb2;
980 int spaceDim=self->getSpaceDimension();
981 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
982 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
983 self->rotate(centerPtr,vectorPtr,alpha);
986 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
988 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
989 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
990 PyObject *res=PyList_New(result.size());
991 for(int i=0;iL!=result.end(); i++, iL++)
992 PyList_SetItem(res,i,PyInt_FromLong(*iL));
996 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
998 std::vector<double> a0;
1000 std::vector<std::string> a2;
1001 self->getTinySerializationInformation(a0,a1,a2);
1002 PyObject *ret(PyTuple_New(3));
1003 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1004 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1006 PyObject *ret2(PyList_New(sz));
1008 for(int i=0;i<sz;i++)
1009 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1011 PyTuple_SetItem(ret,2,ret2);
1015 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1017 DataArrayInt *a0Tmp(0);
1018 DataArrayDouble *a1Tmp(0);
1019 self->serialize(a0Tmp,a1Tmp);
1020 PyObject *ret(PyTuple_New(2));
1021 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1022 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1026 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1028 std::vector<std::string> littleStrings;
1029 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1032 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1033 {// put an empty dict in input to say to __new__ to call __init__...
1034 PyObject *ret(PyTuple_New(1));
1035 PyObject *ret0(PyDict_New());
1036 PyTuple_SetItem(ret,0,ret0);
1040 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1042 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1043 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1044 PyObject *ret(PyTuple_New(2));
1045 PyTuple_SetItem(ret,0,ret0);
1046 PyTuple_SetItem(ret,1,ret1);
1050 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1052 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1053 if(!PyTuple_Check(inp))
1054 throw INTERP_KERNEL::Exception(MSG);
1055 int sz(PyTuple_Size(inp));
1057 throw INTERP_KERNEL::Exception(MSG);
1058 PyObject *elt0(PyTuple_GetItem(inp,0));
1059 PyObject *elt1(PyTuple_GetItem(inp,1));
1060 std::vector<double> a0;
1061 std::vector<int> a1;
1062 std::vector<std::string> a2;
1063 DataArrayInt *b0(0);
1064 DataArrayDouble *b1(0);
1066 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1067 throw INTERP_KERNEL::Exception(MSG);
1068 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1070 fillArrayWithPyListDbl3(a0py,tmp,a0);
1071 convertPyToNewIntArr3(a1py,a1);
1072 fillStringVector(a2py,a2);
1075 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1076 throw INTERP_KERNEL::Exception(MSG);
1077 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1079 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1080 if(!SWIG_IsOK(status))
1081 throw INTERP_KERNEL::Exception(MSG);
1082 b0=reinterpret_cast<DataArrayInt *>(argp);
1083 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1084 if(!SWIG_IsOK(status))
1085 throw INTERP_KERNEL::Exception(MSG);
1086 b1=reinterpret_cast<DataArrayDouble *>(argp);
1088 // useless here to call resizeForUnserialization because arrays are well resized.
1089 self->unserialization(a0,a1,b0,b1,a2);
1092 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1094 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1095 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1096 return MEDCouplingMesh::MergeMeshes(tmp);
1102 //== MEDCouplingMesh End
1104 %include "NormalizedGeometricTypes"
1105 %include "MEDCouplingNatureOfFieldEnum"
1107 namespace MEDCoupling
1109 class MEDCouplingNatureOfField
1112 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1113 static std::string GetReprNoThrow(NatureOfField nat);
1114 static std::string GetAllPossibilitiesStr();
1118 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1119 // include "MEDCouplingTimeDiscretization.i"
1121 namespace MEDCoupling
1123 class MEDCouplingGaussLocalization
1126 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1127 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1128 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1129 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1130 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1131 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1132 int getDimension() const throw(INTERP_KERNEL::Exception);
1133 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1134 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1135 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1136 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1138 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1139 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1140 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1141 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1142 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1143 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1144 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1145 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1146 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1147 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1148 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1149 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1151 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1154 class MEDCouplingSkyLineArray
1157 MEDCouplingSkyLineArray();
1158 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray &myArray );
1159 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value );
1160 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value );
1162 void set( DataArrayInt* index, DataArrayInt* value );
1163 int getNumberOf() const;
1164 int getLength() const;
1165 DataArrayInt* getIndexArray() const;
1166 DataArrayInt* getValueArray() const;
1169 std::string __str__() const throw(INTERP_KERNEL::Exception)
1171 return self->simpleRepr();
1177 %include "MEDCouplingFieldDiscretization.i"
1179 //== MEDCouplingPointSet
1181 namespace MEDCoupling
1183 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1186 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1187 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1188 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1189 void zipCoords() throw(INTERP_KERNEL::Exception);
1190 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1191 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1192 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1193 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1194 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1195 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1196 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1197 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1198 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1199 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1200 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1201 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1202 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1203 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1204 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1205 virtual DataArrayInt *findBoundaryNodes() const;
1206 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1207 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1208 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1209 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1210 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1211 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1212 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1213 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1214 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1217 std::string __str__() const throw(INTERP_KERNEL::Exception)
1219 return self->simpleRepr();
1222 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1225 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1226 PyObject *res = PyList_New(2);
1227 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1228 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1232 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1234 DataArrayInt *comm, *commIndex;
1235 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1236 PyObject *res = PyList_New(2);
1237 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1238 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1242 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1244 DataArrayDouble *ret1=self->getCoords();
1247 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1250 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1252 int szArr,sw,iTypppArr;
1253 std::vector<int> stdvecTyyppArr;
1254 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1255 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1256 if(sw==3)//DataArrayInt
1258 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1259 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1260 std::string name=argpt->getName();
1262 ret->setName(name.c_str());
1264 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1267 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1269 int szArr,sw,iTypppArr;
1270 std::vector<int> stdvecTyyppArr;
1271 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1272 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1273 if(sw==3)//DataArrayInt
1275 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1276 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1277 std::string name=argpt->getName();
1279 ret->setName(name.c_str());
1281 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1284 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1286 int szArr,sw,iTypppArr;
1287 std::vector<int> stdvecTyyppArr;
1288 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1289 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1290 if(sw==3)//DataArrayInt
1292 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1293 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1294 std::string name=argpt->getName();
1296 ret->setName(name.c_str());
1298 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1301 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1303 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1304 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1307 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1309 int szArr,sw,iTypppArr;
1310 std::vector<int> stdvecTyyppArr;
1311 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1312 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1313 if(sw==3)//DataArrayInt
1315 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1316 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1317 std::string name=argpt->getName();
1319 ret->setName(name.c_str());
1321 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1324 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1326 int szArr,sw,iTypppArr;
1327 std::vector<int> stdvecTyyppArr;
1328 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1329 self->renumberNodes(tmp,newNbOfNodes);
1332 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1334 int szArr,sw,iTypppArr;
1335 std::vector<int> stdvecTyyppArr;
1336 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1337 self->renumberNodesCenter(tmp,newNbOfNodes);
1340 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1342 int spaceDim=self->getSpaceDimension();
1344 DataArrayDouble *a,*a2;
1345 DataArrayDoubleTuple *aa,*aa2;
1346 std::vector<double> bb,bb2;
1348 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1349 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1350 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1351 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1352 std::vector<int> nodes;
1353 self->findNodesOnLine(p,v,eps,nodes);
1354 DataArrayInt *ret=DataArrayInt::New();
1355 ret->alloc((int)nodes.size(),1);
1356 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1357 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1359 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1361 int spaceDim=self->getSpaceDimension();
1363 DataArrayDouble *a,*a2;
1364 DataArrayDoubleTuple *aa,*aa2;
1365 std::vector<double> bb,bb2;
1367 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1368 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1369 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1370 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1371 std::vector<int> nodes;
1372 self->findNodesOnPlane(p,v,eps,nodes);
1373 DataArrayInt *ret=DataArrayInt::New();
1374 ret->alloc((int)nodes.size(),1);
1375 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1376 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1379 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1383 DataArrayDoubleTuple *aa;
1384 std::vector<double> bb;
1386 int spaceDim=self->getSpaceDimension();
1387 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1388 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1389 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1390 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1393 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1395 DataArrayInt *c=0,*cI=0;
1399 DataArrayDoubleTuple *aa;
1400 std::vector<double> bb;
1402 int spaceDim=self->getSpaceDimension();
1403 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1404 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1405 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1406 PyObject *ret=PyTuple_New(2);
1407 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1408 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1412 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1414 DataArrayInt *c=0,*cI=0;
1415 int spaceDim=self->getSpaceDimension();
1418 DataArrayDoubleTuple *aa;
1419 std::vector<double> bb;
1422 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1423 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1425 PyObject *ret=PyTuple_New(2);
1426 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1427 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1431 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1435 DataArrayDoubleTuple *aa;
1436 std::vector<double> bb;
1438 int spaceDim=self->getSpaceDimension();
1439 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1440 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1442 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1443 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1446 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1450 std::vector<int> multiVal;
1451 std::pair<int, std::pair<int,int> > slic;
1452 MEDCoupling::DataArrayInt *daIntTyypp=0;
1453 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1457 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1459 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1461 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1463 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1467 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1469 DataArrayInt *v0=0,*v1=0;
1470 self->findCommonCells(compType,startCellId,v0,v1);
1471 PyObject *res = PyList_New(2);
1472 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1473 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1478 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1481 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1482 if (!SWIG_IsOK(res1))
1485 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1486 self->renumberNodesInConn(tmp);
1490 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1492 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1493 da2->checkAllocated();
1494 self->renumberNodesInConn(da2->getConstPointer());
1498 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1501 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1502 PyObject *ret=PyTuple_New(2);
1503 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1504 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1508 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1510 DataArrayInt *ret=0;
1512 int szArr,sw,iTypppArr;
1513 std::vector<int> stdvecTyyppArr;
1514 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1515 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1519 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1523 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1524 PyObject *res = PyList_New(3);
1525 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1526 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1527 PyList_SetItem(res,2,SWIG_From_int(ret2));
1531 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1535 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1536 PyObject *res = PyList_New(3);
1537 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1538 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1539 PyList_SetItem(res,2,SWIG_From_int(ret2));
1543 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1546 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1547 if (!SWIG_IsOK(res1))
1550 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1551 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1555 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1557 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1558 da2->checkAllocated();
1559 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1563 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1567 std::vector<int> multiVal;
1568 std::pair<int, std::pair<int,int> > slic;
1569 MEDCoupling::DataArrayInt *daIntTyypp=0;
1570 int nbc=self->getNumberOfCells();
1571 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1578 std::ostringstream oss;
1579 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1580 throw INTERP_KERNEL::Exception(oss.str().c_str());
1583 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1588 int tmp=nbc+singleVal;
1589 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1593 std::ostringstream oss;
1594 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1595 throw INTERP_KERNEL::Exception(oss.str().c_str());
1601 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1605 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1610 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1611 daIntTyypp->checkAllocated();
1612 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1615 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1619 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1622 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1623 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1624 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1625 for(int i=0;i<sz;i++)
1626 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1629 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1632 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1634 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1635 std::vector<double> val3;
1636 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1637 "Rotate2DAlg",2,true,nbNodes);
1639 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1640 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1643 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1646 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1647 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1648 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1649 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1650 for(int i=0;i<sz;i++)
1651 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1654 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1657 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1659 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1660 std::vector<double> val3;
1661 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1662 "Rotate3DAlg",3,true,nbNodes);
1664 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1665 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1666 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1671 //== MEDCouplingPointSet End
1673 class MEDCouplingUMeshCell
1676 INTERP_KERNEL::NormalizedCellType getType() const;
1679 std::string __str__() const throw(INTERP_KERNEL::Exception)
1681 return self->repr();
1684 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1687 const int *r=self->getAllConn(ret2);
1688 PyObject *ret=PyTuple_New(ret2);
1689 for(int i=0;i<ret2;i++)
1690 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1696 class MEDCouplingUMeshCellIterator
1703 MEDCouplingUMeshCell *ret=self->nextt();
1705 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1708 PyErr_SetString(PyExc_StopIteration,"No more data.");
1715 class MEDCouplingUMeshCellByTypeIterator
1718 ~MEDCouplingUMeshCellByTypeIterator();
1723 MEDCouplingUMeshCellEntry *ret=self->nextt();
1725 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1728 PyErr_SetString(PyExc_StopIteration,"No more data.");
1735 class MEDCouplingUMeshCellByTypeEntry
1738 ~MEDCouplingUMeshCellByTypeEntry();
1741 MEDCouplingUMeshCellByTypeIterator *__iter__()
1743 return self->iterator();
1748 class MEDCouplingUMeshCellEntry
1751 INTERP_KERNEL::NormalizedCellType getType() const;
1752 int getNumberOfElems() const;
1755 MEDCouplingUMeshCellIterator *__iter__()
1757 return self->iterator();
1762 //== MEDCouplingUMesh
1764 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1767 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1768 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1769 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1770 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1771 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1772 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1773 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1774 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1775 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1776 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1777 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1778 void computeTypes() throw(INTERP_KERNEL::Exception);
1779 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1780 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1782 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1783 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1784 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1785 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1786 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1787 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1788 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1789 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1790 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1791 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1792 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1793 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1794 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1795 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1796 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1797 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1798 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1799 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1800 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1801 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1802 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1803 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1804 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1805 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1806 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1807 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1808 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1809 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1810 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1811 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1812 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1813 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1814 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1815 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1816 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1817 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1818 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1819 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1820 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1821 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1822 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1823 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1824 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1825 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1826 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1827 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);
1828 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1829 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1830 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1831 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1832 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1834 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1836 return MEDCouplingUMesh::New();
1839 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1841 return MEDCouplingUMesh::New(meshName,meshDim);
1845 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1847 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1850 std::string __str__() const throw(INTERP_KERNEL::Exception)
1852 return self->simpleRepr();
1855 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1857 std::ostringstream oss;
1858 self->reprQuickOverview(oss);
1862 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1864 return self->cellIterator();
1867 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1869 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1870 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1871 PyObject *res=PyList_New(result.size());
1872 for(int i=0;iL!=result.end(); i++, iL++)
1873 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1877 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1881 std::vector<int> multiVal;
1882 std::pair<int, std::pair<int,int> > slic;
1883 MEDCoupling::DataArrayInt *daIntTyypp=0;
1884 int nbc=self->getNumberOfCells();
1885 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1892 std::ostringstream oss;
1893 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1894 throw INTERP_KERNEL::Exception(oss.str().c_str());
1898 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1905 int tmp=nbc+singleVal;
1906 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1911 std::ostringstream oss;
1912 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1913 throw INTERP_KERNEL::Exception(oss.str().c_str());
1919 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1925 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1926 daIntTyypp->checkAllocated();
1927 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1931 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1935 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1939 std::vector<int> multiVal;
1940 std::pair<int, std::pair<int,int> > slic;
1941 MEDCoupling::DataArrayInt *daIntTyypp=0;
1942 int nbc=self->getNumberOfCells();
1943 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1950 std::ostringstream oss;
1951 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1952 throw INTERP_KERNEL::Exception(oss.str().c_str());
1956 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1963 int tmp=nbc+singleVal;
1964 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1969 std::ostringstream oss;
1970 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1971 throw INTERP_KERNEL::Exception(oss.str().c_str());
1977 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1982 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1988 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1989 daIntTyypp->checkAllocated();
1990 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1994 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1998 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2000 int szArr,sw,iTypppArr;
2001 std::vector<int> stdvecTyyppArr;
2002 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2005 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2006 throw INTERP_KERNEL::Exception(oss.str().c_str());
2008 self->insertNextCell(type,size,tmp);
2011 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2013 int szArr,sw,iTypppArr;
2014 std::vector<int> stdvecTyyppArr;
2015 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2016 self->insertNextCell(type,szArr,tmp);
2019 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2021 DataArrayInt *ret=self->getNodalConnectivity();
2026 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2028 DataArrayInt *ret=self->getNodalConnectivityIndex();
2034 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2036 int szArr,sw,iTypppArr;
2037 std::vector<int> stdvecTyyppArr;
2038 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2039 int nbOfDepthPeelingPerformed=0;
2040 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2041 PyObject *res=PyTuple_New(2);
2042 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2043 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2047 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2049 DataArrayInt *v0=0,*v1=0;
2050 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2051 PyObject *res = PyList_New(2);
2052 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2053 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2057 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2061 DataArrayDoubleTuple *aa;
2062 std::vector<double> bb;
2064 int nbOfCompo=self->getSpaceDimension();
2065 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2068 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2069 PyObject *ret=PyTuple_New(2);
2070 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2071 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2075 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2077 DataArrayInt *ret1=0;
2078 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2079 PyObject *ret=PyTuple_New(2);
2080 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2081 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2085 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2088 DataArrayInt *ret1(0);
2089 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2090 PyObject *ret=PyTuple_New(3);
2091 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2092 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2093 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2097 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2099 std::vector<int> cells;
2100 self->checkButterflyCells(cells,eps);
2101 DataArrayInt *ret=DataArrayInt::New();
2102 ret->alloc((int)cells.size(),1);
2103 std::copy(cells.begin(),cells.end(),ret->getPointer());
2104 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2107 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2109 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2111 PyObject *ret = PyList_New(sz);
2112 for(int i=0;i<sz;i++)
2113 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2117 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2119 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2120 int sz=retCpp.size();
2121 PyObject *ret=PyList_New(sz);
2122 for(int i=0;i<sz;i++)
2123 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2127 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2130 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2131 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2132 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2135 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2138 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2139 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2143 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2146 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2147 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2151 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2153 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2154 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2155 PyObject *ret=PyTuple_New(3);
2156 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2157 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2158 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2162 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2164 DataArrayInt *tmp0=0,*tmp1=0;
2165 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2166 PyObject *ret=PyTuple_New(2);
2167 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2168 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2172 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2176 std::vector<int> multiVal;
2177 std::pair<int, std::pair<int,int> > slic;
2178 MEDCoupling::DataArrayInt *daIntTyypp=0;
2179 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2183 return self->duplicateNodes(&singleVal,&singleVal+1);
2185 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2187 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2189 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2193 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2197 std::vector<int> multiVal;
2198 std::pair<int, std::pair<int,int> > slic;
2199 MEDCoupling::DataArrayInt *daIntTyypp=0;
2200 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2204 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2206 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2208 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2210 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2214 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2217 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2218 DataArrayInt *tmp0,*tmp1=0;
2219 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2220 PyObject *ret=PyTuple_New(2);
2221 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2222 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2226 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2228 DataArrayInt *ret0=0,*ret1=0;
2229 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2230 PyObject *ret=PyTuple_New(2);
2231 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2232 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2236 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2238 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2239 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2240 DataArrayInt *ret1=0,*ret2=0;
2241 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2242 PyObject *ret=PyTuple_New(3);
2243 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2244 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2245 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2249 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2251 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2252 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2253 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2254 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2257 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2260 std::vector<const MEDCouplingUMesh *> meshes;
2261 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2262 std::vector<DataArrayInt *> corr;
2263 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2265 PyObject *ret1=PyList_New(sz);
2266 for(int i=0;i<sz;i++)
2267 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2268 PyObject *ret=PyList_New(2);
2269 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2270 PyList_SetItem(ret,1,ret1);
2274 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2276 std::vector<MEDCouplingUMesh *> meshes;
2277 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2278 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2281 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2283 std::vector<MEDCouplingUMesh *> meshes;
2284 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2285 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2288 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2292 std::vector<int> multiVal;
2293 std::pair<int, std::pair<int,int> > slic;
2294 MEDCoupling::DataArrayInt *daIntTyypp=0;
2296 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2297 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2301 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2303 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2305 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2307 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2311 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2313 DataArrayInt *arrOut=0,*arrIndexOut=0;
2316 std::vector<int> multiVal;
2317 std::pair<int, std::pair<int,int> > slic;
2318 MEDCoupling::DataArrayInt *daIntTyypp=0;
2320 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2321 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2326 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2331 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2336 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2340 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2342 PyObject *ret=PyTuple_New(2);
2343 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2344 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2348 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2350 DataArrayInt *arrOut=0,*arrIndexOut=0;
2351 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2352 PyObject *ret=PyTuple_New(2);
2353 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2354 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2358 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2360 if(!PySlice_Check(slic))
2361 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2362 Py_ssize_t strt=2,stp=2,step=2;
2363 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2365 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2366 arrIndxIn->checkAllocated();
2367 if(arrIndxIn->getNumberOfComponents()!=1)
2368 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2369 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2370 DataArrayInt *arrOut=0,*arrIndexOut=0;
2371 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2372 PyObject *ret=PyTuple_New(2);
2373 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2374 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2378 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2379 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2380 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2382 DataArrayInt *arrOut=0,*arrIndexOut=0;
2385 std::vector<int> multiVal;
2386 std::pair<int, std::pair<int,int> > slic;
2387 MEDCoupling::DataArrayInt *daIntTyypp=0;
2389 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2390 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2395 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2400 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2405 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2409 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2411 PyObject *ret=PyTuple_New(2);
2412 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2413 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2417 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2418 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2422 std::vector<int> multiVal;
2423 std::pair<int, std::pair<int,int> > slic;
2424 MEDCoupling::DataArrayInt *daIntTyypp=0;
2426 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2427 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2432 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2437 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2442 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2446 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2450 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2454 DataArrayDoubleTuple *aa;
2455 std::vector<double> bb;
2457 int spaceDim=self->getSpaceDimension();
2458 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2459 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2461 std::vector<int> cells;
2462 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2463 DataArrayInt *ret=DataArrayInt::New();
2464 ret->alloc((int)cells.size(),1);
2465 std::copy(cells.begin(),cells.end(),ret->getPointer());
2466 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2469 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2473 DataArrayDoubleTuple *aa;
2474 std::vector<double> bb;
2476 int spaceDim=self->getSpaceDimension();
2477 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2478 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2479 self->orientCorrectly2DCells(v,polyOnly);
2482 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2484 std::vector<int> cells;
2485 self->arePolyhedronsNotCorrectlyOriented(cells);
2486 DataArrayInt *ret=DataArrayInt::New();
2487 ret->alloc((int)cells.size(),1);
2488 std::copy(cells.begin(),cells.end(),ret->getPointer());
2489 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2492 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2496 self->getFastAveragePlaneOfThis(vec,pos);
2498 std::copy(vec,vec+3,vals);
2499 std::copy(pos,pos+3,vals+3);
2500 return convertDblArrToPyListOfTuple(vals,3,2);
2503 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2505 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2506 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2507 return MEDCouplingUMesh::MergeUMeshes(tmp);
2510 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2513 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2514 PyObject *ret=PyTuple_New(2);
2515 PyObject *ret0Py=ret0?Py_True:Py_False;
2517 PyTuple_SetItem(ret,0,ret0Py);
2518 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2522 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2525 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2526 PyObject *ret=PyTuple_New(2);
2527 PyObject *ret0Py=ret0?Py_True:Py_False;
2529 PyTuple_SetItem(ret,0,ret0Py);
2530 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2534 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2536 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2537 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2538 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2539 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2540 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2541 PyObject *ret=PyTuple_New(5);
2542 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2543 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2544 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2545 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2546 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2550 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2552 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2553 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2554 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2555 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2556 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2557 PyObject *ret=PyTuple_New(5);
2558 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2559 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2560 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2561 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2562 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2566 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2568 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2569 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2570 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2571 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2572 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2573 PyObject *ret=PyTuple_New(5);
2574 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2575 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2576 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2577 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2578 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2582 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2584 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2585 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2586 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2587 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2588 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2589 PyObject *ret=PyTuple_New(5);
2590 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2591 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2592 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2593 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2594 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2598 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2600 DataArrayInt *neighbors=0,*neighborsIdx=0;
2601 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2602 PyObject *ret=PyTuple_New(2);
2603 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2604 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2608 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2610 DataArrayInt *neighbors=0,*neighborsIdx=0;
2611 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2612 PyObject *ret=PyTuple_New(2);
2613 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2614 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2618 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2620 DataArrayInt *neighbors=0,*neighborsIdx=0;
2621 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2622 PyObject *ret=PyTuple_New(2);
2623 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2624 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2628 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2630 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2631 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2632 DataArrayInt *d2,*d3,*d4,*dd5;
2633 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2634 PyObject *ret=PyTuple_New(7);
2635 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2636 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2637 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2638 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2639 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2640 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2641 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2645 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2648 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2649 da->checkAllocated();
2650 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2653 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2656 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2657 da->checkAllocated();
2658 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2661 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2664 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2665 da->checkAllocated();
2666 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2669 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2672 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2673 da->checkAllocated();
2674 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2675 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2676 PyObject *res = PyList_New(result.size());
2677 for (int i=0;iL!=result.end(); i++, iL++)
2678 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2682 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2685 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2686 da->checkAllocated();
2687 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2688 ret->setName(da->getName().c_str());
2692 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2694 DataArrayInt *cellNb1=0,*cellNb2=0;
2695 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2696 PyObject *ret=PyTuple_New(3);
2697 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2698 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2699 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2703 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2705 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2706 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2707 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2708 PyObject *ret(PyTuple_New(4));
2709 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2710 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2711 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2712 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2716 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2718 int spaceDim=self->getSpaceDimension();
2720 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2722 DataArrayDouble *a,*a2;
2723 DataArrayDoubleTuple *aa,*aa2;
2724 std::vector<double> bb,bb2;
2726 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2727 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2728 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2729 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2731 DataArrayInt *cellIds=0;
2732 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2733 PyObject *ret=PyTuple_New(2);
2734 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2735 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2739 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2741 int spaceDim=self->getSpaceDimension();
2743 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2745 DataArrayDouble *a,*a2;
2746 DataArrayDoubleTuple *aa,*aa2;
2747 std::vector<double> bb,bb2;
2749 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2750 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2751 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2752 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2754 DataArrayInt *cellIds=0;
2755 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2756 PyObject *ret=PyTuple_New(2);
2757 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2758 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2762 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2764 int spaceDim=self->getSpaceDimension();
2766 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2768 DataArrayDouble *a,*a2;
2769 DataArrayDoubleTuple *aa,*aa2;
2770 std::vector<double> bb,bb2;
2772 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2773 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2774 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2775 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2776 return self->getCellIdsCrossingPlane(orig,vect,eps);
2779 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2783 std::vector<int> pos2;
2784 DataArrayInt *pos3=0;
2785 DataArrayIntTuple *pos4=0;
2786 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2791 self->convertToPolyTypes(&pos1,&pos1+1);
2798 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2803 self->convertToPolyTypes(pos3->begin(),pos3->end());
2807 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2811 void convertAllToPoly();
2812 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2813 bool unPolyze() throw(INTERP_KERNEL::Exception);
2814 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2815 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2816 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2819 //== MEDCouplingUMesh End
2821 //== MEDCouplingMappedExtrudedMesh
2823 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
2826 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2827 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2829 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2831 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2834 MEDCouplingMappedExtrudedMesh()
2836 return MEDCouplingMappedExtrudedMesh::New();
2839 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2841 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
2844 std::string __str__() const throw(INTERP_KERNEL::Exception)
2846 return self->simpleRepr();
2849 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2851 std::ostringstream oss;
2852 self->reprQuickOverview(oss);
2856 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2858 MEDCouplingUMesh *ret=self->getMesh2D();
2861 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2863 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2865 MEDCouplingUMesh *ret=self->getMesh1D();
2868 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2870 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2872 DataArrayInt *ret=self->getMesh3DIds();
2875 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2880 //== MEDCouplingMappedExtrudedMesh End
2882 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
2885 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2886 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2887 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2888 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2889 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2890 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2893 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2895 int szArr,sw,iTypppArr;
2896 std::vector<int> stdvecTyyppArr;
2897 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2898 self->insertNextCell(tmp,tmp+szArr);
2901 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2903 DataArrayInt *ret=self->getNodalConnectivity();
2904 if(ret) ret->incrRef();
2908 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2910 std::vector< const MEDCoupling1GTUMesh *> parts;
2911 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2912 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2917 //== MEDCoupling1SGTUMesh
2919 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
2922 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2923 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2924 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2925 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2926 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2927 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2928 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2929 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
2930 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
2933 MEDCoupling1SGTUMesh()
2935 return MEDCoupling1SGTUMesh::New();
2938 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2940 return MEDCoupling1SGTUMesh::New(name,type);
2943 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2945 return MEDCoupling1SGTUMesh::New(m);
2948 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2950 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
2953 std::string __str__() const throw(INTERP_KERNEL::Exception)
2955 return self->simpleRepr();
2958 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2960 std::ostringstream oss;
2961 self->reprQuickOverview(oss);
2965 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
2967 DataArrayInt *cellPerm(0),*nodePerm(0);
2968 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
2969 PyObject *ret(PyTuple_New(3));
2970 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
2971 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2972 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2976 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2978 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
2979 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2980 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2983 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2985 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
2986 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2987 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2992 //== MEDCoupling1SGTUMesh End
2994 //== MEDCoupling1DGTUMesh
2996 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
2999 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3000 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3001 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3002 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3003 bool isPacked() const throw(INTERP_KERNEL::Exception);
3006 MEDCoupling1DGTUMesh()
3008 return MEDCoupling1DGTUMesh::New();
3010 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3012 return MEDCoupling1DGTUMesh::New(name,type);
3015 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3017 return MEDCoupling1DGTUMesh::New(m);
3020 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3022 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3025 std::string __str__() const throw(INTERP_KERNEL::Exception)
3027 return self->simpleRepr();
3030 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3032 std::ostringstream oss;
3033 self->reprQuickOverview(oss);
3037 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3039 DataArrayInt *ret=self->getNodalConnectivityIndex();
3040 if(ret) ret->incrRef();
3044 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3046 DataArrayInt *ret1=0,*ret2=0;
3047 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3048 PyObject *ret0Py=ret0?Py_True:Py_False;
3050 PyObject *ret=PyTuple_New(3);
3051 PyTuple_SetItem(ret,0,ret0Py);
3052 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3053 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3057 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3060 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3061 PyObject *ret=PyTuple_New(2);
3062 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3063 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3064 PyTuple_SetItem(ret,1,ret1Py);
3068 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3070 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3071 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3072 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3075 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3077 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3078 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3079 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3082 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3084 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3085 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3086 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3091 //== MEDCoupling1DGTUMeshEnd
3093 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3096 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3097 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3098 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3099 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3100 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3101 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3102 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3103 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3104 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3105 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3106 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3107 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3108 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3109 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3110 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3113 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3115 int tmpp1=-1,tmpp2=-1;
3116 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3117 std::vector< std::pair<int,int> > inp;
3121 for(int i=0;i<tmpp1;i++)
3122 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3127 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3128 inp.resize(tmpp1/2);
3129 for(int i=0;i<tmpp1/2;i++)
3130 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3133 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3134 return self->buildStructuredSubPart(inp);
3137 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3139 std::vector< std::pair<int,int> > inp;
3140 convertPyToVectorPairInt(part,inp);
3142 int szArr,sw,iTypppArr;
3143 std::vector<int> stdvecTyyppArr;
3144 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3145 std::vector<int> tmp5(tmp4,tmp4+szArr);
3147 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3150 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3152 std::vector< std::pair<int,int> > inp;
3153 convertPyToVectorPairInt(part,inp);
3154 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3157 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3159 std::vector< std::pair<int,int> > inp;
3160 convertPyToVectorPairInt(part,inp);
3161 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3164 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3166 std::vector< std::pair<int,int> > inp;
3167 convertPyToVectorPairInt(part,inp);
3168 std::vector<int> stWithGhost;
3169 std::vector< std::pair<int,int> > partWithGhost;
3170 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3171 PyObject *ret(PyTuple_New(2));
3172 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3173 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3177 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3179 std::vector< std::pair<int,int> > inp;
3180 convertPyToVectorPairInt(partCompactFormat,inp);
3181 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3184 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3186 std::vector< std::pair<int,int> > inp;
3187 convertPyToVectorPairInt(partCompactFormat,inp);
3188 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3191 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3193 std::vector< std::pair<int,int> > inp;
3194 convertPyToVectorPairInt(part,inp);
3195 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3198 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3200 int szArr,sw,iTypppArr;
3201 std::vector<int> stdvecTyyppArr;
3202 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3203 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3206 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(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::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3214 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3216 std::vector< std::pair<int,int> > inp;
3217 convertPyToVectorPairInt(partCompactFormat,inp);
3218 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3221 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3223 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3224 PyObject *retPy=PyList_New(ret.size());
3225 for(std::size_t i=0;i<ret.size();i++)
3227 PyObject *tmp=PyTuple_New(2);
3228 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3229 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3230 PyList_SetItem(retPy,i,tmp);
3235 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3237 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3238 convertPyToVectorPairInt(r1,r1Cpp);
3239 convertPyToVectorPairInt(r2,r2Cpp);
3240 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3241 PyObject *retPy=PyList_New(ret.size());
3242 for(std::size_t i=0;i<ret.size();i++)
3244 PyObject *tmp=PyTuple_New(2);
3245 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3246 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3247 PyList_SetItem(retPy,i,tmp);
3252 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3254 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3255 convertPyToVectorPairInt(r1,r1Cpp);
3256 convertPyToVectorPairInt(r2,r2Cpp);
3257 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3260 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3262 int szArr,sw,iTypppArr;
3263 std::vector<int> stdvecTyyppArr;
3264 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3265 int szArr2,sw2,iTypppArr2;
3266 std::vector<int> stdvecTyyppArr2;
3267 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3268 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3269 std::vector< std::pair<int,int> > partCompactFormat;
3270 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3271 PyObject *ret=PyTuple_New(2);
3272 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3273 PyTuple_SetItem(ret,0,ret0Py);
3274 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3275 for(std::size_t i=0;i<partCompactFormat.size();i++)
3277 PyObject *tmp4=PyTuple_New(2);
3278 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3279 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3280 PyList_SetItem(ret1Py,i,tmp4);
3282 PyTuple_SetItem(ret,1,ret1Py);
3286 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3288 std::vector< std::pair<int,int> > param0,param1,ret;
3289 convertPyToVectorPairInt(bigInAbs,param0);
3290 convertPyToVectorPairInt(partOfBigInAbs,param1);
3291 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3292 PyObject *retPy(PyList_New(ret.size()));
3293 for(std::size_t i=0;i<ret.size();i++)
3295 PyObject *tmp(PyTuple_New(2));
3296 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3297 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3298 PyList_SetItem(retPy,i,tmp);
3303 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3305 std::vector< std::pair<int,int> > param0;
3306 convertPyToVectorPairInt(part,param0);
3307 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3308 PyObject *retPy(PyList_New(ret.size()));
3309 for(std::size_t i=0;i<ret.size();i++)
3311 PyObject *tmp(PyTuple_New(2));
3312 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3313 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3314 PyList_SetItem(retPy,i,tmp);
3319 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3321 std::vector< std::pair<int,int> > param0,param1;
3322 convertPyToVectorPairInt(startingFrom,param0);
3323 convertPyToVectorPairInt(goingTo,param1);
3324 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3327 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3329 std::vector< std::pair<int,int> > param0,param1,ret;
3330 convertPyToVectorPairInt(bigInAbs,param0);
3331 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3332 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3333 PyObject *retPy(PyList_New(ret.size()));
3334 for(std::size_t i=0;i<ret.size();i++)
3336 PyObject *tmp(PyTuple_New(2));
3337 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3338 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3339 PyList_SetItem(retPy,i,tmp);
3346 class MEDCouplingCurveLinearMesh;
3348 //== MEDCouplingCMesh
3350 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3353 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3354 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3355 void setCoords(const DataArrayDouble *coordsX,
3356 const DataArrayDouble *coordsY=0,
3357 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3358 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3359 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3361 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3363 return MEDCouplingCMesh::New();
3365 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3367 return MEDCouplingCMesh::New(meshName);
3370 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3372 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3374 std::string __str__() const throw(INTERP_KERNEL::Exception)
3376 return self->simpleRepr();
3378 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3380 std::ostringstream oss;
3381 self->reprQuickOverview(oss);
3384 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3386 DataArrayDouble *ret=self->getCoordsAt(i);
3394 //== MEDCouplingCMesh End
3396 //== MEDCouplingCurveLinearMesh
3398 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3401 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3402 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3403 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3405 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3407 return MEDCouplingCurveLinearMesh::New();
3409 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3411 return MEDCouplingCurveLinearMesh::New(meshName);
3413 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3415 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3417 std::string __str__() const throw(INTERP_KERNEL::Exception)
3419 return self->simpleRepr();
3421 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3423 std::ostringstream oss;
3424 self->reprQuickOverview(oss);
3427 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3429 DataArrayDouble *ret=self->getCoords();
3434 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3436 int szArr,sw,iTypppArr;
3437 std::vector<int> stdvecTyyppArr;
3438 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3439 self->setNodeGridStructure(tmp,tmp+szArr);
3444 //== MEDCouplingCurveLinearMesh End
3446 //== MEDCouplingIMesh
3448 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3451 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3453 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3454 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3455 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3456 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3457 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3458 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3459 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3460 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3461 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3462 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3463 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3468 return MEDCouplingIMesh::New();
3470 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3472 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3473 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3474 const int *nodeStrctPtr(0);
3475 const double *originPtr(0),*dxyzPtr(0);
3477 std::vector<int> bb0;
3478 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3481 std::vector<double> bb,bb2;
3483 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3484 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3486 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3489 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3491 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3494 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3496 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3499 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3502 std::vector<int> bb0;
3503 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3504 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3507 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3509 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3512 DataArrayDoubleTuple *aa;
3513 std::vector<double> bb;
3515 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3516 self->setOrigin(originPtr,originPtr+nbTuples);
3519 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3521 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3524 DataArrayDoubleTuple *aa;
3525 std::vector<double> bb;
3527 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3528 self->setDXYZ(originPtr,originPtr+nbTuples);
3531 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3533 std::vector< std::pair<int,int> > inp;
3534 convertPyToVectorPairInt(fineLocInCoarse,inp);
3535 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3538 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)
3540 std::vector< std::pair<int,int> > inp;
3541 convertPyToVectorPairInt(fineLocInCoarse,inp);
3542 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3545 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3547 std::vector< std::pair<int,int> > inp;
3548 convertPyToVectorPairInt(fineLocInCoarse,inp);
3549 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3552 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)
3554 std::vector< std::pair<int,int> > inp;
3555 convertPyToVectorPairInt(fineLocInCoarse,inp);
3556 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3559 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)
3561 std::vector< std::pair<int,int> > inp;
3562 convertPyToVectorPairInt(fineLocInCoarse,inp);
3563 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3566 std::string __str__() const throw(INTERP_KERNEL::Exception)
3568 return self->simpleRepr();
3570 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3572 std::ostringstream oss;
3573 self->reprQuickOverview(oss);
3579 //== MEDCouplingIMesh End
3583 namespace MEDCoupling
3585 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3588 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3589 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3590 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3591 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3592 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3593 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3594 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3595 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3596 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3597 std::string getName() const throw(INTERP_KERNEL::Exception);
3598 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3599 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3600 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3601 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3602 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3603 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3604 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3605 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3606 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3607 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3608 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3609 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3610 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3611 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3612 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3613 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3615 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3617 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3620 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3623 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3625 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3628 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3631 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3633 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3634 return convertIntArrToPyList3(ret);
3637 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3640 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3641 PyObject *ret=PyTuple_New(2);
3642 PyObject *ret0Py=ret0?Py_True:Py_False;
3644 PyTuple_SetItem(ret,0,ret0Py);
3645 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3649 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3651 DataArrayInt *ret1=0;
3652 MEDCouplingMesh *ret0=0;
3654 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3655 if (!SWIG_IsOK(res1))
3658 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3659 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3663 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3665 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3666 da2->checkAllocated();
3667 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3669 PyObject *res = PyList_New(2);
3670 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3671 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3675 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3677 DataArrayInt *ret1=0;
3679 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3680 PyObject *res=PyTuple_New(2);
3681 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3683 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3686 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3687 PyTuple_SetItem(res,1,res1);
3692 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3695 int v0; std::vector<int> v1;
3696 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3697 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3700 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3701 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3704 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3705 if (!SWIG_IsOK(res1))
3708 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3709 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3713 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3715 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3716 da2->checkAllocated();
3717 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3721 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3723 std::vector<int> tmp;
3724 self->getCellIdsHavingGaussLocalization(locId,tmp);
3725 DataArrayInt *ret=DataArrayInt::New();
3726 ret->alloc((int)tmp.size(),1);
3727 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3728 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3731 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3733 std::vector<int> inp0;
3734 convertPyToNewIntArr4(code,1,3,inp0);
3735 std::vector<const DataArrayInt *> inp1;
3736 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3737 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3742 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3745 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3746 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3747 static MEDCouplingFieldTemplate *New(TypeOfField type);
3748 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3749 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3752 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3754 return MEDCouplingFieldTemplate::New(f);
3757 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3759 return MEDCouplingFieldTemplate::New(f);
3762 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3764 return MEDCouplingFieldTemplate::New(type);
3767 std::string __str__() const throw(INTERP_KERNEL::Exception)
3769 return self->simpleRepr();
3772 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3774 std::ostringstream oss;
3775 self->reprQuickOverview(oss);
3781 class MEDCouplingFieldInt;
3783 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3786 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3787 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3788 void setTimeUnit(const std::string& unit);
3789 std::string getTimeUnit() const;
3790 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3791 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3792 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3793 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3794 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3795 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3796 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
3797 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3798 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3799 MEDCouplingFieldDouble *deepCopy() const;
3800 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
3801 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3802 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3803 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3804 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3805 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3806 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3807 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3808 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3809 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3810 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3811 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3812 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3813 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3814 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3815 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3816 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3817 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3818 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3819 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3820 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3821 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3822 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3823 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3824 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3825 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3826 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3827 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3828 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3829 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3830 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3831 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3832 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3833 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3834 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3835 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3836 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3837 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3838 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3839 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3840 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3841 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3842 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3843 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3844 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3845 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3846 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3847 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3848 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3849 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3850 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3851 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3852 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3853 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3854 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3855 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3856 double getMinValue() const throw(INTERP_KERNEL::Exception);
3857 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3858 double norm2() const throw(INTERP_KERNEL::Exception);
3859 double normMax() const throw(INTERP_KERNEL::Exception);
3860 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3861 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3862 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3863 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3864 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3865 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3866 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3867 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3868 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3869 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3870 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3871 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3872 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3873 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3874 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3875 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3876 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3877 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3878 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3879 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3880 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3881 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3883 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3885 return MEDCouplingFieldDouble::New(type,td);
3888 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3890 return MEDCouplingFieldDouble::New(ft,td);
3893 std::string __str__() const throw(INTERP_KERNEL::Exception)
3895 return self->simpleRepr();
3898 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3900 std::ostringstream oss;
3901 self->reprQuickOverview(oss);
3905 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3907 DataArrayDouble *ret=self->getArray();
3913 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3915 std::vector<DataArrayDouble *> arrs=self->getArrays();
3916 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3920 PyObject *ret=PyTuple_New(sz);
3921 for(int i=0;i<sz;i++)
3924 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3926 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
3931 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3933 std::vector<const DataArrayDouble *> tmp;
3934 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
3936 std::vector<DataArrayDouble *> arrs(sz);
3937 for(int i=0;i<sz;i++)
3938 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3939 self->setArrays(arrs);
3942 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3944 DataArrayDouble *ret=self->getEndArray();
3950 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3954 DataArrayDoubleTuple *aa;
3955 std::vector<double> bb;
3957 const MEDCouplingMesh *mesh=self->getMesh();
3959 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3960 int spaceDim=mesh->getSpaceDimension();
3961 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3962 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3964 int sz=self->getNumberOfComponents();
3965 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3966 self->getValueOn(spaceLoc,res);
3967 return convertDblArrToPyList(res,sz);
3970 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3972 int sz=self->getNumberOfComponents();
3973 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3974 self->getValueOnPos(i,j,k,res);
3975 return convertDblArrToPyList(res,sz);
3978 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3980 const MEDCouplingMesh *mesh(self->getMesh());
3982 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3985 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3986 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3987 mesh->getSpaceDimension(),true,nbPts);
3988 return self->getValueOnMulti(inp,nbPts);
3991 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3995 DataArrayDoubleTuple *aa;
3996 std::vector<double> bb;
3998 const MEDCouplingMesh *mesh=self->getMesh();
4000 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4001 int spaceDim=mesh->getSpaceDimension();
4002 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4003 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4006 int sz=self->getNumberOfComponents();
4007 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4008 self->getValueOn(spaceLoc,time,res);
4009 return convertDblArrToPyList(res,sz);
4012 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4014 if(self->getArray()!=0)
4015 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4018 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4019 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4020 self->setArray(arr);
4024 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4027 double tmp0=self->getTime(tmp1,tmp2);
4028 PyObject *res = PyList_New(3);
4029 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4030 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4031 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4035 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4038 double tmp0=self->getStartTime(tmp1,tmp2);
4039 PyObject *res = PyList_New(3);
4040 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4041 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4042 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4046 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4049 double tmp0=self->getEndTime(tmp1,tmp2);
4050 PyObject *res = PyList_New(3);
4051 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4052 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4053 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4056 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4058 int sz=self->getNumberOfComponents();
4059 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4060 self->accumulate(tmp);
4061 return convertDblArrToPyList(tmp,sz);
4063 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4065 int sz=self->getNumberOfComponents();
4066 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4067 self->integral(isWAbs,tmp);
4068 return convertDblArrToPyList(tmp,sz);
4070 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4072 int sz=self->getNumberOfComponents();
4073 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4074 self->getWeightedAverageValue(tmp,isWAbs);
4075 return convertDblArrToPyList(tmp,sz);
4077 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4079 int sz=self->getNumberOfComponents();
4080 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4082 return convertDblArrToPyList(tmp,sz);
4084 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4086 int sz=self->getNumberOfComponents();
4087 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4089 return convertDblArrToPyList(tmp,sz);
4091 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4093 int szArr,sw,iTypppArr;
4094 std::vector<int> stdvecTyyppArr;
4095 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4096 self->renumberCells(tmp,check);
4099 void renumberCellsWithoutMesh(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->renumberCellsWithoutMesh(tmp,check);
4107 void renumberNodes(PyObject *li, double eps=1e-15) 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->renumberNodes(tmp,eps);
4115 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, 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->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4123 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4127 std::vector<int> multiVal;
4128 std::pair<int, std::pair<int,int> > slic;
4129 MEDCoupling::DataArrayInt *daIntTyypp=0;
4130 const MEDCouplingMesh *mesh=self->getMesh();
4132 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4133 int nbc=mesh->getNumberOfCells();
4134 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4141 std::ostringstream oss;
4142 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4143 throw INTERP_KERNEL::Exception(oss.str().c_str());
4146 return self->buildSubPart(&singleVal,&singleVal+1);
4151 int tmp=nbc+singleVal;
4152 return self->buildSubPart(&tmp,&tmp+1);
4156 std::ostringstream oss;
4157 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4158 throw INTERP_KERNEL::Exception(oss.str().c_str());
4164 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4168 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4173 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4174 daIntTyypp->checkAllocated();
4175 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4178 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4182 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4184 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";
4185 if(PyTuple_Check(li))
4187 Py_ssize_t sz=PyTuple_Size(li);
4189 throw INTERP_KERNEL::Exception(msg);
4190 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4193 std::vector<int> multiVal;
4194 std::pair<int, std::pair<int,int> > slic;
4195 MEDCoupling::DataArrayInt *daIntTyypp=0;
4196 if(!self->getArray())
4197 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4199 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4200 catch(INTERP_KERNEL::Exception& e)
4201 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4202 MCAuto<MEDCouplingFieldDouble> ret0=MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4203 DataArrayDouble *ret0Arr=ret0->getArray();
4205 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4210 std::vector<int> v2(1,singleVal);
4211 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4212 ret0->setArray(aarr);
4217 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4218 ret0->setArray(aarr);
4223 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4224 std::vector<int> v2(nbOfComp);
4225 for(int i=0;i<nbOfComp;i++)
4226 v2[i]=slic.first+i*slic.second.second;
4227 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4228 ret0->setArray(aarr);
4232 throw INTERP_KERNEL::Exception(msg);
4237 return MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,li);
4240 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4243 double r1=self->getMaxValue2(tmp);
4244 PyObject *ret=PyTuple_New(2);
4245 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4246 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4250 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4253 double r1=self->getMinValue2(tmp);
4254 PyObject *ret=PyTuple_New(2);
4255 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4256 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4260 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4262 std::vector<int> tmp;
4263 convertPyToNewIntArr3(li,tmp);
4264 return self->keepSelectedComponents(tmp);
4267 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4269 std::vector<int> tmp;
4270 convertPyToNewIntArr3(li,tmp);
4271 self->setSelectedComponents(f,tmp);
4274 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4277 DataArrayDouble *a,*a2;
4278 DataArrayDoubleTuple *aa,*aa2;
4279 std::vector<double> bb,bb2;
4282 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4283 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4284 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4285 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4287 return self->extractSlice3D(orig,vect,eps);
4290 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4292 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4295 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4297 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4300 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4302 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.";
4303 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4306 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4308 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4310 return (*self)-(*other);
4312 throw INTERP_KERNEL::Exception(msg);
4317 DataArrayDoubleTuple *aa;
4318 std::vector<double> bb;
4320 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4325 if(!self->getArray())
4326 throw INTERP_KERNEL::Exception(msg2);
4327 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4328 ret->applyLin(1.,-val);
4329 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4330 ret2->setArray(ret);
4335 if(!self->getArray())
4336 throw INTERP_KERNEL::Exception(msg2);
4337 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4338 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4339 ret2->setArray(ret);
4344 if(!self->getArray())
4345 throw INTERP_KERNEL::Exception(msg2);
4346 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4347 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4348 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4349 ret2->setArray(ret);
4354 if(!self->getArray())
4355 throw INTERP_KERNEL::Exception(msg2);
4356 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4357 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4358 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4359 ret2->setArray(ret);
4363 { throw INTERP_KERNEL::Exception(msg); }
4367 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4369 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4372 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4374 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4377 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4379 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4382 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4384 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.";
4385 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4388 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4390 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4392 return (*self)/(*other);
4394 throw INTERP_KERNEL::Exception(msg);
4399 DataArrayDoubleTuple *aa;
4400 std::vector<double> bb;
4402 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4408 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4409 if(!self->getArray())
4410 throw INTERP_KERNEL::Exception(msg2);
4411 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4412 ret->applyLin(1./val,0);
4413 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4414 ret2->setArray(ret);
4419 if(!self->getArray())
4420 throw INTERP_KERNEL::Exception(msg2);
4421 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4422 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4423 ret2->setArray(ret);
4428 if(!self->getArray())
4429 throw INTERP_KERNEL::Exception(msg2);
4430 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4431 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4432 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4433 ret2->setArray(ret);
4438 if(!self->getArray())
4439 throw INTERP_KERNEL::Exception(msg2);
4440 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4441 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4442 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4443 ret2->setArray(ret);
4447 { throw INTERP_KERNEL::Exception(msg); }
4451 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4453 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4456 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4458 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.";
4459 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4462 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4464 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4466 return (*self)^(*other);
4468 throw INTERP_KERNEL::Exception(msg);
4473 DataArrayDoubleTuple *aa;
4474 std::vector<double> bb;
4476 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4481 if(!self->getArray())
4482 throw INTERP_KERNEL::Exception(msg2);
4483 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4485 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4486 ret2->setArray(ret);
4491 if(!self->getArray())
4492 throw INTERP_KERNEL::Exception(msg2);
4493 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4494 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4495 ret2->setArray(ret);
4500 if(!self->getArray())
4501 throw INTERP_KERNEL::Exception(msg2);
4502 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4503 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4504 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4505 ret2->setArray(ret);
4510 if(!self->getArray())
4511 throw INTERP_KERNEL::Exception(msg2);
4512 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4513 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4514 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4515 ret2->setArray(ret);
4519 { throw INTERP_KERNEL::Exception(msg); }
4523 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4525 return self->negate();
4528 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4530 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.";
4531 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4534 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4536 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4540 Py_XINCREF(trueSelf);
4544 throw INTERP_KERNEL::Exception(msg);
4549 DataArrayDoubleTuple *aa;
4550 std::vector<double> bb;
4552 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4557 if(!self->getArray())
4558 throw INTERP_KERNEL::Exception(msg2);
4559 self->getArray()->applyLin(1.,val);
4560 Py_XINCREF(trueSelf);
4565 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4568 Py_XINCREF(trueSelf);
4573 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4574 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4575 ret2->setArray(aaa);
4577 Py_XINCREF(trueSelf);
4582 if(!self->getArray())
4583 throw INTERP_KERNEL::Exception(msg2);
4584 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4585 self->getArray()->addEqual(aaa);
4586 Py_XINCREF(trueSelf);
4590 { throw INTERP_KERNEL::Exception(msg); }
4594 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4596 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.";
4597 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4600 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4602 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4606 Py_XINCREF(trueSelf);
4610 throw INTERP_KERNEL::Exception(msg);
4615 DataArrayDoubleTuple *aa;
4616 std::vector<double> bb;
4618 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4623 if(!self->getArray())
4624 throw INTERP_KERNEL::Exception(msg2);
4625 self->getArray()->applyLin(1.,-val);
4626 Py_XINCREF(trueSelf);
4631 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4634 Py_XINCREF(trueSelf);
4639 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4640 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4641 ret2->setArray(aaa);
4643 Py_XINCREF(trueSelf);
4648 if(!self->getArray())
4649 throw INTERP_KERNEL::Exception(msg2);
4650 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4651 self->getArray()->substractEqual(aaa);
4652 Py_XINCREF(trueSelf);
4656 { throw INTERP_KERNEL::Exception(msg); }
4660 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4662 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.";
4663 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4666 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4668 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4672 Py_XINCREF(trueSelf);
4676 throw INTERP_KERNEL::Exception(msg);
4681 DataArrayDoubleTuple *aa;
4682 std::vector<double> bb;
4684 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4689 if(!self->getArray())
4690 throw INTERP_KERNEL::Exception(msg2);
4691 self->getArray()->applyLin(val,0);
4692 Py_XINCREF(trueSelf);
4697 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4700 Py_XINCREF(trueSelf);
4705 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4706 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4707 ret2->setArray(aaa);
4709 Py_XINCREF(trueSelf);
4714 if(!self->getArray())
4715 throw INTERP_KERNEL::Exception(msg2);
4716 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4717 self->getArray()->multiplyEqual(aaa);
4718 Py_XINCREF(trueSelf);
4722 { throw INTERP_KERNEL::Exception(msg); }
4726 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4728 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.";
4729 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4732 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4734 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4738 Py_XINCREF(trueSelf);
4742 throw INTERP_KERNEL::Exception(msg);
4747 DataArrayDoubleTuple *aa;
4748 std::vector<double> bb;
4750 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4756 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4757 if(!self->getArray())
4758 throw INTERP_KERNEL::Exception(msg2);
4759 self->getArray()->applyLin(1./val,0);
4760 Py_XINCREF(trueSelf);
4765 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4768 Py_XINCREF(trueSelf);
4773 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4774 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4775 ret2->setArray(aaa);
4777 Py_XINCREF(trueSelf);
4782 if(!self->getArray())
4783 throw INTERP_KERNEL::Exception(msg2);
4784 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4785 self->getArray()->divideEqual(aaa);
4786 Py_XINCREF(trueSelf);
4790 { throw INTERP_KERNEL::Exception(msg); }
4794 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4796 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.";
4797 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4800 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4802 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4806 Py_XINCREF(trueSelf);
4810 throw INTERP_KERNEL::Exception(msg);
4815 DataArrayDoubleTuple *aa;
4816 std::vector<double> bb;
4818 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4823 if(!self->getArray())
4824 throw INTERP_KERNEL::Exception(msg2);
4825 self->getArray()->applyPow(val);
4826 Py_XINCREF(trueSelf);
4831 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4834 Py_XINCREF(trueSelf);
4839 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4840 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4841 ret2->setArray(aaa);
4843 Py_XINCREF(trueSelf);
4848 if(!self->getArray())
4849 throw INTERP_KERNEL::Exception(msg2);
4850 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4851 self->getArray()->powEqual(aaa);
4852 Py_XINCREF(trueSelf);
4856 { throw INTERP_KERNEL::Exception(msg); }
4860 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4862 std::vector<const MEDCouplingFieldDouble *> tmp;
4863 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4864 return MEDCouplingFieldDouble::MergeFields(tmp);
4867 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4869 std::vector<const MEDCouplingFieldDouble *> tmp;
4870 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4871 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4874 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4876 std::vector<double> a0;
4877 std::vector<int> a1;
4878 std::vector<std::string> a2;
4879 self->getTinySerializationDbleInformation(a0);
4880 self->getTinySerializationIntInformation(a1);
4881 self->getTinySerializationStrInformation(a2);
4883 PyObject *ret(PyTuple_New(3));
4884 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4885 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
4887 PyObject *ret2(PyList_New(sz));
4889 for(int i=0;i<sz;i++)
4890 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
4892 PyTuple_SetItem(ret,2,ret2);
4896 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
4898 DataArrayInt *ret0(0);
4899 std::vector<DataArrayDouble *> ret1;
4900 self->serialize(ret0,ret1);
4903 std::size_t sz(ret1.size());
4904 PyObject *ret(PyTuple_New(2));
4905 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4906 PyObject *ret1Py(PyList_New(sz));
4907 for(std::size_t i=0;i<sz;i++)
4911 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4913 PyTuple_SetItem(ret,1,ret1Py);
4917 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
4919 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
4920 if(!PyTuple_Check(args))
4921 throw INTERP_KERNEL::Exception(MSG);
4922 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
4923 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
4924 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
4926 PyObject *tmp0(PyTuple_New(1));
4927 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
4928 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
4930 Py_DECREF(selfMeth);
4931 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
4932 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
4933 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
4935 PyObject *a(PyInt_FromLong(0));
4936 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
4939 throw INTERP_KERNEL::Exception(MSG);
4940 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
4941 throw INTERP_KERNEL::Exception(MSG);
4942 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
4945 Py_DECREF(initMeth);
4950 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
4951 {// put an empty dict in input to say to __new__ to call __init__...
4952 self->checkConsistencyLight();
4953 PyObject *ret(PyTuple_New(1));
4954 PyObject *ret0(PyDict_New());
4956 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
4957 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
4958 PyDict_SetItem(ret0,a,d);
4959 Py_DECREF(a); Py_DECREF(d);
4961 PyTuple_SetItem(ret,0,ret0);
4965 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
4967 self->checkConsistencyLight();
4968 PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
4969 PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
4970 const MEDCouplingMesh *mesh(self->getMesh());
4973 PyObject *ret(PyTuple_New(3));
4974 PyTuple_SetItem(ret,0,ret0);
4975 PyTuple_SetItem(ret,1,ret1);
4976 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
4980 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
4982 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
4983 if(!PyTuple_Check(inp))
4984 throw INTERP_KERNEL::Exception(MSG);
4985 int sz(PyTuple_Size(inp));
4987 throw INTERP_KERNEL::Exception(MSG);
4989 PyObject *elt2(PyTuple_GetItem(inp,2));
4991 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
4992 if(!SWIG_IsOK(status))
4993 throw INTERP_KERNEL::Exception(MSG);
4994 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
4996 PyObject *elt0(PyTuple_GetItem(inp,0));
4997 PyObject *elt1(PyTuple_GetItem(inp,1));
4998 std::vector<double> a0;
4999 std::vector<int> a1;
5000 std::vector<std::string> a2;
5001 DataArrayInt *b0(0);
5002 std::vector<DataArrayDouble *>b1;
5004 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5005 throw INTERP_KERNEL::Exception(MSG);
5006 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5008 fillArrayWithPyListDbl3(a0py,tmp,a0);
5009 convertPyToNewIntArr3(a1py,a1);
5010 fillStringVector(a2py,a2);
5013 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5014 throw INTERP_KERNEL::Exception(MSG);
5015 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5017 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5018 if(!SWIG_IsOK(status))
5019 throw INTERP_KERNEL::Exception(MSG);
5020 b0=reinterpret_cast<DataArrayInt *>(argp);
5021 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5023 self->checkForUnserialization(a1,b0,b1);
5024 // useless here to call resizeForUnserialization because arrays are well resized.
5025 self->finishUnserialization(a1,a0,a2);
5030 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5033 int getNumberOfFields() const;
5034 MEDCouplingMultiFields *deepCopy() const;
5035 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5036 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5037 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5038 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5039 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5042 std::string __str__() const throw(INTERP_KERNEL::Exception)
5044 return self->simpleRepr();
5046 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5048 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5049 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5051 std::vector<MEDCouplingFieldDouble *> fs(sz);
5052 for(int i=0;i<sz;i++)
5053 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5054 return MEDCouplingMultiFields::New(fs);
5056 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5058 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5059 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5061 std::vector<MEDCouplingFieldDouble *> fs(sz);
5062 for(int i=0;i<sz;i++)
5063 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5064 return MEDCouplingMultiFields::New(fs);
5066 PyObject *getFields() const
5068 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5069 int sz=fields.size();
5070 PyObject *res = PyList_New(sz);
5071 for(int i=0;i<sz;i++)
5075 fields[i]->incrRef();
5076 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5080 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5085 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5087 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5091 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5094 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5096 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5098 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5100 PyObject *res = PyList_New(sz);
5101 for(int i=0;i<sz;i++)
5106 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5110 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5115 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5117 std::vector<int> refs;
5118 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5120 PyObject *res = PyList_New(sz);
5121 for(int i=0;i<sz;i++)
5126 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5130 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5134 PyObject *ret=PyTuple_New(2);
5135 PyTuple_SetItem(ret,0,res);
5136 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5139 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5141 std::vector<DataArrayDouble *> ms=self->getArrays();
5143 PyObject *res = PyList_New(sz);
5144 for(int i=0;i<sz;i++)
5149 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5153 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5158 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5160 std::vector< std::vector<int> > refs;
5161 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5163 PyObject *res = PyList_New(sz);
5164 PyObject *res2 = PyList_New(sz);
5165 for(int i=0;i<sz;i++)
5170 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5174 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5176 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5179 PyObject *ret=PyTuple_New(2);
5180 PyTuple_SetItem(ret,0,res);
5181 PyTuple_SetItem(ret,1,res2);
5187 class MEDCouplingFieldInt : public MEDCouplingField
5190 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5191 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5192 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5193 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5194 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5195 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5196 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5197 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5198 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5199 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5201 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5203 return MEDCouplingFieldInt::New(type,td);
5206 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5208 return MEDCouplingFieldInt::New(ft,td);
5211 std::string __str__() const throw(INTERP_KERNEL::Exception)
5213 return self->simpleRepr();
5216 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5218 std::ostringstream oss;
5219 self->reprQuickOverview(oss);
5223 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5225 DataArrayInt *ret=self->getArray();
5231 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5234 double tmp0=self->getTime(tmp1,tmp2);
5235 PyObject *res = PyList_New(3);
5236 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5237 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5238 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5244 class MEDCouplingDefinitionTime
5247 MEDCouplingDefinitionTime();
5248 void assign(const MEDCouplingDefinitionTime& other);
5249 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5250 double getTimeResolution() const;
5251 std::vector<double> getHotSpotsTime() const;
5254 std::string __str__() const throw(INTERP_KERNEL::Exception)
5256 std::ostringstream oss;
5257 self->appendRepr(oss);
5261 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5263 int meshId,arrId,arrIdInField,fieldId;
5264 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5265 PyObject *res=PyList_New(4);
5266 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5267 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5268 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5269 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5273 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5275 int meshId,arrId,arrIdInField,fieldId;
5276 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5277 PyObject *res=PyList_New(4);
5278 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5279 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5280 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5281 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5287 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5290 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5291 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5295 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5297 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5298 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5300 std::vector<MEDCouplingFieldDouble *> fs(sz);
5301 for(int i=0;i<sz;i++)
5302 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5303 return MEDCouplingFieldOverTime::New(fs);
5305 std::string __str__() const throw(INTERP_KERNEL::Exception)
5307 return self->simpleRepr();
5309 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5311 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5312 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5314 std::vector<MEDCouplingFieldDouble *> fs(sz);
5315 for(int i=0;i<sz;i++)
5316 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5317 return MEDCouplingFieldOverTime::New(fs);
5322 class MEDCouplingCartesianAMRMesh;
5324 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5327 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5328 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5329 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5332 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5334 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5342 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5345 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5346 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5347 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5350 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5352 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5353 return convertFromVectorPairInt(ret);
5356 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5358 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5359 return convertFromVectorPairInt(ret);
5362 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5364 std::vector< std::pair<int,int> > inp;
5365 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5366 self->addPatch(inp,factors);
5369 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5371 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5373 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5374 if(patchId==mesh->getNumberOfPatches())
5376 std::ostringstream oss;
5377 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5378 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5381 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5387 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5389 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5391 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5392 mesh->removePatch(patchId);
5395 int __len__() const throw(INTERP_KERNEL::Exception)
5397 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5399 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5400 return mesh->getNumberOfPatches();
5405 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5409 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5412 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5413 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5414 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5415 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5416 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5417 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5418 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5419 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5420 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5421 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5422 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5423 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5424 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5426 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5427 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5428 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5429 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5430 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5431 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5432 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5433 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5434 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5435 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5436 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5437 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5438 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5439 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5440 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5441 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5442 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5443 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5444 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5445 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5448 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5450 std::vector< std::pair<int,int> > inp;
5451 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5452 self->addPatch(inp,factors);
5455 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5457 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5459 PyObject *ret = PyList_New(sz);
5460 for(int i=0;i<sz;i++)
5462 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5465 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5470 // agy : don't know why typemap fails here ??? let it in the extend section
5471 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5473 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5476 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5478 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5479 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5485 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5487 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5488 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5494 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5496 std::vector<int> out1;
5497 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5498 PyObject *ret(PyTuple_New(2));
5499 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5500 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5504 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5506 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5508 PyObject *ret = PyList_New(sz);
5509 for(int i=0;i<sz;i++)
5510 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5514 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5516 std::vector<const DataArrayDouble *> inp;
5517 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5518 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5521 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5523 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5529 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5531 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5537 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5539 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5545 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5547 const MEDCouplingIMesh *ret(self->getImageMesh());
5550 return const_cast<MEDCouplingIMesh *>(ret);
5553 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5555 if(patchId==self->getNumberOfPatches())
5557 std::ostringstream oss;
5558 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5559 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5562 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5568 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5570 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5571 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5572 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5575 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5577 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5578 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5579 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5582 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5584 self->removePatch(patchId);
5587 int __len__() const throw(INTERP_KERNEL::Exception)
5589 return self->getNumberOfPatches();
5594 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5598 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5601 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5604 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5606 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5607 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5608 const int *nodeStrctPtr(0);
5609 const double *originPtr(0),*dxyzPtr(0);
5611 std::vector<int> bb0;
5612 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5615 std::vector<double> bb,bb2;
5617 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5618 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5620 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5623 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5625 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5626 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5627 std::vector< std::vector<int> > inp2;
5628 convertPyToVectorOfVectorOfInt(factors,inp2);
5629 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5632 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5634 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5637 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5639 return MEDCouplingCartesianAMRMesh::New(mesh);
5644 class MEDCouplingDataForGodFather : public RefCountObject
5647 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5648 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5649 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5650 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5651 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5652 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5653 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5654 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5655 virtual void alloc() throw(INTERP_KERNEL::Exception);
5656 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5659 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5661 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5669 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5672 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5673 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5674 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5675 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5676 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5677 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5678 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5679 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5680 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5683 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5685 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5686 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5687 MEDCouplingAMRAttribute *ret(0);
5690 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5691 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5693 catch(INTERP_KERNEL::Exception&)
5695 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5696 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5701 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5703 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5706 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5708 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5709 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5715 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5717 std::vector< std::vector<std::string> > compNamesCpp;
5718 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5719 self->spillInfoOnComponents(compNamesCpp);
5722 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5724 std::vector<int> inp0;
5725 if(!fillIntVector(nfs,inp0))
5726 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5727 std::size_t sz(inp0.size());
5728 std::vector<NatureOfField> inp00(sz);
5729 for(std::size_t i=0;i<sz;i++)
5730 inp00[i]=(NatureOfField)inp0[i];
5731 self->spillNatures(inp00);
5734 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5736 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5737 int sz((int)ret.size());
5738 PyObject *retPy(PyList_New(sz));
5739 for(int i=0;i<sz;i++)
5740 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5746 class DenseMatrix : public RefCountObject, public TimeLabel
5749 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5750 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5751 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5752 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5754 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5755 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5756 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5757 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5758 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5759 void transpose() throw(INTERP_KERNEL::Exception);
5761 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5762 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5763 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5766 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5768 return DenseMatrix::New(nbRows,nbCols);
5771 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5773 return DenseMatrix::New(array,nbRows,nbCols);
5776 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5779 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5780 PyObject *ret=PyTuple_New(2);
5781 PyObject *ret0Py=ret0?Py_True:Py_False;
5783 PyTuple_SetItem(ret,0,ret0Py);
5784 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5788 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5790 DataArrayDouble *ret(self->getData());
5796 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5798 return MEDCoupling::DenseMatrix::Add(self,other);
5801 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5803 return MEDCoupling::DenseMatrix::Substract(self,other);
5806 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5808 return MEDCoupling::DenseMatrix::Multiply(self,other);
5811 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5813 return MEDCoupling::DenseMatrix::Multiply(self,other);
5816 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5818 self->addEqual(other);
5819 Py_XINCREF(trueSelf);
5823 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5825 self->substractEqual(other);
5826 Py_XINCREF(trueSelf);
5830 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5832 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5839 class PartDefinition : public RefCountObject, public TimeLabel
5842 static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5843 static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5844 virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
5845 virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
5846 virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
5847 virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
5848 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5849 virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
5852 virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
5854 return (*self)+other;
5857 virtual PyObject *isEqual(const PartDefinition *other) const throw(INTERP_KERNEL::Exception)
5860 bool ret0(self->isEqual(other,ret1));
5861 PyObject *ret=PyTuple_New(2);
5862 PyObject *ret0Py=ret0?Py_True:Py_False;
5864 PyTuple_SetItem(ret,0,ret0Py);
5865 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5869 virtual PyObject *deepCopy() const throw(INTERP_KERNEL::Exception)
5871 return convertPartDefinition(self->deepCopy(),SWIG_POINTER_OWN | 0);
5875 virtual ~PartDefinition();
5878 class DataArrayPartDefinition : public PartDefinition
5881 static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5884 DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
5886 return DataArrayPartDefinition::New(listOfIds);
5889 std::string __str__() const throw(INTERP_KERNEL::Exception)
5891 return self->getRepr();
5894 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5896 std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
5897 oss << self->getRepr();
5902 virtual ~DataArrayPartDefinition();
5905 class SlicePartDefinition : public PartDefinition
5908 static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5909 int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
5912 SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
5914 return SlicePartDefinition::New(start,stop,step);
5917 PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
5920 self->getSlice(a,b,c);
5921 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
5924 std::string __str__() const throw(INTERP_KERNEL::Exception)
5926 return self->getRepr();
5929 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5931 std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
5932 oss << self->getRepr();
5937 virtual ~SlicePartDefinition();
5943 __filename=os.environ.get('PYTHONSTARTUP')
5944 if __filename and os.path.isfile(__filename):
5945 execfile(__filename)