1 // Copyright (C) 2007-2014 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)
27 #include "MEDCouplingMemArray.hxx"
28 #include "MEDCouplingUMesh.hxx"
29 #include "MEDCouplingExtrudedMesh.hxx"
30 #include "MEDCouplingCMesh.hxx"
31 #include "MEDCouplingIMesh.hxx"
32 #include "MEDCouplingCurveLinearMesh.hxx"
33 #include "MEDCoupling1GTUMesh.hxx"
34 #include "MEDCouplingField.hxx"
35 #include "MEDCouplingFieldDouble.hxx"
36 #include "MEDCouplingFieldTemplate.hxx"
37 #include "MEDCouplingGaussLocalization.hxx"
38 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
39 #include "MEDCouplingMultiFields.hxx"
40 #include "MEDCouplingFieldOverTime.hxx"
41 #include "MEDCouplingDefinitionTime.hxx"
42 #include "MEDCouplingFieldDiscretization.hxx"
43 #include "MEDCouplingCartesianAMRMesh.hxx"
44 #include "MEDCouplingAMRAttribute.hxx"
45 #include "MEDCouplingMatrix.hxx"
46 #include "MEDCouplingPartDefinition.hxx"
47 #include "MEDCouplingTypemaps.i"
49 #include "InterpKernelAutoPtr.hxx"
50 #include "BoxSplittingOptions.hxx"
52 using namespace ParaMEDMEM;
53 using namespace INTERP_KERNEL;
57 %template(ivec) std::vector<int>;
58 %template(dvec) std::vector<double>;
59 %template(svec) std::vector<std::string>;
62 %typemap(out) ParaMEDMEM::MEDCouplingMesh*
64 $result=convertMesh($1,$owner);
67 %typemap(out) MEDCouplingMesh*
69 $result=convertMesh($1,$owner);
74 %typemap(out) ParaMEDMEM::MEDCouplingPointSet*
76 $result=convertMesh($1,$owner);
79 %typemap(out) MEDCouplingPointSet*
81 $result=convertMesh($1,$owner);
86 %typemap(out) MEDCouplingCartesianAMRPatchGen*
88 $result=convertCartesianAMRPatch($1,$owner);
93 %typemap(out) MEDCouplingCartesianAMRMeshGen*
95 $result=convertCartesianAMRMesh($1,$owner);
100 %typemap(out) MEDCouplingDataForGodFather*
102 $result=convertDataForGodFather($1,$owner);
107 %typemap(out) ParaMEDMEM::MEDCoupling1GTUMesh*
109 $result=convertMesh($1,$owner);
112 %typemap(out) MEDCoupling1GTUMesh*
114 $result=convertMesh($1,$owner);
119 %typemap(out) ParaMEDMEM::MEDCouplingStructuredMesh*
121 $result=convertMesh($1,$owner);
124 %typemap(out) MEDCouplingStructuredMesh*
126 $result=convertMesh($1,$owner);
131 %typemap(out) ParaMEDMEM::MEDCouplingFieldDiscretization*
133 $result=convertFieldDiscretization($1,$owner);
136 %typemap(out) MEDCouplingFieldDiscretization*
138 $result=convertFieldDiscretization($1,$owner);
143 %typemap(out) ParaMEDMEM::MEDCouplingMultiFields*
145 $result=convertMultiFields($1,$owner);
148 %typemap(out) MEDCouplingMultiFields*
150 $result=convertMultiFields($1,$owner);
155 %typemap(out) ParaMEDMEM::PartDefinition*
157 $result=convertPartDefinition($1,$owner);
160 %typemap(out) PartDefinition*
162 $result=convertPartDefinition($1,$owner);
167 %init %{ import_array(); %}
170 %feature("autodoc", "1");
171 %feature("docstring");
173 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
174 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
175 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
176 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
177 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
178 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
179 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
180 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
181 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
182 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
183 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
184 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
185 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
186 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
187 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
188 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
189 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
190 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
191 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
192 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
193 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
194 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
195 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
196 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
197 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
198 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
199 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
200 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
201 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
202 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
203 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
204 %newobject ParaMEDMEM::MEDCouplingFieldDouble::negate;
205 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
206 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
207 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPartRange;
208 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
209 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__neg__;
210 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__add__;
211 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__sub__;
212 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__mul__;
213 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__div__;
214 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__pow__;
215 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__radd__;
216 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rsub__;
217 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rmul__;
218 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rdiv__;
219 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
220 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
221 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
222 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
223 %newobject ParaMEDMEM::MEDCouplingFieldDouble::nodeToCellDiscretization;
224 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cellToNodeDiscretization;
225 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
226 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
227 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
228 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
229 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
230 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
231 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfFacesPerCell;
232 %newobject ParaMEDMEM::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
233 %newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
234 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
235 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
236 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
237 %newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
238 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
239 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
240 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
241 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
242 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
243 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
244 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
245 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
246 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
247 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
248 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
249 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
250 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
251 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
252 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
253 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
254 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
255 %newobject ParaMEDMEM::MEDCouplingPointSet::zipConnectivityTraducer;
256 %newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
257 %newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
258 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
259 %newobject ParaMEDMEM::MEDCouplingPointSet::deepCpyConnectivityOnly;
260 %newobject ParaMEDMEM::MEDCouplingPointSet::getBoundingBoxForBBTree;
261 %newobject ParaMEDMEM::MEDCouplingPointSet::computeFetchedNodeIds;
262 %newobject ParaMEDMEM::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
263 %newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
264 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
265 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
266 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
267 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
268 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
269 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
270 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
271 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
272 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
273 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
274 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
275 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
276 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
277 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
278 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
279 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
280 %newobject ParaMEDMEM::MEDCouplingUMesh::conformize2D;
281 %newobject ParaMEDMEM::MEDCouplingUMesh::colinearize2D;
282 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
283 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
284 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
285 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
286 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
287 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
288 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
289 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
290 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
291 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
292 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
293 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
294 %newobject ParaMEDMEM::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
295 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
296 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
297 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
298 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
299 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
300 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
301 %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
302 %newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
303 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
304 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
305 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
306 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
307 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
308 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
309 %newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf2DMesh;
310 %newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf3DMesh;
311 %newobject ParaMEDMEM::MEDCouplingUMesh::orderConsecutiveCells1D;
312 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
313 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
314 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
315 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
316 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
317 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
318 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::getNodalConnectivity;
319 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
320 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::New;
321 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
322 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::computeDualMesh;
323 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
324 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::sortHexa8EachOther;
325 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
326 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
327 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::New;
328 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
329 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
330 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
331 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
332 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
333 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
334 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::buildStructuredSubPart;
335 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTUnstructured;
336 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
337 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
338 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
339 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
340 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
341 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::ComputeCornersGhost;
342 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
343 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
344 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
345 %newobject ParaMEDMEM::MEDCouplingIMesh::New;
346 %newobject ParaMEDMEM::MEDCouplingIMesh::asSingleCell;
347 %newobject ParaMEDMEM::MEDCouplingIMesh::buildWithGhost;
348 %newobject ParaMEDMEM::MEDCouplingIMesh::convertToCartesian;
349 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
350 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
351 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
352 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
353 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
354 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
355 %newobject ParaMEDMEM::MEDCouplingCartesianAMRPatchGen::getMesh;
356 %newobject ParaMEDMEM::MEDCouplingCartesianAMRPatchGen::__getitem__;
357 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::deepCpy;
358 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
359 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
360 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
361 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
362 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getImageMesh;
363 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getGodFather;
364 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getFather;
365 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getPatch;
366 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
367 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
368 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
369 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
370 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::__getitem__;
371 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::New;
372 %newobject ParaMEDMEM::MEDCouplingDataForGodFather::getMyGodFather;
373 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::New;
374 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::deepCpy;
375 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
376 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::getFieldOn;
377 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::projectTo;
378 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
379 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
380 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
381 %newobject ParaMEDMEM::DenseMatrix::New;
382 %newobject ParaMEDMEM::DenseMatrix::deepCpy;
383 %newobject ParaMEDMEM::DenseMatrix::shallowCpy;
384 %newobject ParaMEDMEM::DenseMatrix::getData;
385 %newobject ParaMEDMEM::DenseMatrix::matVecMult;
386 %newobject ParaMEDMEM::DenseMatrix::MatVecMult;
387 %newobject ParaMEDMEM::DenseMatrix::__add__;
388 %newobject ParaMEDMEM::DenseMatrix::__sub__;
389 %newobject ParaMEDMEM::DenseMatrix::__mul__;
390 %newobject ParaMEDMEM::PartDefinition::New;
391 %newobject ParaMEDMEM::PartDefinition::toDAI;
392 %newobject ParaMEDMEM::PartDefinition::__add__;
393 %newobject ParaMEDMEM::PartDefinition::composeWith;
394 %newobject ParaMEDMEM::PartDefinition::tryToSimplify;
395 %newobject ParaMEDMEM::DataArrayPartDefinition::New;
396 %newobject ParaMEDMEM::SlicePartDefinition::New;
398 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
399 %feature("unref") MEDCouplingMesh "$this->decrRef();"
400 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
401 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
402 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
403 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
404 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
405 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
406 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
407 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
408 %feature("unref") MEDCouplingField "$this->decrRef();"
409 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
410 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
411 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
412 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
413 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
414 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
415 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
416 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
417 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
418 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
419 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
420 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
421 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
422 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
423 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
424 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
425 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
426 %feature("unref") DenseMatrix "$this->decrRef();"
427 %feature("unref") PartDefinition "$this->decrRef();"
428 %feature("unref") DataArrayPartDefinition "$this->decrRef();"
429 %feature("unref") SlicePartDefinition "$this->decrRef();"
431 %rename(assign) *::operator=;
432 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
433 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
434 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
435 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
439 %rename (InterpKernelException) INTERP_KERNEL::Exception;
441 %include "MEDCouplingRefCountObject.i"
442 %include "MEDCouplingMemArray.i"
444 namespace INTERP_KERNEL
447 * \class BoxSplittingOptions
448 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
450 class BoxSplittingOptions
453 BoxSplittingOptions();
454 void init() throw(INTERP_KERNEL::Exception);
455 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
456 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
457 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
458 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
459 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
460 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
461 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
462 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
463 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
464 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
465 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
466 std::string printOptions() const throw(INTERP_KERNEL::Exception);
469 std::string __str__() const throw(INTERP_KERNEL::Exception)
471 return self->printOptions();
493 CONST_ON_TIME_INTERVAL = 7
494 } TypeOfTimeDiscretization;
502 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
503 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
505 } MEDCouplingMeshType;
508 class DataArrayDouble;
509 class MEDCouplingUMesh;
510 class MEDCouplingFieldDouble;
512 %extend RefCountObject
514 std::string getHiddenCppPointer() const
516 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
521 %extend MEDCouplingGaussLocalization
523 std::string __str__() const throw(INTERP_KERNEL::Exception)
525 return self->getStringRepr();
528 std::string __repr__() const throw(INTERP_KERNEL::Exception)
530 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
531 oss << self->getStringRepr();
538 class MEDCouplingMesh : public RefCountObject, public TimeLabel
541 void setName(const std::string& name);
542 std::string getName() const;
543 void setDescription(const std::string& descr);
544 std::string getDescription() const;
545 void setTime(double val, int iteration, int order);
546 void setTimeUnit(const std::string& unit);
547 std::string getTimeUnit() const;
548 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
549 bool isStructured() const throw(INTERP_KERNEL::Exception);
550 virtual MEDCouplingMesh *deepCpy() const;
551 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
552 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
553 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
554 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
555 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
556 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
557 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
558 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
559 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
560 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
561 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
562 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
563 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
564 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
565 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
566 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
567 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
568 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
569 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
570 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
571 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
572 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
573 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
574 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
575 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
576 virtual std::string getVTKFileExtension() const;
577 std::string getVTKFileNameOf(const std::string& fileName) const;
579 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
580 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
581 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
582 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
583 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
584 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
585 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
586 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
587 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
588 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
589 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
590 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
591 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
592 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
593 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
594 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
595 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
598 std::string __str__() const throw(INTERP_KERNEL::Exception)
600 return self->simpleRepr();
603 PyObject *getTime() throw(INTERP_KERNEL::Exception)
606 double tmp0=self->getTime(tmp1,tmp2);
607 PyObject *res = PyList_New(3);
608 PyList_SetItem(res,0,SWIG_From_double(tmp0));
609 PyList_SetItem(res,1,SWIG_From_int(tmp1));
610 PyList_SetItem(res,2,SWIG_From_int(tmp2));
614 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
618 DataArrayDoubleTuple *aa;
619 std::vector<double> bb;
621 int spaceDim=self->getSpaceDimension();
622 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
623 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
624 return self->getCellContainingPoint(pos,eps);
627 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
631 DataArrayDoubleTuple *aa;
632 std::vector<double> bb;
634 int spaceDim=self->getSpaceDimension();
635 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
636 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
637 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
638 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
639 PyObject *ret=PyTuple_New(2);
640 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
641 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
645 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
647 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
648 int spaceDim=self->getSpaceDimension();
650 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
651 if (!SWIG_IsOK(res1))
654 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
655 int nbOfPoints=size/spaceDim;
658 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
660 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
664 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
666 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
667 da2->checkAllocated();
668 int size=da2->getNumberOfTuples();
669 int nbOfCompo=da2->getNumberOfComponents();
670 if(nbOfCompo!=spaceDim)
672 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
674 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
676 PyObject *ret=PyTuple_New(2);
677 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
678 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
682 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
686 DataArrayDoubleTuple *aa;
687 std::vector<double> bb;
689 int spaceDim=self->getSpaceDimension();
690 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
691 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
692 std::vector<int> elts;
693 self->getCellsContainingPoint(pos,eps,elts);
694 DataArrayInt *ret=DataArrayInt::New();
695 ret->alloc((int)elts.size(),1);
696 std::copy(elts.begin(),elts.end(),ret->getPointer());
697 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
700 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
702 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
703 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
704 self->getReverseNodalConnectivity(d0,d1);
705 PyObject *ret=PyTuple_New(2);
706 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
707 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
711 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
714 int v0; std::vector<int> v1;
715 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
716 self->renumberCells(ids,check);
719 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
721 DataArrayInt *cellCor, *nodeCor;
722 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
723 PyObject *res = PyList_New(2);
724 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
725 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
729 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
731 DataArrayInt *cellCor=0,*nodeCor=0;
732 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
733 PyObject *res = PyList_New(2);
734 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
735 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
739 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
741 DataArrayInt *cellCor=0;
742 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
746 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
749 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
750 if (!SWIG_IsOK(res1))
753 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
754 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
758 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
760 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
761 da2->checkAllocated();
762 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
765 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
767 std::vector<int> conn;
768 self->getNodeIdsOfCell(cellId,conn);
769 return convertIntArrToPyList2(conn);
772 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
774 std::vector<double> coo;
775 self->getCoordinatesOfNode(nodeId,coo);
776 return convertDblArrToPyList2(coo);
779 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
783 DataArrayDoubleTuple *aa;
784 std::vector<double> bb;
786 int spaceDim=self->getSpaceDimension();
787 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
788 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
789 self->scale(pointPtr,factor);
792 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
794 int spaceDim=self->getSpaceDimension();
795 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
796 self->getBoundingBox(tmp);
797 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
801 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
804 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
805 PyObject *ret=PyTuple_New(2);
806 PyObject *ret0Py=ret0?Py_True:Py_False;
808 PyTuple_SetItem(ret,0,ret0Py);
809 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
813 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
815 int szArr,sw,iTypppArr;
816 std::vector<int> stdvecTyyppArr;
817 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
818 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
819 if(sw==3)//DataArrayInt
821 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
822 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
823 std::string name=argpt->getName();
825 ret->setName(name.c_str());
827 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
830 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
832 int szArr,sw,iTypppArr;
833 std::vector<int> stdvecTyyppArr;
835 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
836 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
837 if(sw==3)//DataArrayInt
839 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
840 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
841 std::string name=argpt->getName();
843 ret->setName(name.c_str());
846 PyObject *res = PyList_New(2);
847 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
848 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
849 PyList_SetItem(res,0,obj0);
850 PyList_SetItem(res,1,obj1);
854 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
858 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
859 PyObject *res = PyTuple_New(2);
860 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
863 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
865 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
866 PyTuple_SetItem(res,0,obj0);
867 PyTuple_SetItem(res,1,obj1);
871 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
873 std::vector<int> vals=self->getDistributionOfTypes();
875 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
876 PyObject *ret=PyList_New((int)vals.size()/3);
877 for(int j=0;j<(int)vals.size()/3;j++)
879 PyObject *ret1=PyList_New(3);
880 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
881 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
882 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
883 PyList_SetItem(ret,j,ret1);
888 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
890 std::vector<int> code;
891 std::vector<const DataArrayInt *> idsPerType;
892 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
893 convertPyToNewIntArr4(li,1,3,code);
894 return self->checkTypeConsistencyAndContig(code,idsPerType);
897 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
899 std::vector<int> code;
900 std::vector<DataArrayInt *> idsInPflPerType;
901 std::vector<DataArrayInt *> idsPerType;
902 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
903 PyObject *ret=PyTuple_New(3);
906 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
907 PyObject *ret0=PyList_New((int)code.size()/3);
908 for(int j=0;j<(int)code.size()/3;j++)
910 PyObject *ret00=PyList_New(3);
911 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
912 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
913 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
914 PyList_SetItem(ret0,j,ret00);
916 PyTuple_SetItem(ret,0,ret0);
918 PyObject *ret1=PyList_New(idsInPflPerType.size());
919 for(std::size_t j=0;j<idsInPflPerType.size();j++)
920 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
921 PyTuple_SetItem(ret,1,ret1);
922 int n=idsPerType.size();
923 PyObject *ret2=PyList_New(n);
925 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
926 PyTuple_SetItem(ret,2,ret2);
930 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
934 DataArrayDoubleTuple *aa;
935 std::vector<double> bb;
937 int spaceDim=self->getSpaceDimension();
938 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
939 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
940 self->translate(vectorPtr);
943 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
945 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
948 DataArrayDoubleTuple *aa;
949 std::vector<double> bb;
951 int spaceDim=self->getSpaceDimension();
952 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
953 self->rotate(centerPtr,0,alpha);
956 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
958 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
960 DataArrayDouble *a,*a2;
961 DataArrayDoubleTuple *aa,*aa2;
962 std::vector<double> bb,bb2;
964 int spaceDim=self->getSpaceDimension();
965 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
966 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
967 self->rotate(centerPtr,vectorPtr,alpha);
970 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
972 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
973 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
974 PyObject *res=PyList_New(result.size());
975 for(int i=0;iL!=result.end(); i++, iL++)
976 PyList_SetItem(res,i,PyInt_FromLong(*iL));
980 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
982 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
983 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
984 return MEDCouplingMesh::MergeMeshes(tmp);
990 //== MEDCouplingMesh End
992 %include "NormalizedGeometricTypes"
993 %include "MEDCouplingNatureOfFieldEnum"
997 class MEDCouplingNatureOfField
1000 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1001 static std::string GetReprNoThrow(NatureOfField nat);
1002 static std::string GetAllPossibilitiesStr();
1006 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1007 // include "MEDCouplingTimeDiscretization.i"
1009 namespace ParaMEDMEM
1011 class MEDCouplingGaussLocalization
1014 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1015 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1016 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1017 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1018 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1019 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1020 int getDimension() const throw(INTERP_KERNEL::Exception);
1021 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1022 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1023 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1024 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1026 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1027 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1028 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1029 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1030 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1031 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1032 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1033 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1034 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1035 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1036 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1037 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1039 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1043 %include "MEDCouplingFieldDiscretization.i"
1045 //== MEDCouplingPointSet
1047 namespace ParaMEDMEM
1049 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
1052 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1053 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1054 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1055 void zipCoords() throw(INTERP_KERNEL::Exception);
1056 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1057 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1058 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1059 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1060 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1061 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1062 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1063 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1064 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1065 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1066 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1067 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1068 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1069 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1070 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1071 virtual DataArrayInt *findBoundaryNodes() const;
1072 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1073 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1074 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1075 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1076 virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1077 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1078 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1081 std::string __str__() const throw(INTERP_KERNEL::Exception)
1083 return self->simpleRepr();
1086 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1089 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1090 PyObject *res = PyList_New(2);
1091 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1092 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1096 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1098 DataArrayInt *comm, *commIndex;
1099 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1100 PyObject *res = PyList_New(2);
1101 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1102 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1106 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1108 DataArrayDouble *ret1=self->getCoords();
1111 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1114 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1116 int szArr,sw,iTypppArr;
1117 std::vector<int> stdvecTyyppArr;
1118 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1119 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1120 if(sw==3)//DataArrayInt
1122 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1123 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1124 std::string name=argpt->getName();
1126 ret->setName(name.c_str());
1128 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1131 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1133 int szArr,sw,iTypppArr;
1134 std::vector<int> stdvecTyyppArr;
1135 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1136 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1137 if(sw==3)//DataArrayInt
1139 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1140 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1141 std::string name=argpt->getName();
1143 ret->setName(name.c_str());
1145 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1148 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1150 int szArr,sw,iTypppArr;
1151 std::vector<int> stdvecTyyppArr;
1152 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1153 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1154 if(sw==3)//DataArrayInt
1156 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1157 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1158 std::string name=argpt->getName();
1160 ret->setName(name.c_str());
1162 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1165 virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1167 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1168 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1171 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1173 int szArr,sw,iTypppArr;
1174 std::vector<int> stdvecTyyppArr;
1175 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1176 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1177 if(sw==3)//DataArrayInt
1179 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1180 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1181 std::string name=argpt->getName();
1183 ret->setName(name.c_str());
1185 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1188 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1190 int szArr,sw,iTypppArr;
1191 std::vector<int> stdvecTyyppArr;
1192 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1193 self->renumberNodes(tmp,newNbOfNodes);
1196 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1198 int szArr,sw,iTypppArr;
1199 std::vector<int> stdvecTyyppArr;
1200 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1201 self->renumberNodes2(tmp,newNbOfNodes);
1204 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1206 int spaceDim=self->getSpaceDimension();
1208 DataArrayDouble *a,*a2;
1209 DataArrayDoubleTuple *aa,*aa2;
1210 std::vector<double> bb,bb2;
1212 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1213 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1214 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1215 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1216 std::vector<int> nodes;
1217 self->findNodesOnLine(p,v,eps,nodes);
1218 DataArrayInt *ret=DataArrayInt::New();
1219 ret->alloc((int)nodes.size(),1);
1220 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1221 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1223 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1225 int spaceDim=self->getSpaceDimension();
1227 DataArrayDouble *a,*a2;
1228 DataArrayDoubleTuple *aa,*aa2;
1229 std::vector<double> bb,bb2;
1231 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1232 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1233 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1234 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1235 std::vector<int> nodes;
1236 self->findNodesOnPlane(p,v,eps,nodes);
1237 DataArrayInt *ret=DataArrayInt::New();
1238 ret->alloc((int)nodes.size(),1);
1239 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1240 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1243 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1247 DataArrayDoubleTuple *aa;
1248 std::vector<double> bb;
1250 int spaceDim=self->getSpaceDimension();
1251 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1252 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1253 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1254 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1257 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1259 DataArrayInt *c=0,*cI=0;
1263 DataArrayDoubleTuple *aa;
1264 std::vector<double> bb;
1266 int spaceDim=self->getSpaceDimension();
1267 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1268 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1269 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1270 PyObject *ret=PyTuple_New(2);
1271 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1272 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1276 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1278 DataArrayInt *c=0,*cI=0;
1279 int spaceDim=self->getSpaceDimension();
1282 DataArrayDoubleTuple *aa;
1283 std::vector<double> bb;
1286 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1287 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1289 PyObject *ret=PyTuple_New(2);
1290 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1291 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1295 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1299 DataArrayDoubleTuple *aa;
1300 std::vector<double> bb;
1302 int spaceDim=self->getSpaceDimension();
1303 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1304 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1306 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1307 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1310 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1314 std::vector<int> multiVal;
1315 std::pair<int, std::pair<int,int> > slic;
1316 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1317 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1321 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1323 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1325 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1327 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1331 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1333 DataArrayInt *v0=0,*v1=0;
1334 self->findCommonCells(compType,startCellId,v0,v1);
1335 PyObject *res = PyList_New(2);
1336 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1337 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1342 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1345 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1346 if (!SWIG_IsOK(res1))
1349 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1350 self->renumberNodesInConn(tmp);
1354 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1356 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1357 da2->checkAllocated();
1358 self->renumberNodesInConn(da2->getConstPointer());
1362 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1365 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1366 PyObject *ret=PyTuple_New(2);
1367 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1368 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1372 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1374 DataArrayInt *ret=0;
1376 int szArr,sw,iTypppArr;
1377 std::vector<int> stdvecTyyppArr;
1378 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1379 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1383 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1387 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1388 PyObject *res = PyList_New(3);
1389 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1390 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1391 PyList_SetItem(res,2,SWIG_From_int(ret2));
1395 virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1399 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1400 PyObject *res = PyList_New(3);
1401 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1402 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1403 PyList_SetItem(res,2,SWIG_From_int(ret2));
1407 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1410 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1411 if (!SWIG_IsOK(res1))
1414 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1415 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1419 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1421 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1422 da2->checkAllocated();
1423 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1427 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1431 std::vector<int> multiVal;
1432 std::pair<int, std::pair<int,int> > slic;
1433 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1434 int nbc=self->getNumberOfCells();
1435 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1442 std::ostringstream oss;
1443 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1444 throw INTERP_KERNEL::Exception(oss.str().c_str());
1447 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1452 int tmp=nbc+singleVal;
1453 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1457 std::ostringstream oss;
1458 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1459 throw INTERP_KERNEL::Exception(oss.str().c_str());
1465 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1469 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1474 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1475 daIntTyypp->checkAllocated();
1476 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1479 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1483 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1486 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1487 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1488 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1489 for(int i=0;i<sz;i++)
1490 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1493 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1496 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1498 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1499 std::vector<double> val3;
1500 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1501 "Rotate2DAlg",2,true,nbNodes);
1503 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1504 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1507 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1510 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1511 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1512 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1513 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1514 for(int i=0;i<sz;i++)
1515 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1518 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1521 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1523 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1524 std::vector<double> val3;
1525 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1526 "Rotate3DAlg",3,true,nbNodes);
1528 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1529 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1530 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1535 //== MEDCouplingPointSet End
1537 class MEDCouplingUMeshCell
1540 INTERP_KERNEL::NormalizedCellType getType() const;
1543 std::string __str__() const throw(INTERP_KERNEL::Exception)
1545 return self->repr();
1548 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1551 const int *r=self->getAllConn(ret2);
1552 PyObject *ret=PyTuple_New(ret2);
1553 for(int i=0;i<ret2;i++)
1554 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1560 class MEDCouplingUMeshCellIterator
1567 MEDCouplingUMeshCell *ret=self->nextt();
1569 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1572 PyErr_SetString(PyExc_StopIteration,"No more data.");
1579 class MEDCouplingUMeshCellByTypeIterator
1582 ~MEDCouplingUMeshCellByTypeIterator();
1587 MEDCouplingUMeshCellEntry *ret=self->nextt();
1589 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1592 PyErr_SetString(PyExc_StopIteration,"No more data.");
1599 class MEDCouplingUMeshCellByTypeEntry
1602 ~MEDCouplingUMeshCellByTypeEntry();
1605 MEDCouplingUMeshCellByTypeIterator *__iter__()
1607 return self->iterator();
1612 class MEDCouplingUMeshCellEntry
1615 INTERP_KERNEL::NormalizedCellType getType() const;
1616 int getNumberOfElems() const;
1619 MEDCouplingUMeshCellIterator *__iter__()
1621 return self->iterator();
1626 //== MEDCouplingUMesh
1628 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1631 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1632 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1633 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1634 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1635 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1636 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1637 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1638 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1639 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1640 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1641 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1642 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1643 void computeTypes() throw(INTERP_KERNEL::Exception);
1644 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1645 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1647 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1648 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1649 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1650 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1651 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1652 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1653 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1654 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1655 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1656 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1657 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1658 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1659 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1660 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1661 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1662 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1663 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1664 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1665 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1666 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1667 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1668 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1669 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1670 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1671 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1672 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1673 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1674 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1675 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1676 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1677 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1678 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1679 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1680 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1681 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1682 ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1683 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1684 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1685 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1686 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1687 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1688 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1689 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1690 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1691 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);
1692 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1693 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1694 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1695 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1696 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1698 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1700 return MEDCouplingUMesh::New();
1703 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1705 return MEDCouplingUMesh::New(meshName,meshDim);
1708 std::string __str__() const throw(INTERP_KERNEL::Exception)
1710 return self->simpleRepr();
1713 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1715 std::ostringstream oss;
1716 self->reprQuickOverview(oss);
1720 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1722 return self->cellIterator();
1725 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1727 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1728 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1729 PyObject *res=PyList_New(result.size());
1730 for(int i=0;iL!=result.end(); i++, iL++)
1731 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1735 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1739 std::vector<int> multiVal;
1740 std::pair<int, std::pair<int,int> > slic;
1741 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1742 int nbc=self->getNumberOfCells();
1743 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1750 std::ostringstream oss;
1751 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1752 throw INTERP_KERNEL::Exception(oss.str().c_str());
1756 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1763 int tmp=nbc+singleVal;
1764 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1769 std::ostringstream oss;
1770 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1771 throw INTERP_KERNEL::Exception(oss.str().c_str());
1777 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1783 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1784 daIntTyypp->checkAllocated();
1785 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1789 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1793 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1797 std::vector<int> multiVal;
1798 std::pair<int, std::pair<int,int> > slic;
1799 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1800 int nbc=self->getNumberOfCells();
1801 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1808 std::ostringstream oss;
1809 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1810 throw INTERP_KERNEL::Exception(oss.str().c_str());
1814 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1821 int tmp=nbc+singleVal;
1822 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1827 std::ostringstream oss;
1828 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1829 throw INTERP_KERNEL::Exception(oss.str().c_str());
1835 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1840 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1846 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1847 daIntTyypp->checkAllocated();
1848 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1852 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1856 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1858 int szArr,sw,iTypppArr;
1859 std::vector<int> stdvecTyyppArr;
1860 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1863 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1864 throw INTERP_KERNEL::Exception(oss.str().c_str());
1866 self->insertNextCell(type,size,tmp);
1869 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1871 int szArr,sw,iTypppArr;
1872 std::vector<int> stdvecTyyppArr;
1873 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1874 self->insertNextCell(type,szArr,tmp);
1877 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1879 DataArrayInt *ret=self->getNodalConnectivity();
1884 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1886 DataArrayInt *ret=self->getNodalConnectivityIndex();
1892 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1894 int szArr,sw,iTypppArr;
1895 std::vector<int> stdvecTyyppArr;
1896 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1897 int nbOfDepthPeelingPerformed=0;
1898 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1899 PyObject *res=PyTuple_New(2);
1900 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1901 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1905 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1907 DataArrayInt *v0=0,*v1=0;
1908 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1909 PyObject *res = PyList_New(2);
1910 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1911 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1915 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
1919 DataArrayDoubleTuple *aa;
1920 std::vector<double> bb;
1922 int nbOfCompo=self->getSpaceDimension();
1923 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
1926 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
1927 PyObject *ret=PyTuple_New(2);
1928 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1929 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
1933 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
1935 DataArrayInt *ret1=0;
1936 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
1937 PyObject *ret=PyTuple_New(2);
1938 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1939 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1943 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
1946 DataArrayInt *ret1(0);
1947 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
1948 PyObject *ret=PyTuple_New(3);
1949 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
1950 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1951 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
1955 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
1957 std::vector<int> cells;
1958 self->checkButterflyCells(cells,eps);
1959 DataArrayInt *ret=DataArrayInt::New();
1960 ret->alloc((int)cells.size(),1);
1961 std::copy(cells.begin(),cells.end(),ret->getPointer());
1962 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1965 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
1967 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
1969 PyObject *ret = PyList_New(sz);
1970 for(int i=0;i<sz;i++)
1971 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1975 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
1977 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
1978 int sz=retCpp.size();
1979 PyObject *ret=PyList_New(sz);
1980 for(int i=0;i<sz;i++)
1981 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1985 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
1988 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
1989 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
1990 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
1993 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
1996 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1997 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2001 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2004 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2005 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2009 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2011 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2012 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2013 PyObject *ret=PyTuple_New(3);
2014 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2015 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2016 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2020 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2022 DataArrayInt *tmp0=0,*tmp1=0;
2023 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2024 PyObject *ret=PyTuple_New(2);
2025 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2026 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2030 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2034 std::vector<int> multiVal;
2035 std::pair<int, std::pair<int,int> > slic;
2036 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2037 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2041 return self->duplicateNodes(&singleVal,&singleVal+1);
2043 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2045 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2047 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2051 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2055 std::vector<int> multiVal;
2056 std::pair<int, std::pair<int,int> > slic;
2057 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2058 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2062 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2064 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2066 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2068 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2072 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2075 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2076 DataArrayInt *tmp0,*tmp1=0;
2077 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2078 PyObject *ret=PyTuple_New(2);
2079 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2080 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2084 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2086 DataArrayInt *ret0=0,*ret1=0;
2087 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2088 PyObject *ret=PyTuple_New(2);
2089 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2090 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2094 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2096 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2097 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2098 DataArrayInt *ret1=0,*ret2=0;
2099 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2100 PyObject *ret=PyTuple_New(3);
2101 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2102 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2103 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2107 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2109 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2110 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2111 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2112 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2115 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2118 std::vector<const MEDCouplingUMesh *> meshes;
2119 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2120 std::vector<DataArrayInt *> corr;
2121 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2123 PyObject *ret1=PyList_New(sz);
2124 for(int i=0;i<sz;i++)
2125 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2126 PyObject *ret=PyList_New(2);
2127 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2128 PyList_SetItem(ret,1,ret1);
2132 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2134 std::vector<MEDCouplingUMesh *> meshes;
2135 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2136 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2139 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2141 std::vector<MEDCouplingUMesh *> meshes;
2142 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2143 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2146 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2150 std::vector<int> multiVal;
2151 std::pair<int, std::pair<int,int> > slic;
2152 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2154 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2155 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2159 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2161 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2163 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2165 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2169 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2171 DataArrayInt *arrOut=0,*arrIndexOut=0;
2174 std::vector<int> multiVal;
2175 std::pair<int, std::pair<int,int> > slic;
2176 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2178 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2179 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2184 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2189 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2194 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2198 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2200 PyObject *ret=PyTuple_New(2);
2201 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2202 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2206 static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2208 DataArrayInt *arrOut=0,*arrIndexOut=0;
2209 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2210 PyObject *ret=PyTuple_New(2);
2211 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2212 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2216 static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2218 if(!PySlice_Check(slic))
2219 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2220 Py_ssize_t strt=2,stp=2,step=2;
2221 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2223 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2224 arrIndxIn->checkAllocated();
2225 if(arrIndxIn->getNumberOfComponents()!=1)
2226 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2227 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2228 DataArrayInt *arrOut=0,*arrIndexOut=0;
2229 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2230 PyObject *ret=PyTuple_New(2);
2231 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2232 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2236 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2237 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2238 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2240 DataArrayInt *arrOut=0,*arrIndexOut=0;
2243 std::vector<int> multiVal;
2244 std::pair<int, std::pair<int,int> > slic;
2245 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2247 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2248 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2253 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2258 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2263 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2267 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2269 PyObject *ret=PyTuple_New(2);
2270 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2271 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2275 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2276 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2280 std::vector<int> multiVal;
2281 std::pair<int, std::pair<int,int> > slic;
2282 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2284 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2285 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2290 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2295 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2300 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2304 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2308 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2312 DataArrayDoubleTuple *aa;
2313 std::vector<double> bb;
2315 int spaceDim=self->getSpaceDimension();
2316 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2317 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2319 std::vector<int> cells;
2320 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2321 DataArrayInt *ret=DataArrayInt::New();
2322 ret->alloc((int)cells.size(),1);
2323 std::copy(cells.begin(),cells.end(),ret->getPointer());
2324 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2327 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2331 DataArrayDoubleTuple *aa;
2332 std::vector<double> bb;
2334 int spaceDim=self->getSpaceDimension();
2335 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2336 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2337 self->orientCorrectly2DCells(v,polyOnly);
2340 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2342 std::vector<int> cells;
2343 self->arePolyhedronsNotCorrectlyOriented(cells);
2344 DataArrayInt *ret=DataArrayInt::New();
2345 ret->alloc((int)cells.size(),1);
2346 std::copy(cells.begin(),cells.end(),ret->getPointer());
2347 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2350 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2354 self->getFastAveragePlaneOfThis(vec,pos);
2356 std::copy(vec,vec+3,vals);
2357 std::copy(pos,pos+3,vals+3);
2358 return convertDblArrToPyListOfTuple(vals,3,2);
2361 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2363 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2364 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2365 return MEDCouplingUMesh::MergeUMeshes(tmp);
2368 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2371 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2372 PyObject *ret=PyTuple_New(2);
2373 PyObject *ret0Py=ret0?Py_True:Py_False;
2375 PyTuple_SetItem(ret,0,ret0Py);
2376 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2380 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2383 bool ret0=self->areCellsIncludedIn2(other,ret1);
2384 PyObject *ret=PyTuple_New(2);
2385 PyObject *ret0Py=ret0?Py_True:Py_False;
2387 PyTuple_SetItem(ret,0,ret0Py);
2388 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2392 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2394 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2395 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2396 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2397 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2398 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2399 PyObject *ret=PyTuple_New(5);
2400 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2401 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2402 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2403 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2404 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2408 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2410 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2411 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2412 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2413 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2414 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2415 PyObject *ret=PyTuple_New(5);
2416 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2417 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2418 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2419 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2420 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2424 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2426 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2427 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2428 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2429 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2430 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2431 PyObject *ret=PyTuple_New(5);
2432 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2433 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2434 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2435 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2436 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2440 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2442 DataArrayInt *neighbors=0,*neighborsIdx=0;
2443 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2444 PyObject *ret=PyTuple_New(2);
2445 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2446 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2450 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2452 DataArrayInt *neighbors=0,*neighborsIdx=0;
2453 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2454 PyObject *ret=PyTuple_New(2);
2455 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2456 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2460 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2462 DataArrayInt *neighbors=0,*neighborsIdx=0;
2463 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2464 PyObject *ret=PyTuple_New(2);
2465 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2466 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2470 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2472 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2473 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2474 DataArrayInt *d2,*d3,*d4,*dd5;
2475 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2476 PyObject *ret=PyTuple_New(7);
2477 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2478 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2479 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2480 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2481 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2482 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2483 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2487 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2490 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2491 da->checkAllocated();
2492 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2495 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2498 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2499 da->checkAllocated();
2500 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2503 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2506 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2507 da->checkAllocated();
2508 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2511 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2514 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2515 da->checkAllocated();
2516 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2517 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2518 PyObject *res = PyList_New(result.size());
2519 for (int i=0;iL!=result.end(); i++, iL++)
2520 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2524 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2527 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2528 da->checkAllocated();
2529 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2530 ret->setName(da->getName().c_str());
2534 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2536 DataArrayInt *cellNb1=0,*cellNb2=0;
2537 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2538 PyObject *ret=PyTuple_New(3);
2539 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2540 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2541 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2545 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2547 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2548 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2549 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2550 PyObject *ret(PyTuple_New(4));
2551 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2552 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2553 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2554 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2558 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2560 int spaceDim=self->getSpaceDimension();
2562 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2564 DataArrayDouble *a,*a2;
2565 DataArrayDoubleTuple *aa,*aa2;
2566 std::vector<double> bb,bb2;
2568 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2569 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2570 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2571 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2573 DataArrayInt *cellIds=0;
2574 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2575 PyObject *ret=PyTuple_New(2);
2576 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2577 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2581 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2583 int spaceDim=self->getSpaceDimension();
2585 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2587 DataArrayDouble *a,*a2;
2588 DataArrayDoubleTuple *aa,*aa2;
2589 std::vector<double> bb,bb2;
2591 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2592 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2593 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2594 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2596 DataArrayInt *cellIds=0;
2597 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2598 PyObject *ret=PyTuple_New(2);
2599 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2600 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2604 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2606 int spaceDim=self->getSpaceDimension();
2608 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2610 DataArrayDouble *a,*a2;
2611 DataArrayDoubleTuple *aa,*aa2;
2612 std::vector<double> bb,bb2;
2614 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2615 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2616 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2617 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2618 return self->getCellIdsCrossingPlane(orig,vect,eps);
2621 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2625 std::vector<int> pos2;
2626 DataArrayInt *pos3=0;
2627 DataArrayIntTuple *pos4=0;
2628 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2633 self->convertToPolyTypes(&pos1,&pos1+1);
2640 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2645 self->convertToPolyTypes(pos3->begin(),pos3->end());
2649 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2653 void convertAllToPoly();
2654 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2655 bool unPolyze() throw(INTERP_KERNEL::Exception);
2656 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2657 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2658 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2661 //== MEDCouplingUMesh End
2663 //== MEDCouplingExtrudedMesh
2665 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2668 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2669 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2671 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2673 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2676 std::string __str__() const throw(INTERP_KERNEL::Exception)
2678 return self->simpleRepr();
2681 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2683 std::ostringstream oss;
2684 self->reprQuickOverview(oss);
2688 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2690 MEDCouplingUMesh *ret=self->getMesh2D();
2693 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2695 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2697 MEDCouplingUMesh *ret=self->getMesh1D();
2700 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2702 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2704 DataArrayInt *ret=self->getMesh3DIds();
2707 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2712 //== MEDCouplingExtrudedMesh End
2714 class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2717 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2718 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2719 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2720 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2721 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2722 virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2725 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2727 int szArr,sw,iTypppArr;
2728 std::vector<int> stdvecTyyppArr;
2729 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2730 self->insertNextCell(tmp,tmp+szArr);
2733 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2735 DataArrayInt *ret=self->getNodalConnectivity();
2736 if(ret) ret->incrRef();
2740 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2742 std::vector< const MEDCoupling1GTUMesh *> parts;
2743 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2744 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2749 //== MEDCoupling1SGTUMesh
2751 class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2754 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2755 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2756 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2757 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2758 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2759 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2760 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2761 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
2762 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
2765 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2767 return MEDCoupling1SGTUMesh::New(name,type);
2770 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2772 return MEDCoupling1SGTUMesh::New(m);
2775 std::string __str__() const throw(INTERP_KERNEL::Exception)
2777 return self->simpleRepr();
2780 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2782 std::ostringstream oss;
2783 self->reprQuickOverview(oss);
2787 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
2789 DataArrayInt *cellPerm(0),*nodePerm(0);
2790 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
2791 PyObject *ret(PyTuple_New(3));
2792 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
2793 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2794 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2798 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2800 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2801 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2802 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2805 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2807 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2808 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2809 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2814 //== MEDCoupling1SGTUMesh End
2816 //== MEDCoupling1DGTUMesh
2818 class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2821 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2822 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2823 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2824 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2825 bool isPacked() const throw(INTERP_KERNEL::Exception);
2828 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2830 return MEDCoupling1DGTUMesh::New(name,type);
2833 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2835 return MEDCoupling1DGTUMesh::New(m);
2838 std::string __str__() const throw(INTERP_KERNEL::Exception)
2840 return self->simpleRepr();
2843 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2845 std::ostringstream oss;
2846 self->reprQuickOverview(oss);
2850 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2852 DataArrayInt *ret=self->getNodalConnectivityIndex();
2853 if(ret) ret->incrRef();
2857 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2859 DataArrayInt *ret1=0,*ret2=0;
2860 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2861 PyObject *ret0Py=ret0?Py_True:Py_False;
2863 PyObject *ret=PyTuple_New(3);
2864 PyTuple_SetItem(ret,0,ret0Py);
2865 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2866 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2870 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
2873 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
2874 PyObject *ret=PyTuple_New(2);
2875 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
2876 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
2877 PyTuple_SetItem(ret,1,ret1Py);
2881 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2883 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2884 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2885 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
2888 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2890 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2891 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2892 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
2895 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
2897 std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
2898 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2899 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
2904 //== MEDCoupling1DGTUMeshEnd
2906 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2909 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2910 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2911 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
2912 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
2913 double computeSquareness() const throw(INTERP_KERNEL::Exception);
2914 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2915 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
2916 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
2917 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
2918 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
2919 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
2920 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
2921 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
2924 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
2926 int tmpp1=-1,tmpp2=-1;
2927 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
2928 std::vector< std::pair<int,int> > inp;
2932 for(int i=0;i<tmpp1;i++)
2933 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2938 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
2939 inp.resize(tmpp1/2);
2940 for(int i=0;i<tmpp1/2;i++)
2941 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2944 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
2945 return self->buildStructuredSubPart(inp);
2948 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
2950 std::vector< std::pair<int,int> > inp;
2951 convertPyToVectorPairInt(part,inp);
2953 int szArr,sw,iTypppArr;
2954 std::vector<int> stdvecTyyppArr;
2955 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
2956 std::vector<int> tmp5(tmp4,tmp4+szArr);
2958 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
2961 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
2963 std::vector< std::pair<int,int> > inp;
2964 convertPyToVectorPairInt(part,inp);
2965 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
2968 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
2970 std::vector< std::pair<int,int> > inp;
2971 convertPyToVectorPairInt(part,inp);
2972 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
2975 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
2977 std::vector< std::pair<int,int> > inp;
2978 convertPyToVectorPairInt(part,inp);
2979 std::vector<int> stWithGhost;
2980 std::vector< std::pair<int,int> > partWithGhost;
2981 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
2982 PyObject *ret(PyTuple_New(2));
2983 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
2984 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
2988 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
2990 std::vector< std::pair<int,int> > inp;
2991 convertPyToVectorPairInt(partCompactFormat,inp);
2992 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
2995 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
2997 std::vector< std::pair<int,int> > inp;
2998 convertPyToVectorPairInt(partCompactFormat,inp);
2999 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3002 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3004 std::vector< std::pair<int,int> > inp;
3005 convertPyToVectorPairInt(part,inp);
3006 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3009 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3011 int szArr,sw,iTypppArr;
3012 std::vector<int> stdvecTyyppArr;
3013 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3014 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3017 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3019 int szArr,sw,iTypppArr;
3020 std::vector<int> stdvecTyyppArr;
3021 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3022 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3025 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3027 std::vector< std::pair<int,int> > inp;
3028 convertPyToVectorPairInt(partCompactFormat,inp);
3029 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3032 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3034 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3035 PyObject *retPy=PyList_New(ret.size());
3036 for(std::size_t i=0;i<ret.size();i++)
3038 PyObject *tmp=PyTuple_New(2);
3039 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3040 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3041 PyList_SetItem(retPy,i,tmp);
3046 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3048 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3049 convertPyToVectorPairInt(r1,r1Cpp);
3050 convertPyToVectorPairInt(r2,r2Cpp);
3051 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3052 PyObject *retPy=PyList_New(ret.size());
3053 for(std::size_t i=0;i<ret.size();i++)
3055 PyObject *tmp=PyTuple_New(2);
3056 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3057 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3058 PyList_SetItem(retPy,i,tmp);
3063 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3065 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3066 convertPyToVectorPairInt(r1,r1Cpp);
3067 convertPyToVectorPairInt(r2,r2Cpp);
3068 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3071 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3073 int szArr,sw,iTypppArr;
3074 std::vector<int> stdvecTyyppArr;
3075 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3076 int szArr2,sw2,iTypppArr2;
3077 std::vector<int> stdvecTyyppArr2;
3078 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3079 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3080 std::vector< std::pair<int,int> > partCompactFormat;
3081 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3082 PyObject *ret=PyTuple_New(2);
3083 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3084 PyTuple_SetItem(ret,0,ret0Py);
3085 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3086 for(std::size_t i=0;i<partCompactFormat.size();i++)
3088 PyObject *tmp4=PyTuple_New(2);
3089 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3090 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3091 PyList_SetItem(ret1Py,i,tmp4);
3093 PyTuple_SetItem(ret,1,ret1Py);
3097 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3099 std::vector< std::pair<int,int> > param0,param1,ret;
3100 convertPyToVectorPairInt(bigInAbs,param0);
3101 convertPyToVectorPairInt(partOfBigInAbs,param1);
3102 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3103 PyObject *retPy(PyList_New(ret.size()));
3104 for(std::size_t i=0;i<ret.size();i++)
3106 PyObject *tmp(PyTuple_New(2));
3107 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3108 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3109 PyList_SetItem(retPy,i,tmp);
3114 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3116 std::vector< std::pair<int,int> > param0;
3117 convertPyToVectorPairInt(part,param0);
3118 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3119 PyObject *retPy(PyList_New(ret.size()));
3120 for(std::size_t i=0;i<ret.size();i++)
3122 PyObject *tmp(PyTuple_New(2));
3123 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3124 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3125 PyList_SetItem(retPy,i,tmp);
3130 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3132 std::vector< std::pair<int,int> > param0,param1;
3133 convertPyToVectorPairInt(startingFrom,param0);
3134 convertPyToVectorPairInt(goingTo,param1);
3135 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3138 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3140 std::vector< std::pair<int,int> > param0,param1,ret;
3141 convertPyToVectorPairInt(bigInAbs,param0);
3142 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3143 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3144 PyObject *retPy(PyList_New(ret.size()));
3145 for(std::size_t i=0;i<ret.size();i++)
3147 PyObject *tmp(PyTuple_New(2));
3148 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3149 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3150 PyList_SetItem(retPy,i,tmp);
3157 //== MEDCouplingCMesh
3159 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3162 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3163 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3164 MEDCouplingCMesh *clone(bool recDeepCpy) const;
3165 void setCoords(const DataArrayDouble *coordsX,
3166 const DataArrayDouble *coordsY=0,
3167 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3168 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3170 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3172 return MEDCouplingCMesh::New();
3174 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3176 return MEDCouplingCMesh::New(meshName);
3178 std::string __str__() const throw(INTERP_KERNEL::Exception)
3180 return self->simpleRepr();
3182 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3184 std::ostringstream oss;
3185 self->reprQuickOverview(oss);
3188 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3190 DataArrayDouble *ret=self->getCoordsAt(i);
3198 //== MEDCouplingCMesh End
3200 //== MEDCouplingCurveLinearMesh
3202 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3205 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3206 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3207 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
3208 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3210 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3212 return MEDCouplingCurveLinearMesh::New();
3214 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3216 return MEDCouplingCurveLinearMesh::New(meshName);
3218 std::string __str__() const throw(INTERP_KERNEL::Exception)
3220 return self->simpleRepr();
3222 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3224 std::ostringstream oss;
3225 self->reprQuickOverview(oss);
3228 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3230 DataArrayDouble *ret=self->getCoords();
3235 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3237 int szArr,sw,iTypppArr;
3238 std::vector<int> stdvecTyyppArr;
3239 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3240 self->setNodeGridStructure(tmp,tmp+szArr);
3245 //== MEDCouplingCurveLinearMesh End
3247 //== MEDCouplingIMesh
3249 class MEDCouplingIMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3252 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3254 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3255 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3256 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3257 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3258 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3259 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3260 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3261 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3262 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3263 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3264 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3269 return MEDCouplingIMesh::New();
3271 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3273 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3274 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3275 const int *nodeStrctPtr(0);
3276 const double *originPtr(0),*dxyzPtr(0);
3278 std::vector<int> bb0;
3279 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3282 std::vector<double> bb,bb2;
3284 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3285 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3287 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3290 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3292 return ParaMEDMEM_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3295 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3298 std::vector<int> bb0;
3299 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3300 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3303 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3305 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3308 DataArrayDoubleTuple *aa;
3309 std::vector<double> bb;
3311 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3312 self->setOrigin(originPtr,originPtr+nbTuples);
3315 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3317 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3320 DataArrayDoubleTuple *aa;
3321 std::vector<double> bb;
3323 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3324 self->setDXYZ(originPtr,originPtr+nbTuples);
3327 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3329 std::vector< std::pair<int,int> > inp;
3330 convertPyToVectorPairInt(fineLocInCoarse,inp);
3331 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3334 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)
3336 std::vector< std::pair<int,int> > inp;
3337 convertPyToVectorPairInt(fineLocInCoarse,inp);
3338 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3341 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3343 std::vector< std::pair<int,int> > inp;
3344 convertPyToVectorPairInt(fineLocInCoarse,inp);
3345 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3348 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)
3350 std::vector< std::pair<int,int> > inp;
3351 convertPyToVectorPairInt(fineLocInCoarse,inp);
3352 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3355 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)
3357 std::vector< std::pair<int,int> > inp;
3358 convertPyToVectorPairInt(fineLocInCoarse,inp);
3359 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3362 std::string __str__() const throw(INTERP_KERNEL::Exception)
3364 return self->simpleRepr();
3366 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3368 std::ostringstream oss;
3369 self->reprQuickOverview(oss);
3375 //== MEDCouplingIMesh End
3379 namespace ParaMEDMEM
3381 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3384 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3385 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3386 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3387 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3388 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3389 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3390 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3391 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3392 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3393 std::string getName() const throw(INTERP_KERNEL::Exception);
3394 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3395 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3396 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3397 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3398 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3399 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3400 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3401 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3402 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3403 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3404 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3405 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3406 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3407 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3408 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3409 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3411 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3413 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3416 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3419 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3421 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3424 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3427 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3429 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3430 return convertIntArrToPyList3(ret);
3433 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3436 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3437 PyObject *ret=PyTuple_New(2);
3438 PyObject *ret0Py=ret0?Py_True:Py_False;
3440 PyTuple_SetItem(ret,0,ret0Py);
3441 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3445 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3447 DataArrayInt *ret1=0;
3448 MEDCouplingMesh *ret0=0;
3450 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3451 if (!SWIG_IsOK(res1))
3454 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3455 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3459 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3461 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3462 da2->checkAllocated();
3463 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3465 PyObject *res = PyList_New(2);
3466 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3467 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3471 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3473 DataArrayInt *ret1=0;
3475 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3476 PyObject *res=PyTuple_New(2);
3477 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3479 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3482 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3483 PyTuple_SetItem(res,1,res1);
3488 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3491 int v0; std::vector<int> v1;
3492 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3493 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3496 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3497 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3500 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3501 if (!SWIG_IsOK(res1))
3504 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3505 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3509 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3511 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3512 da2->checkAllocated();
3513 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3517 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3519 std::vector<int> tmp;
3520 self->getCellIdsHavingGaussLocalization(locId,tmp);
3521 DataArrayInt *ret=DataArrayInt::New();
3522 ret->alloc((int)tmp.size(),1);
3523 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3524 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3527 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3529 std::vector<int> inp0;
3530 convertPyToNewIntArr4(code,1,3,inp0);
3531 std::vector<const DataArrayInt *> inp1;
3532 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3533 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3538 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3541 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3542 static MEDCouplingFieldTemplate *New(TypeOfField type);
3543 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3544 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3547 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3549 return MEDCouplingFieldTemplate::New(f);
3552 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3554 return MEDCouplingFieldTemplate::New(type);
3557 std::string __str__() const throw(INTERP_KERNEL::Exception)
3559 return self->simpleRepr();
3562 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3564 std::ostringstream oss;
3565 self->reprQuickOverview(oss);
3571 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3574 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3575 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3576 void setTimeUnit(const std::string& unit);
3577 std::string getTimeUnit() const;
3578 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3579 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3580 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3581 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3582 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3583 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3584 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3585 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3586 MEDCouplingFieldDouble *deepCpy() const;
3587 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3588 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3589 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3590 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3591 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3592 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3593 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3594 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3595 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3596 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3597 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3598 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3599 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3600 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3601 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3602 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3603 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3604 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3605 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3606 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3607 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3608 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3609 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3610 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3611 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3612 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3613 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3614 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3615 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3616 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3617 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3618 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3619 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3620 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3621 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3622 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3623 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3624 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3625 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3626 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3627 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3628 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3629 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3630 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3631 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3632 void fillFromAnalytic2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3633 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3634 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3635 void applyFunc2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3636 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3637 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3638 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3639 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3640 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3641 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3642 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3643 double getMinValue() const throw(INTERP_KERNEL::Exception);
3644 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3645 double norm2() const throw(INTERP_KERNEL::Exception);
3646 double normMax() const throw(INTERP_KERNEL::Exception);
3647 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3648 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3649 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3650 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3651 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3652 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3653 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3654 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3655 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3656 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3657 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3658 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3659 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3660 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3661 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3662 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3663 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3664 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3665 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3666 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3667 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3668 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3670 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3672 return MEDCouplingFieldDouble::New(type,td);
3675 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3677 return MEDCouplingFieldDouble::New(ft,td);
3680 std::string __str__() const throw(INTERP_KERNEL::Exception)
3682 return self->simpleRepr();
3685 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3687 std::ostringstream oss;
3688 self->reprQuickOverview(oss);
3692 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3694 DataArrayDouble *ret=self->getArray();
3700 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3702 std::vector<DataArrayDouble *> arrs=self->getArrays();
3703 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3707 PyObject *ret=PyTuple_New(sz);
3708 for(int i=0;i<sz;i++)
3711 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3713 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3718 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3720 std::vector<const DataArrayDouble *> tmp;
3721 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3723 std::vector<DataArrayDouble *> arrs(sz);
3724 for(int i=0;i<sz;i++)
3725 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3726 self->setArrays(arrs);
3729 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3731 DataArrayDouble *ret=self->getEndArray();
3737 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3741 DataArrayDoubleTuple *aa;
3742 std::vector<double> bb;
3744 const MEDCouplingMesh *mesh=self->getMesh();
3746 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3747 int spaceDim=mesh->getSpaceDimension();
3748 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3749 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3751 int sz=self->getNumberOfComponents();
3752 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3753 self->getValueOn(spaceLoc,res);
3754 return convertDblArrToPyList(res,sz);
3757 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3759 int sz=self->getNumberOfComponents();
3760 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3761 self->getValueOnPos(i,j,k,res);
3762 return convertDblArrToPyList(res,sz);
3765 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3767 const MEDCouplingMesh *mesh(self->getMesh());
3769 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3772 double v0; ParaMEDMEM::DataArrayDouble *v1(0); ParaMEDMEM::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3773 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3774 mesh->getSpaceDimension(),true,nbPts);
3775 return self->getValueOnMulti(inp,nbPts);
3778 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3782 DataArrayDoubleTuple *aa;
3783 std::vector<double> bb;
3785 const MEDCouplingMesh *mesh=self->getMesh();
3787 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3788 int spaceDim=mesh->getSpaceDimension();
3789 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3790 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3793 int sz=self->getNumberOfComponents();
3794 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3795 self->getValueOn(spaceLoc,time,res);
3796 return convertDblArrToPyList(res,sz);
3799 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3801 if(self->getArray()!=0)
3802 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3805 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3806 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3807 self->setArray(arr);
3811 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3814 double tmp0=self->getTime(tmp1,tmp2);
3815 PyObject *res = PyList_New(3);
3816 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3817 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3818 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3822 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3825 double tmp0=self->getStartTime(tmp1,tmp2);
3826 PyObject *res = PyList_New(3);
3827 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3828 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3829 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3833 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3836 double tmp0=self->getEndTime(tmp1,tmp2);
3837 PyObject *res = PyList_New(3);
3838 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3839 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3840 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3843 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3845 int sz=self->getNumberOfComponents();
3846 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3847 self->accumulate(tmp);
3848 return convertDblArrToPyList(tmp,sz);
3850 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3852 int sz=self->getNumberOfComponents();
3853 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3854 self->integral(isWAbs,tmp);
3855 return convertDblArrToPyList(tmp,sz);
3857 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3859 int sz=self->getNumberOfComponents();
3860 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3861 self->getWeightedAverageValue(tmp,isWAbs);
3862 return convertDblArrToPyList(tmp,sz);
3864 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3866 int sz=self->getNumberOfComponents();
3867 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3869 return convertDblArrToPyList(tmp,sz);
3871 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3873 int sz=self->getNumberOfComponents();
3874 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3876 return convertDblArrToPyList(tmp,sz);
3878 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3880 int szArr,sw,iTypppArr;
3881 std::vector<int> stdvecTyyppArr;
3882 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3883 self->renumberCells(tmp,check);
3886 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3888 int szArr,sw,iTypppArr;
3889 std::vector<int> stdvecTyyppArr;
3890 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3891 self->renumberCellsWithoutMesh(tmp,check);
3894 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3896 int szArr,sw,iTypppArr;
3897 std::vector<int> stdvecTyyppArr;
3898 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3899 self->renumberNodes(tmp,eps);
3902 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3904 int szArr,sw,iTypppArr;
3905 std::vector<int> stdvecTyyppArr;
3906 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3907 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
3910 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3914 std::vector<int> multiVal;
3915 std::pair<int, std::pair<int,int> > slic;
3916 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3917 const MEDCouplingMesh *mesh=self->getMesh();
3919 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3920 int nbc=mesh->getNumberOfCells();
3921 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3928 std::ostringstream oss;
3929 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3930 throw INTERP_KERNEL::Exception(oss.str().c_str());
3933 return self->buildSubPart(&singleVal,&singleVal+1);
3938 int tmp=nbc+singleVal;
3939 return self->buildSubPart(&tmp,&tmp+1);
3943 std::ostringstream oss;
3944 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3945 throw INTERP_KERNEL::Exception(oss.str().c_str());
3951 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3955 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3960 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3961 daIntTyypp->checkAllocated();
3962 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3965 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3969 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3971 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";
3972 if(PyTuple_Check(li))
3974 Py_ssize_t sz=PyTuple_Size(li);
3976 throw INTERP_KERNEL::Exception(msg);
3977 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3980 std::vector<int> multiVal;
3981 std::pair<int, std::pair<int,int> > slic;
3982 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3983 if(!self->getArray())
3984 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3986 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3987 catch(INTERP_KERNEL::Exception& e)
3988 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3989 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3990 DataArrayDouble *ret0Arr=ret0->getArray();
3992 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3997 std::vector<int> v2(1,singleVal);
3998 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
3999 ret0->setArray(aarr);
4004 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4005 ret0->setArray(aarr);
4010 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4011 std::vector<int> v2(nbOfComp);
4012 for(int i=0;i<nbOfComp;i++)
4013 v2[i]=slic.first+i*slic.second.second;
4014 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4015 ret0->setArray(aarr);
4019 throw INTERP_KERNEL::Exception(msg);
4024 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
4027 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4030 double r1=self->getMaxValue2(tmp);
4031 PyObject *ret=PyTuple_New(2);
4032 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4033 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4037 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4040 double r1=self->getMinValue2(tmp);
4041 PyObject *ret=PyTuple_New(2);
4042 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4043 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4047 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4049 std::vector<int> tmp;
4050 convertPyToNewIntArr3(li,tmp);
4051 return self->keepSelectedComponents(tmp);
4054 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4056 std::vector<int> tmp;
4057 convertPyToNewIntArr3(li,tmp);
4058 self->setSelectedComponents(f,tmp);
4061 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4064 DataArrayDouble *a,*a2;
4065 DataArrayDoubleTuple *aa,*aa2;
4066 std::vector<double> bb,bb2;
4069 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4070 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4071 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4072 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4074 return self->extractSlice3D(orig,vect,eps);
4077 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4079 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
4082 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4084 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
4087 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4089 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.";
4090 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4093 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4095 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4097 return (*self)-(*other);
4099 throw INTERP_KERNEL::Exception(msg);
4104 DataArrayDoubleTuple *aa;
4105 std::vector<double> bb;
4107 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4112 if(!self->getArray())
4113 throw INTERP_KERNEL::Exception(msg2);
4114 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4115 ret->applyLin(1.,-val);
4116 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4117 ret2->setArray(ret);
4122 if(!self->getArray())
4123 throw INTERP_KERNEL::Exception(msg2);
4124 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4125 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4126 ret2->setArray(ret);
4131 if(!self->getArray())
4132 throw INTERP_KERNEL::Exception(msg2);
4133 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4134 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4135 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4136 ret2->setArray(ret);
4141 if(!self->getArray())
4142 throw INTERP_KERNEL::Exception(msg2);
4143 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4144 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4145 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4146 ret2->setArray(ret);
4150 { throw INTERP_KERNEL::Exception(msg); }
4154 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4156 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4159 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4161 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
4164 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4166 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4169 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4171 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.";
4172 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4175 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4177 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4179 return (*self)/(*other);
4181 throw INTERP_KERNEL::Exception(msg);
4186 DataArrayDoubleTuple *aa;
4187 std::vector<double> bb;
4189 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4195 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4196 if(!self->getArray())
4197 throw INTERP_KERNEL::Exception(msg2);
4198 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4199 ret->applyLin(1./val,0);
4200 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4201 ret2->setArray(ret);
4206 if(!self->getArray())
4207 throw INTERP_KERNEL::Exception(msg2);
4208 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4209 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4210 ret2->setArray(ret);
4215 if(!self->getArray())
4216 throw INTERP_KERNEL::Exception(msg2);
4217 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4218 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4219 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4220 ret2->setArray(ret);
4225 if(!self->getArray())
4226 throw INTERP_KERNEL::Exception(msg2);
4227 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4228 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4229 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4230 ret2->setArray(ret);
4234 { throw INTERP_KERNEL::Exception(msg); }
4238 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4240 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4243 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4245 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.";
4246 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4249 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4251 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4253 return (*self)^(*other);
4255 throw INTERP_KERNEL::Exception(msg);
4260 DataArrayDoubleTuple *aa;
4261 std::vector<double> bb;
4263 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4268 if(!self->getArray())
4269 throw INTERP_KERNEL::Exception(msg2);
4270 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4272 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4273 ret2->setArray(ret);
4278 if(!self->getArray())
4279 throw INTERP_KERNEL::Exception(msg2);
4280 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4281 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4282 ret2->setArray(ret);
4287 if(!self->getArray())
4288 throw INTERP_KERNEL::Exception(msg2);
4289 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4290 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4291 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4292 ret2->setArray(ret);
4297 if(!self->getArray())
4298 throw INTERP_KERNEL::Exception(msg2);
4299 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4300 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4301 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4302 ret2->setArray(ret);
4306 { throw INTERP_KERNEL::Exception(msg); }
4310 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4312 return self->negate();
4315 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4317 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.";
4318 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4321 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4323 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4327 Py_XINCREF(trueSelf);
4331 throw INTERP_KERNEL::Exception(msg);
4336 DataArrayDoubleTuple *aa;
4337 std::vector<double> bb;
4339 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4344 if(!self->getArray())
4345 throw INTERP_KERNEL::Exception(msg2);
4346 self->getArray()->applyLin(1.,val);
4347 Py_XINCREF(trueSelf);
4352 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4355 Py_XINCREF(trueSelf);
4360 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4361 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4362 ret2->setArray(aaa);
4364 Py_XINCREF(trueSelf);
4369 if(!self->getArray())
4370 throw INTERP_KERNEL::Exception(msg2);
4371 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4372 self->getArray()->addEqual(aaa);
4373 Py_XINCREF(trueSelf);
4377 { throw INTERP_KERNEL::Exception(msg); }
4381 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4383 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.";
4384 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4387 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4389 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4393 Py_XINCREF(trueSelf);
4397 throw INTERP_KERNEL::Exception(msg);
4402 DataArrayDoubleTuple *aa;
4403 std::vector<double> bb;
4405 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4410 if(!self->getArray())
4411 throw INTERP_KERNEL::Exception(msg2);
4412 self->getArray()->applyLin(1.,-val);
4413 Py_XINCREF(trueSelf);
4418 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4421 Py_XINCREF(trueSelf);
4426 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4427 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4428 ret2->setArray(aaa);
4430 Py_XINCREF(trueSelf);
4435 if(!self->getArray())
4436 throw INTERP_KERNEL::Exception(msg2);
4437 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4438 self->getArray()->substractEqual(aaa);
4439 Py_XINCREF(trueSelf);
4443 { throw INTERP_KERNEL::Exception(msg); }
4447 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4449 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.";
4450 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4453 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4455 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4459 Py_XINCREF(trueSelf);
4463 throw INTERP_KERNEL::Exception(msg);
4468 DataArrayDoubleTuple *aa;
4469 std::vector<double> bb;
4471 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4476 if(!self->getArray())
4477 throw INTERP_KERNEL::Exception(msg2);
4478 self->getArray()->applyLin(val,0);
4479 Py_XINCREF(trueSelf);
4484 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4487 Py_XINCREF(trueSelf);
4492 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4493 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4494 ret2->setArray(aaa);
4496 Py_XINCREF(trueSelf);
4501 if(!self->getArray())
4502 throw INTERP_KERNEL::Exception(msg2);
4503 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4504 self->getArray()->multiplyEqual(aaa);
4505 Py_XINCREF(trueSelf);
4509 { throw INTERP_KERNEL::Exception(msg); }
4513 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4515 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.";
4516 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4519 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4521 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4525 Py_XINCREF(trueSelf);
4529 throw INTERP_KERNEL::Exception(msg);
4534 DataArrayDoubleTuple *aa;
4535 std::vector<double> bb;
4537 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4543 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4544 if(!self->getArray())
4545 throw INTERP_KERNEL::Exception(msg2);
4546 self->getArray()->applyLin(1./val,0);
4547 Py_XINCREF(trueSelf);
4552 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4555 Py_XINCREF(trueSelf);
4560 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4561 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4562 ret2->setArray(aaa);
4564 Py_XINCREF(trueSelf);
4569 if(!self->getArray())
4570 throw INTERP_KERNEL::Exception(msg2);
4571 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4572 self->getArray()->divideEqual(aaa);
4573 Py_XINCREF(trueSelf);
4577 { throw INTERP_KERNEL::Exception(msg); }
4581 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4583 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.";
4584 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4587 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4589 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4593 Py_XINCREF(trueSelf);
4597 throw INTERP_KERNEL::Exception(msg);
4602 DataArrayDoubleTuple *aa;
4603 std::vector<double> bb;
4605 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4610 if(!self->getArray())
4611 throw INTERP_KERNEL::Exception(msg2);
4612 self->getArray()->applyPow(val);
4613 Py_XINCREF(trueSelf);
4618 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4621 Py_XINCREF(trueSelf);
4626 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4627 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4628 ret2->setArray(aaa);
4630 Py_XINCREF(trueSelf);
4635 if(!self->getArray())
4636 throw INTERP_KERNEL::Exception(msg2);
4637 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4638 self->getArray()->powEqual(aaa);
4639 Py_XINCREF(trueSelf);
4643 { throw INTERP_KERNEL::Exception(msg); }
4647 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4649 std::vector<const MEDCouplingFieldDouble *> tmp;
4650 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4651 return MEDCouplingFieldDouble::MergeFields(tmp);
4654 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4656 std::vector<const MEDCouplingFieldDouble *> tmp;
4657 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4658 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4663 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4666 int getNumberOfFields() const;
4667 MEDCouplingMultiFields *deepCpy() const;
4668 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4669 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4670 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4671 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4672 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4675 std::string __str__() const throw(INTERP_KERNEL::Exception)
4677 return self->simpleRepr();
4679 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4681 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4682 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4684 std::vector<MEDCouplingFieldDouble *> fs(sz);
4685 for(int i=0;i<sz;i++)
4686 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4687 return MEDCouplingMultiFields::New(fs);
4689 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4691 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4692 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4694 std::vector<MEDCouplingFieldDouble *> fs(sz);
4695 for(int i=0;i<sz;i++)
4696 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4697 return MEDCouplingMultiFields::New(fs);
4699 PyObject *getFields() const
4701 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4702 int sz=fields.size();
4703 PyObject *res = PyList_New(sz);
4704 for(int i=0;i<sz;i++)
4708 fields[i]->incrRef();
4709 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4713 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4718 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4720 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4724 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4727 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4729 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4731 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4733 PyObject *res = PyList_New(sz);
4734 for(int i=0;i<sz;i++)
4739 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4743 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4748 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4750 std::vector<int> refs;
4751 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4753 PyObject *res = PyList_New(sz);
4754 for(int i=0;i<sz;i++)
4759 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4763 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4767 PyObject *ret=PyTuple_New(2);
4768 PyTuple_SetItem(ret,0,res);
4769 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4772 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4774 std::vector<DataArrayDouble *> ms=self->getArrays();
4776 PyObject *res = PyList_New(sz);
4777 for(int i=0;i<sz;i++)
4782 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4786 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4791 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4793 std::vector< std::vector<int> > refs;
4794 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4796 PyObject *res = PyList_New(sz);
4797 PyObject *res2 = PyList_New(sz);
4798 for(int i=0;i<sz;i++)
4803 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4807 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4809 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4812 PyObject *ret=PyTuple_New(2);
4813 PyTuple_SetItem(ret,0,res);
4814 PyTuple_SetItem(ret,1,res2);
4820 class MEDCouplingDefinitionTime
4823 MEDCouplingDefinitionTime();
4824 void assign(const MEDCouplingDefinitionTime& other);
4825 bool isEqual(const MEDCouplingDefinitionTime& other) const;
4826 double getTimeResolution() const;
4827 std::vector<double> getHotSpotsTime() const;
4830 std::string __str__() const throw(INTERP_KERNEL::Exception)
4832 std::ostringstream oss;
4833 self->appendRepr(oss);
4837 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4839 int meshId,arrId,arrIdInField,fieldId;
4840 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4841 PyObject *res=PyList_New(4);
4842 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4843 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4844 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4845 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4849 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4851 int meshId,arrId,arrIdInField,fieldId;
4852 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4853 PyObject *res=PyList_New(4);
4854 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4855 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4856 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4857 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4863 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4866 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4867 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4871 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4873 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4874 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4876 std::vector<MEDCouplingFieldDouble *> fs(sz);
4877 for(int i=0;i<sz;i++)
4878 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4879 return MEDCouplingFieldOverTime::New(fs);
4881 std::string __str__() const throw(INTERP_KERNEL::Exception)
4883 return self->simpleRepr();
4885 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4887 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4888 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4890 std::vector<MEDCouplingFieldDouble *> fs(sz);
4891 for(int i=0;i<sz;i++)
4892 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4893 return MEDCouplingFieldOverTime::New(fs);
4898 class MEDCouplingCartesianAMRMesh;
4900 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
4903 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
4904 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
4905 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
4908 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
4910 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
4918 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
4921 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
4922 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
4923 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
4926 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
4928 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
4929 return convertFromVectorPairInt(ret);
4932 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
4934 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
4935 return convertFromVectorPairInt(ret);
4938 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
4940 std::vector< std::pair<int,int> > inp;
4941 convertPyToVectorPairInt(bottomLeftTopRight,inp);
4942 self->addPatch(inp,factors);
4945 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
4947 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
4949 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
4950 if(patchId==mesh->getNumberOfPatches())
4952 std::ostringstream oss;
4953 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
4954 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
4957 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
4963 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
4965 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
4967 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
4968 mesh->removePatch(patchId);
4971 int __len__() const throw(INTERP_KERNEL::Exception)
4973 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
4975 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
4976 return mesh->getNumberOfPatches();
4981 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
4985 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
4988 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
4989 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
4990 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
4991 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
4992 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
4993 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
4994 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
4995 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
4996 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
4997 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
4998 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
4999 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5000 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5002 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5003 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5004 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5005 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5006 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5007 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5008 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5009 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5010 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5011 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5012 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5013 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5014 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5015 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5016 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5017 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5018 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5019 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5020 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5021 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5024 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5026 std::vector< std::pair<int,int> > inp;
5027 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5028 self->addPatch(inp,factors);
5031 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5033 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5035 PyObject *ret = PyList_New(sz);
5036 for(int i=0;i<sz;i++)
5038 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5041 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5046 // agy : don't know why typemap fails here ??? let it in the extend section
5047 PyObject *deepCpy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5049 return convertCartesianAMRMesh(self->deepCpy(father), SWIG_POINTER_OWN | 0 );
5052 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5054 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5055 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5061 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5063 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5064 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5070 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5072 std::vector<int> out1;
5073 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5074 PyObject *ret(PyTuple_New(2));
5075 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5076 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5080 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5082 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5084 PyObject *ret = PyList_New(sz);
5085 for(int i=0;i<sz;i++)
5086 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5090 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5092 std::vector<const DataArrayDouble *> inp;
5093 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",inp);
5094 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5097 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5099 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5105 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5107 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5113 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5115 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5121 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5123 const MEDCouplingIMesh *ret(self->getImageMesh());
5126 return const_cast<MEDCouplingIMesh *>(ret);
5129 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5131 if(patchId==self->getNumberOfPatches())
5133 std::ostringstream oss;
5134 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5135 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5138 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5144 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5146 std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
5147 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5148 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5151 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5153 std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
5154 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5155 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5158 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5160 self->removePatch(patchId);
5163 int __len__() const throw(INTERP_KERNEL::Exception)
5165 return self->getNumberOfPatches();
5170 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5174 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5177 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5180 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5182 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5183 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5184 const int *nodeStrctPtr(0);
5185 const double *originPtr(0),*dxyzPtr(0);
5187 std::vector<int> bb0;
5188 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5191 std::vector<double> bb,bb2;
5193 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5194 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5196 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5199 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5201 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5202 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5203 std::vector< std::vector<int> > inp2;
5204 convertPyToVectorOfVectorOfInt(factors,inp2);
5205 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5208 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5210 return ParaMEDMEM_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5213 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5215 return MEDCouplingCartesianAMRMesh::New(mesh);
5220 class MEDCouplingDataForGodFather : public RefCountObject
5223 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5224 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5225 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5226 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5227 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5228 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5229 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5230 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5231 virtual void alloc() throw(INTERP_KERNEL::Exception);
5232 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5235 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5237 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5245 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5248 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5249 MEDCouplingAMRAttribute *deepCpy() const throw(INTERP_KERNEL::Exception);
5250 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5251 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5252 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5253 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5254 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5255 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5256 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5259 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5261 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5262 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5263 MEDCouplingAMRAttribute *ret(0);
5266 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5267 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5269 catch(INTERP_KERNEL::Exception&)
5271 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5272 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5277 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5279 return ParaMEDMEM_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5282 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5284 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5285 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5291 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5293 std::vector< std::vector<std::string> > compNamesCpp;
5294 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5295 self->spillInfoOnComponents(compNamesCpp);
5298 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5300 std::vector<int> inp0;
5301 if(!fillIntVector(nfs,inp0))
5302 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5303 std::size_t sz(inp0.size());
5304 std::vector<NatureOfField> inp00(sz);
5305 for(std::size_t i=0;i<sz;i++)
5306 inp00[i]=(NatureOfField)inp0[i];
5307 self->spillNatures(inp00);
5310 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5312 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5313 int sz((int)ret.size());
5314 PyObject *retPy(PyList_New(sz));
5315 for(int i=0;i<sz;i++)
5316 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5322 class DenseMatrix : public RefCountObject, public TimeLabel
5325 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5326 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5327 DenseMatrix *deepCpy() const throw(INTERP_KERNEL::Exception);
5328 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5330 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5331 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5332 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5333 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5334 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5335 void transpose() throw(INTERP_KERNEL::Exception);
5337 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5338 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5339 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5342 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5344 return DenseMatrix::New(nbRows,nbCols);
5347 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5349 return DenseMatrix::New(array,nbRows,nbCols);
5352 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5355 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5356 PyObject *ret=PyTuple_New(2);
5357 PyObject *ret0Py=ret0?Py_True:Py_False;
5359 PyTuple_SetItem(ret,0,ret0Py);
5360 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5364 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5366 DataArrayDouble *ret(self->getData());
5372 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5374 return ParaMEDMEM::DenseMatrix::Add(self,other);
5377 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5379 return ParaMEDMEM::DenseMatrix::Substract(self,other);
5382 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5384 return ParaMEDMEM::DenseMatrix::Multiply(self,other);
5387 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5389 return ParaMEDMEM::DenseMatrix::Multiply(self,other);
5392 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5394 self->addEqual(other);
5395 Py_XINCREF(trueSelf);
5399 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5401 self->substractEqual(other);
5402 Py_XINCREF(trueSelf);
5406 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5408 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5415 class PartDefinition : public RefCountObject, public TimeLabel
5418 static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5419 static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5420 virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
5421 virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
5422 virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
5423 virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
5424 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
5425 virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
5428 virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
5430 return (*self)+other;
5434 virtual ~PartDefinition();
5437 class DataArrayPartDefinition : public PartDefinition
5440 static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5443 DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
5445 return DataArrayPartDefinition::New(listOfIds);
5448 std::string __str__() const throw(INTERP_KERNEL::Exception)
5450 return self->getRepr();
5453 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5455 std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
5456 oss << self->getRepr();
5461 virtual ~DataArrayPartDefinition();
5464 class SlicePartDefinition : public PartDefinition
5467 static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5468 int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
5471 SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
5473 return SlicePartDefinition::New(start,stop,step);
5476 PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
5479 self->getSlice(a,b,c);
5480 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
5483 std::string __str__() const throw(INTERP_KERNEL::Exception)
5485 return self->getRepr();
5488 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5490 std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
5491 oss << self->getRepr();
5496 virtual ~SlicePartDefinition();
5502 __filename=os.environ.get('PYTHONSTARTUP')
5503 if __filename and os.path.isfile(__filename):
5504 execfile(__filename)