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::DataArrayPartDefinition::New;
394 %newobject ParaMEDMEM::SlicePartDefinition::New;
396 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
397 %feature("unref") MEDCouplingMesh "$this->decrRef();"
398 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
399 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
400 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
401 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
402 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
403 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
404 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
405 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
406 %feature("unref") MEDCouplingField "$this->decrRef();"
407 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
408 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
409 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
410 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
411 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
412 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
413 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
414 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
415 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
416 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
417 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
418 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
419 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
420 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
421 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
422 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
423 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
424 %feature("unref") DenseMatrix "$this->decrRef();"
425 %feature("unref") PartDefinition "$this->decrRef();"
426 %feature("unref") DataArrayPartDefinition "$this->decrRef();"
427 %feature("unref") SlicePartDefinition "$this->decrRef();"
429 %rename(assign) *::operator=;
430 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
431 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
432 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
433 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
437 %rename (InterpKernelException) INTERP_KERNEL::Exception;
439 %include "MEDCouplingRefCountObject.i"
440 %include "MEDCouplingMemArray.i"
442 namespace INTERP_KERNEL
445 * \class BoxSplittingOptions
446 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
448 class BoxSplittingOptions
451 BoxSplittingOptions();
452 void init() throw(INTERP_KERNEL::Exception);
453 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
454 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
455 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
456 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
457 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
458 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
459 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
460 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
461 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
462 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
463 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
464 std::string printOptions() const throw(INTERP_KERNEL::Exception);
467 std::string __str__() const throw(INTERP_KERNEL::Exception)
469 return self->printOptions();
491 CONST_ON_TIME_INTERVAL = 7
492 } TypeOfTimeDiscretization;
500 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
501 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
503 } MEDCouplingMeshType;
506 class DataArrayDouble;
507 class MEDCouplingUMesh;
508 class MEDCouplingFieldDouble;
510 %extend RefCountObject
512 std::string getHiddenCppPointer() const
514 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
519 %extend MEDCouplingGaussLocalization
521 std::string __str__() const throw(INTERP_KERNEL::Exception)
523 return self->getStringRepr();
526 std::string __repr__() const throw(INTERP_KERNEL::Exception)
528 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
529 oss << self->getStringRepr();
536 class MEDCouplingMesh : public RefCountObject, public TimeLabel
539 void setName(const std::string& name);
540 std::string getName() const;
541 void setDescription(const std::string& descr);
542 std::string getDescription() const;
543 void setTime(double val, int iteration, int order);
544 void setTimeUnit(const std::string& unit);
545 std::string getTimeUnit() const;
546 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
547 bool isStructured() const throw(INTERP_KERNEL::Exception);
548 virtual MEDCouplingMesh *deepCpy() const;
549 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
550 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
551 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
552 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
553 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
554 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
555 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
556 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
557 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
558 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
559 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
560 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
561 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
562 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
563 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
564 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
565 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
566 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
567 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
568 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
569 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
570 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
571 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
572 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
573 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
574 virtual std::string getVTKFileExtension() const;
575 std::string getVTKFileNameOf(const std::string& fileName) const;
577 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
578 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
579 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
580 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
581 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
582 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
583 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
584 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
585 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
586 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
587 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
588 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
589 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
590 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
591 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
592 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
593 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
596 std::string __str__() const throw(INTERP_KERNEL::Exception)
598 return self->simpleRepr();
601 PyObject *getTime() throw(INTERP_KERNEL::Exception)
604 double tmp0=self->getTime(tmp1,tmp2);
605 PyObject *res = PyList_New(3);
606 PyList_SetItem(res,0,SWIG_From_double(tmp0));
607 PyList_SetItem(res,1,SWIG_From_int(tmp1));
608 PyList_SetItem(res,2,SWIG_From_int(tmp2));
612 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
616 DataArrayDoubleTuple *aa;
617 std::vector<double> bb;
619 int spaceDim=self->getSpaceDimension();
620 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
621 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
622 return self->getCellContainingPoint(pos,eps);
625 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
629 DataArrayDoubleTuple *aa;
630 std::vector<double> bb;
632 int spaceDim=self->getSpaceDimension();
633 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
634 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
635 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
636 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
637 PyObject *ret=PyTuple_New(2);
638 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
639 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
643 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
645 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
646 int spaceDim=self->getSpaceDimension();
648 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
649 if (!SWIG_IsOK(res1))
652 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
653 int nbOfPoints=size/spaceDim;
656 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
658 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
662 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
664 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
665 da2->checkAllocated();
666 int size=da2->getNumberOfTuples();
667 int nbOfCompo=da2->getNumberOfComponents();
668 if(nbOfCompo!=spaceDim)
670 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
672 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
674 PyObject *ret=PyTuple_New(2);
675 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
676 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
680 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
684 DataArrayDoubleTuple *aa;
685 std::vector<double> bb;
687 int spaceDim=self->getSpaceDimension();
688 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
689 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
690 std::vector<int> elts;
691 self->getCellsContainingPoint(pos,eps,elts);
692 DataArrayInt *ret=DataArrayInt::New();
693 ret->alloc((int)elts.size(),1);
694 std::copy(elts.begin(),elts.end(),ret->getPointer());
695 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
698 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
700 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
701 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
702 self->getReverseNodalConnectivity(d0,d1);
703 PyObject *ret=PyTuple_New(2);
704 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
705 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
709 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
712 int v0; std::vector<int> v1;
713 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
714 self->renumberCells(ids,check);
717 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
719 DataArrayInt *cellCor, *nodeCor;
720 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
721 PyObject *res = PyList_New(2);
722 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
723 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
727 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
729 DataArrayInt *cellCor=0,*nodeCor=0;
730 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
731 PyObject *res = PyList_New(2);
732 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
733 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
737 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
739 DataArrayInt *cellCor=0;
740 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
744 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
747 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
748 if (!SWIG_IsOK(res1))
751 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
752 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
756 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
758 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
759 da2->checkAllocated();
760 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
763 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
765 std::vector<int> conn;
766 self->getNodeIdsOfCell(cellId,conn);
767 return convertIntArrToPyList2(conn);
770 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
772 std::vector<double> coo;
773 self->getCoordinatesOfNode(nodeId,coo);
774 return convertDblArrToPyList2(coo);
777 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
781 DataArrayDoubleTuple *aa;
782 std::vector<double> bb;
784 int spaceDim=self->getSpaceDimension();
785 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
786 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
787 self->scale(pointPtr,factor);
790 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
792 int spaceDim=self->getSpaceDimension();
793 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
794 self->getBoundingBox(tmp);
795 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
799 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
802 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
803 PyObject *ret=PyTuple_New(2);
804 PyObject *ret0Py=ret0?Py_True:Py_False;
806 PyTuple_SetItem(ret,0,ret0Py);
807 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
811 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
813 int szArr,sw,iTypppArr;
814 std::vector<int> stdvecTyyppArr;
815 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
816 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
817 if(sw==3)//DataArrayInt
819 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
820 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
821 std::string name=argpt->getName();
823 ret->setName(name.c_str());
825 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
828 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
830 int szArr,sw,iTypppArr;
831 std::vector<int> stdvecTyyppArr;
833 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
834 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
835 if(sw==3)//DataArrayInt
837 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
838 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
839 std::string name=argpt->getName();
841 ret->setName(name.c_str());
844 PyObject *res = PyList_New(2);
845 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
846 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
847 PyList_SetItem(res,0,obj0);
848 PyList_SetItem(res,1,obj1);
852 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
856 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
857 PyObject *res = PyTuple_New(2);
858 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
861 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
863 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
864 PyTuple_SetItem(res,0,obj0);
865 PyTuple_SetItem(res,1,obj1);
869 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
871 std::vector<int> vals=self->getDistributionOfTypes();
873 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
874 PyObject *ret=PyList_New((int)vals.size()/3);
875 for(int j=0;j<(int)vals.size()/3;j++)
877 PyObject *ret1=PyList_New(3);
878 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
879 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
880 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
881 PyList_SetItem(ret,j,ret1);
886 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
888 std::vector<int> code;
889 std::vector<const DataArrayInt *> idsPerType;
890 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
891 convertPyToNewIntArr4(li,1,3,code);
892 return self->checkTypeConsistencyAndContig(code,idsPerType);
895 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
897 std::vector<int> code;
898 std::vector<DataArrayInt *> idsInPflPerType;
899 std::vector<DataArrayInt *> idsPerType;
900 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
901 PyObject *ret=PyTuple_New(3);
904 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
905 PyObject *ret0=PyList_New((int)code.size()/3);
906 for(int j=0;j<(int)code.size()/3;j++)
908 PyObject *ret00=PyList_New(3);
909 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
910 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
911 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
912 PyList_SetItem(ret0,j,ret00);
914 PyTuple_SetItem(ret,0,ret0);
916 PyObject *ret1=PyList_New(idsInPflPerType.size());
917 for(std::size_t j=0;j<idsInPflPerType.size();j++)
918 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
919 PyTuple_SetItem(ret,1,ret1);
920 int n=idsPerType.size();
921 PyObject *ret2=PyList_New(n);
923 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
924 PyTuple_SetItem(ret,2,ret2);
928 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
932 DataArrayDoubleTuple *aa;
933 std::vector<double> bb;
935 int spaceDim=self->getSpaceDimension();
936 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
937 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
938 self->translate(vectorPtr);
941 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
943 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
946 DataArrayDoubleTuple *aa;
947 std::vector<double> bb;
949 int spaceDim=self->getSpaceDimension();
950 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
951 self->rotate(centerPtr,0,alpha);
954 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
956 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
958 DataArrayDouble *a,*a2;
959 DataArrayDoubleTuple *aa,*aa2;
960 std::vector<double> bb,bb2;
962 int spaceDim=self->getSpaceDimension();
963 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
964 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
965 self->rotate(centerPtr,vectorPtr,alpha);
968 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
970 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
971 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
972 PyObject *res=PyList_New(result.size());
973 for(int i=0;iL!=result.end(); i++, iL++)
974 PyList_SetItem(res,i,PyInt_FromLong(*iL));
978 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
980 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
981 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
982 return MEDCouplingMesh::MergeMeshes(tmp);
988 //== MEDCouplingMesh End
990 %include "NormalizedGeometricTypes"
991 %include "MEDCouplingNatureOfFieldEnum"
995 class MEDCouplingNatureOfField
998 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
999 static std::string GetReprNoThrow(NatureOfField nat);
1000 static std::string GetAllPossibilitiesStr();
1004 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1005 // include "MEDCouplingTimeDiscretization.i"
1007 namespace ParaMEDMEM
1009 class MEDCouplingGaussLocalization
1012 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1013 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1014 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1015 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1016 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1017 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1018 int getDimension() const throw(INTERP_KERNEL::Exception);
1019 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1020 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1021 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1022 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1024 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1025 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1026 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1027 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1028 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1029 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1030 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1031 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1032 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1033 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1034 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1035 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1037 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1041 %include "MEDCouplingFieldDiscretization.i"
1043 //== MEDCouplingPointSet
1045 namespace ParaMEDMEM
1047 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
1050 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1051 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1052 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1053 void zipCoords() throw(INTERP_KERNEL::Exception);
1054 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1055 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1056 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1057 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1058 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1059 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1060 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1061 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1062 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1063 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1064 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1065 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1066 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1067 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1068 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1069 virtual DataArrayInt *findBoundaryNodes() const;
1070 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1071 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1072 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1073 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1074 virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1075 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1076 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1079 std::string __str__() const throw(INTERP_KERNEL::Exception)
1081 return self->simpleRepr();
1084 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1087 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1088 PyObject *res = PyList_New(2);
1089 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1090 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1094 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1096 DataArrayInt *comm, *commIndex;
1097 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1098 PyObject *res = PyList_New(2);
1099 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1100 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1104 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1106 DataArrayDouble *ret1=self->getCoords();
1109 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1112 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1114 int szArr,sw,iTypppArr;
1115 std::vector<int> stdvecTyyppArr;
1116 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1117 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1118 if(sw==3)//DataArrayInt
1120 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1121 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1122 std::string name=argpt->getName();
1124 ret->setName(name.c_str());
1126 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1129 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1131 int szArr,sw,iTypppArr;
1132 std::vector<int> stdvecTyyppArr;
1133 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1134 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1135 if(sw==3)//DataArrayInt
1137 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1138 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1139 std::string name=argpt->getName();
1141 ret->setName(name.c_str());
1143 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1146 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1148 int szArr,sw,iTypppArr;
1149 std::vector<int> stdvecTyyppArr;
1150 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1151 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1152 if(sw==3)//DataArrayInt
1154 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1155 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1156 std::string name=argpt->getName();
1158 ret->setName(name.c_str());
1160 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1163 virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1165 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1166 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1169 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1171 int szArr,sw,iTypppArr;
1172 std::vector<int> stdvecTyyppArr;
1173 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1174 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1175 if(sw==3)//DataArrayInt
1177 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1178 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1179 std::string name=argpt->getName();
1181 ret->setName(name.c_str());
1183 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1186 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1188 int szArr,sw,iTypppArr;
1189 std::vector<int> stdvecTyyppArr;
1190 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1191 self->renumberNodes(tmp,newNbOfNodes);
1194 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1196 int szArr,sw,iTypppArr;
1197 std::vector<int> stdvecTyyppArr;
1198 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1199 self->renumberNodes2(tmp,newNbOfNodes);
1202 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1204 int spaceDim=self->getSpaceDimension();
1206 DataArrayDouble *a,*a2;
1207 DataArrayDoubleTuple *aa,*aa2;
1208 std::vector<double> bb,bb2;
1210 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1211 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1212 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1213 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1214 std::vector<int> nodes;
1215 self->findNodesOnLine(p,v,eps,nodes);
1216 DataArrayInt *ret=DataArrayInt::New();
1217 ret->alloc((int)nodes.size(),1);
1218 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1219 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1221 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1223 int spaceDim=self->getSpaceDimension();
1225 DataArrayDouble *a,*a2;
1226 DataArrayDoubleTuple *aa,*aa2;
1227 std::vector<double> bb,bb2;
1229 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1230 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1231 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1232 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1233 std::vector<int> nodes;
1234 self->findNodesOnPlane(p,v,eps,nodes);
1235 DataArrayInt *ret=DataArrayInt::New();
1236 ret->alloc((int)nodes.size(),1);
1237 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1238 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1241 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1245 DataArrayDoubleTuple *aa;
1246 std::vector<double> bb;
1248 int spaceDim=self->getSpaceDimension();
1249 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1250 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1251 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1252 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1255 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1257 DataArrayInt *c=0,*cI=0;
1261 DataArrayDoubleTuple *aa;
1262 std::vector<double> bb;
1264 int spaceDim=self->getSpaceDimension();
1265 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1266 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1267 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1268 PyObject *ret=PyTuple_New(2);
1269 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1270 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1274 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1276 DataArrayInt *c=0,*cI=0;
1277 int spaceDim=self->getSpaceDimension();
1280 DataArrayDoubleTuple *aa;
1281 std::vector<double> bb;
1284 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1285 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1287 PyObject *ret=PyTuple_New(2);
1288 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1289 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1293 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1297 DataArrayDoubleTuple *aa;
1298 std::vector<double> bb;
1300 int spaceDim=self->getSpaceDimension();
1301 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1302 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1304 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1305 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1308 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1312 std::vector<int> multiVal;
1313 std::pair<int, std::pair<int,int> > slic;
1314 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1315 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1319 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1321 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1323 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1325 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1329 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1331 DataArrayInt *v0=0,*v1=0;
1332 self->findCommonCells(compType,startCellId,v0,v1);
1333 PyObject *res = PyList_New(2);
1334 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1335 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1340 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1343 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1344 if (!SWIG_IsOK(res1))
1347 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1348 self->renumberNodesInConn(tmp);
1352 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1354 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1355 da2->checkAllocated();
1356 self->renumberNodesInConn(da2->getConstPointer());
1360 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1363 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1364 PyObject *ret=PyTuple_New(2);
1365 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1366 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1370 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1372 DataArrayInt *ret=0;
1374 int szArr,sw,iTypppArr;
1375 std::vector<int> stdvecTyyppArr;
1376 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1377 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1381 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1385 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1386 PyObject *res = PyList_New(3);
1387 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1388 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1389 PyList_SetItem(res,2,SWIG_From_int(ret2));
1393 virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1397 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1398 PyObject *res = PyList_New(3);
1399 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1400 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1401 PyList_SetItem(res,2,SWIG_From_int(ret2));
1405 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1408 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1409 if (!SWIG_IsOK(res1))
1412 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1413 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1417 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1419 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1420 da2->checkAllocated();
1421 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1425 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1429 std::vector<int> multiVal;
1430 std::pair<int, std::pair<int,int> > slic;
1431 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1432 int nbc=self->getNumberOfCells();
1433 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1440 std::ostringstream oss;
1441 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1442 throw INTERP_KERNEL::Exception(oss.str().c_str());
1445 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1450 int tmp=nbc+singleVal;
1451 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1455 std::ostringstream oss;
1456 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1457 throw INTERP_KERNEL::Exception(oss.str().c_str());
1463 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1467 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1472 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1473 daIntTyypp->checkAllocated();
1474 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1477 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1481 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1484 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1485 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1486 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1487 for(int i=0;i<sz;i++)
1488 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1491 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1494 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1496 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1497 std::vector<double> val3;
1498 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1499 "Rotate2DAlg",2,true,nbNodes);
1501 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1502 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1505 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1508 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1509 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1510 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1511 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1512 for(int i=0;i<sz;i++)
1513 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1516 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1519 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1521 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1522 std::vector<double> val3;
1523 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1524 "Rotate3DAlg",3,true,nbNodes);
1526 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1527 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1528 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1533 //== MEDCouplingPointSet End
1535 class MEDCouplingUMeshCell
1538 INTERP_KERNEL::NormalizedCellType getType() const;
1541 std::string __str__() const throw(INTERP_KERNEL::Exception)
1543 return self->repr();
1546 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1549 const int *r=self->getAllConn(ret2);
1550 PyObject *ret=PyTuple_New(ret2);
1551 for(int i=0;i<ret2;i++)
1552 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1558 class MEDCouplingUMeshCellIterator
1565 MEDCouplingUMeshCell *ret=self->nextt();
1567 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1570 PyErr_SetString(PyExc_StopIteration,"No more data.");
1577 class MEDCouplingUMeshCellByTypeIterator
1580 ~MEDCouplingUMeshCellByTypeIterator();
1585 MEDCouplingUMeshCellEntry *ret=self->nextt();
1587 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1590 PyErr_SetString(PyExc_StopIteration,"No more data.");
1597 class MEDCouplingUMeshCellByTypeEntry
1600 ~MEDCouplingUMeshCellByTypeEntry();
1603 MEDCouplingUMeshCellByTypeIterator *__iter__()
1605 return self->iterator();
1610 class MEDCouplingUMeshCellEntry
1613 INTERP_KERNEL::NormalizedCellType getType() const;
1614 int getNumberOfElems() const;
1617 MEDCouplingUMeshCellIterator *__iter__()
1619 return self->iterator();
1624 //== MEDCouplingUMesh
1626 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1629 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1630 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1631 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1632 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1633 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1634 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1635 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1636 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1637 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1638 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1639 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1640 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1641 void computeTypes() throw(INTERP_KERNEL::Exception);
1642 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1643 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1645 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1646 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1647 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1648 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1649 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1650 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1651 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1652 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1653 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1654 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1655 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1656 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1657 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1658 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1659 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1660 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1661 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1662 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1663 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1664 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1665 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1666 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1667 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1668 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1669 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1670 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1671 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1672 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1673 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1674 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1675 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1676 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1677 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1678 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1679 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1680 ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1681 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1682 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1683 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1684 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1685 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1686 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1687 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1688 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);
1689 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1690 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1691 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1692 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1693 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1695 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1697 return MEDCouplingUMesh::New();
1700 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1702 return MEDCouplingUMesh::New(meshName,meshDim);
1705 std::string __str__() const throw(INTERP_KERNEL::Exception)
1707 return self->simpleRepr();
1710 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1712 std::ostringstream oss;
1713 self->reprQuickOverview(oss);
1717 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1719 return self->cellIterator();
1722 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1724 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1725 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1726 PyObject *res=PyList_New(result.size());
1727 for(int i=0;iL!=result.end(); i++, iL++)
1728 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1732 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1736 std::vector<int> multiVal;
1737 std::pair<int, std::pair<int,int> > slic;
1738 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1739 int nbc=self->getNumberOfCells();
1740 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1747 std::ostringstream oss;
1748 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1749 throw INTERP_KERNEL::Exception(oss.str().c_str());
1753 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1760 int tmp=nbc+singleVal;
1761 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1766 std::ostringstream oss;
1767 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1768 throw INTERP_KERNEL::Exception(oss.str().c_str());
1774 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1780 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1781 daIntTyypp->checkAllocated();
1782 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1786 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1790 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1794 std::vector<int> multiVal;
1795 std::pair<int, std::pair<int,int> > slic;
1796 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1797 int nbc=self->getNumberOfCells();
1798 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1805 std::ostringstream oss;
1806 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1807 throw INTERP_KERNEL::Exception(oss.str().c_str());
1811 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1818 int tmp=nbc+singleVal;
1819 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1824 std::ostringstream oss;
1825 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1826 throw INTERP_KERNEL::Exception(oss.str().c_str());
1832 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1837 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1843 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1844 daIntTyypp->checkAllocated();
1845 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1849 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1853 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1855 int szArr,sw,iTypppArr;
1856 std::vector<int> stdvecTyyppArr;
1857 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1860 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1861 throw INTERP_KERNEL::Exception(oss.str().c_str());
1863 self->insertNextCell(type,size,tmp);
1866 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1868 int szArr,sw,iTypppArr;
1869 std::vector<int> stdvecTyyppArr;
1870 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1871 self->insertNextCell(type,szArr,tmp);
1874 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1876 DataArrayInt *ret=self->getNodalConnectivity();
1881 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1883 DataArrayInt *ret=self->getNodalConnectivityIndex();
1889 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1891 int szArr,sw,iTypppArr;
1892 std::vector<int> stdvecTyyppArr;
1893 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1894 int nbOfDepthPeelingPerformed=0;
1895 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1896 PyObject *res=PyTuple_New(2);
1897 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1898 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1902 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1904 DataArrayInt *v0=0,*v1=0;
1905 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1906 PyObject *res = PyList_New(2);
1907 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1908 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1912 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
1916 DataArrayDoubleTuple *aa;
1917 std::vector<double> bb;
1919 int nbOfCompo=self->getSpaceDimension();
1920 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
1923 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
1924 PyObject *ret=PyTuple_New(2);
1925 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1926 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
1930 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
1932 DataArrayInt *ret1=0;
1933 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
1934 PyObject *ret=PyTuple_New(2);
1935 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1936 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1940 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
1943 DataArrayInt *ret1(0);
1944 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
1945 PyObject *ret=PyTuple_New(3);
1946 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
1947 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1948 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
1952 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
1954 std::vector<int> cells;
1955 self->checkButterflyCells(cells,eps);
1956 DataArrayInt *ret=DataArrayInt::New();
1957 ret->alloc((int)cells.size(),1);
1958 std::copy(cells.begin(),cells.end(),ret->getPointer());
1959 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1962 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
1964 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
1966 PyObject *ret = PyList_New(sz);
1967 for(int i=0;i<sz;i++)
1968 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1972 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
1974 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
1975 int sz=retCpp.size();
1976 PyObject *ret=PyList_New(sz);
1977 for(int i=0;i<sz;i++)
1978 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1982 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
1985 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
1986 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
1987 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
1990 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
1993 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1994 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
1998 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2001 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2002 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2006 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2008 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2009 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2010 PyObject *ret=PyTuple_New(3);
2011 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2012 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2013 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2017 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2019 DataArrayInt *tmp0=0,*tmp1=0;
2020 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2021 PyObject *ret=PyTuple_New(2);
2022 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2023 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2027 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2031 std::vector<int> multiVal;
2032 std::pair<int, std::pair<int,int> > slic;
2033 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2034 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2038 return self->duplicateNodes(&singleVal,&singleVal+1);
2040 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2042 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2044 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2048 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2052 std::vector<int> multiVal;
2053 std::pair<int, std::pair<int,int> > slic;
2054 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2055 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2059 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2061 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2063 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2065 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2069 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2072 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2073 DataArrayInt *tmp0,*tmp1=0;
2074 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2075 PyObject *ret=PyTuple_New(2);
2076 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2077 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2081 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2083 DataArrayInt *ret0=0,*ret1=0;
2084 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2085 PyObject *ret=PyTuple_New(2);
2086 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2087 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2091 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2093 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2094 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2095 DataArrayInt *ret1=0,*ret2=0;
2096 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2097 PyObject *ret=PyTuple_New(3);
2098 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2099 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2100 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2104 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2106 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2107 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2108 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2109 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2112 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2115 std::vector<const MEDCouplingUMesh *> meshes;
2116 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2117 std::vector<DataArrayInt *> corr;
2118 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2120 PyObject *ret1=PyList_New(sz);
2121 for(int i=0;i<sz;i++)
2122 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2123 PyObject *ret=PyList_New(2);
2124 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2125 PyList_SetItem(ret,1,ret1);
2129 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2131 std::vector<MEDCouplingUMesh *> meshes;
2132 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2133 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2136 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2138 std::vector<MEDCouplingUMesh *> meshes;
2139 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2140 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2143 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2147 std::vector<int> multiVal;
2148 std::pair<int, std::pair<int,int> > slic;
2149 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2151 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2152 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2156 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2158 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2160 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2162 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2166 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2168 DataArrayInt *arrOut=0,*arrIndexOut=0;
2171 std::vector<int> multiVal;
2172 std::pair<int, std::pair<int,int> > slic;
2173 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2175 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2176 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2181 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2186 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2191 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2195 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2197 PyObject *ret=PyTuple_New(2);
2198 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2199 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2203 static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2205 DataArrayInt *arrOut=0,*arrIndexOut=0;
2206 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2207 PyObject *ret=PyTuple_New(2);
2208 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2209 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2213 static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2215 if(!PySlice_Check(slic))
2216 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2217 Py_ssize_t strt=2,stp=2,step=2;
2218 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2220 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2221 arrIndxIn->checkAllocated();
2222 if(arrIndxIn->getNumberOfComponents()!=1)
2223 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2224 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2225 DataArrayInt *arrOut=0,*arrIndexOut=0;
2226 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2227 PyObject *ret=PyTuple_New(2);
2228 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2229 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2233 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2234 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2235 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2237 DataArrayInt *arrOut=0,*arrIndexOut=0;
2240 std::vector<int> multiVal;
2241 std::pair<int, std::pair<int,int> > slic;
2242 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2244 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2245 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2250 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2255 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2260 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2264 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2266 PyObject *ret=PyTuple_New(2);
2267 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2268 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2272 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2273 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2277 std::vector<int> multiVal;
2278 std::pair<int, std::pair<int,int> > slic;
2279 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2281 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2282 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2287 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2292 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2297 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2301 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2305 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2309 DataArrayDoubleTuple *aa;
2310 std::vector<double> bb;
2312 int spaceDim=self->getSpaceDimension();
2313 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2314 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2316 std::vector<int> cells;
2317 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2318 DataArrayInt *ret=DataArrayInt::New();
2319 ret->alloc((int)cells.size(),1);
2320 std::copy(cells.begin(),cells.end(),ret->getPointer());
2321 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2324 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2328 DataArrayDoubleTuple *aa;
2329 std::vector<double> bb;
2331 int spaceDim=self->getSpaceDimension();
2332 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2333 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2334 self->orientCorrectly2DCells(v,polyOnly);
2337 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2339 std::vector<int> cells;
2340 self->arePolyhedronsNotCorrectlyOriented(cells);
2341 DataArrayInt *ret=DataArrayInt::New();
2342 ret->alloc((int)cells.size(),1);
2343 std::copy(cells.begin(),cells.end(),ret->getPointer());
2344 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2347 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2351 self->getFastAveragePlaneOfThis(vec,pos);
2353 std::copy(vec,vec+3,vals);
2354 std::copy(pos,pos+3,vals+3);
2355 return convertDblArrToPyListOfTuple(vals,3,2);
2358 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2360 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2361 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2362 return MEDCouplingUMesh::MergeUMeshes(tmp);
2365 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2368 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2369 PyObject *ret=PyTuple_New(2);
2370 PyObject *ret0Py=ret0?Py_True:Py_False;
2372 PyTuple_SetItem(ret,0,ret0Py);
2373 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2377 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2380 bool ret0=self->areCellsIncludedIn2(other,ret1);
2381 PyObject *ret=PyTuple_New(2);
2382 PyObject *ret0Py=ret0?Py_True:Py_False;
2384 PyTuple_SetItem(ret,0,ret0Py);
2385 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2389 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2391 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2392 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2393 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2394 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2395 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2396 PyObject *ret=PyTuple_New(5);
2397 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2398 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2399 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2400 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2401 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2405 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2407 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2408 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2409 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2410 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2411 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2412 PyObject *ret=PyTuple_New(5);
2413 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2414 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2415 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2416 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2417 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2421 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2423 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2424 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2425 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2426 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2427 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2428 PyObject *ret=PyTuple_New(5);
2429 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2430 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2431 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2432 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2433 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2437 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2439 DataArrayInt *neighbors=0,*neighborsIdx=0;
2440 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2441 PyObject *ret=PyTuple_New(2);
2442 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2443 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2447 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2449 DataArrayInt *neighbors=0,*neighborsIdx=0;
2450 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2451 PyObject *ret=PyTuple_New(2);
2452 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2453 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2457 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2459 DataArrayInt *neighbors=0,*neighborsIdx=0;
2460 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2461 PyObject *ret=PyTuple_New(2);
2462 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2463 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2467 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2469 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2470 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2471 DataArrayInt *d2,*d3,*d4,*dd5;
2472 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2473 PyObject *ret=PyTuple_New(7);
2474 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2475 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2476 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2477 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2478 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2479 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2480 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2484 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2487 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2488 da->checkAllocated();
2489 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2492 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2495 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2496 da->checkAllocated();
2497 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2500 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2503 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2504 da->checkAllocated();
2505 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2508 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2511 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2512 da->checkAllocated();
2513 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2514 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2515 PyObject *res = PyList_New(result.size());
2516 for (int i=0;iL!=result.end(); i++, iL++)
2517 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2521 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2524 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2525 da->checkAllocated();
2526 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2527 ret->setName(da->getName().c_str());
2531 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2533 DataArrayInt *cellNb1=0,*cellNb2=0;
2534 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2535 PyObject *ret=PyTuple_New(3);
2536 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2537 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2538 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2542 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2544 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2545 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2546 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2547 PyObject *ret(PyTuple_New(4));
2548 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2549 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2550 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2551 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2555 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2557 int spaceDim=self->getSpaceDimension();
2559 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2561 DataArrayDouble *a,*a2;
2562 DataArrayDoubleTuple *aa,*aa2;
2563 std::vector<double> bb,bb2;
2565 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2566 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2567 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2568 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2570 DataArrayInt *cellIds=0;
2571 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2572 PyObject *ret=PyTuple_New(2);
2573 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2574 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2578 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2580 int spaceDim=self->getSpaceDimension();
2582 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2584 DataArrayDouble *a,*a2;
2585 DataArrayDoubleTuple *aa,*aa2;
2586 std::vector<double> bb,bb2;
2588 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2589 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2590 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2591 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2593 DataArrayInt *cellIds=0;
2594 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2595 PyObject *ret=PyTuple_New(2);
2596 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2597 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2601 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2603 int spaceDim=self->getSpaceDimension();
2605 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2607 DataArrayDouble *a,*a2;
2608 DataArrayDoubleTuple *aa,*aa2;
2609 std::vector<double> bb,bb2;
2611 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2612 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2613 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2614 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2615 return self->getCellIdsCrossingPlane(orig,vect,eps);
2618 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2622 std::vector<int> pos2;
2623 DataArrayInt *pos3=0;
2624 DataArrayIntTuple *pos4=0;
2625 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2630 self->convertToPolyTypes(&pos1,&pos1+1);
2637 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2642 self->convertToPolyTypes(pos3->begin(),pos3->end());
2646 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2650 void convertAllToPoly();
2651 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2652 bool unPolyze() throw(INTERP_KERNEL::Exception);
2653 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2654 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2655 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2658 //== MEDCouplingUMesh End
2660 //== MEDCouplingExtrudedMesh
2662 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2665 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2666 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2668 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2670 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2673 std::string __str__() const throw(INTERP_KERNEL::Exception)
2675 return self->simpleRepr();
2678 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2680 std::ostringstream oss;
2681 self->reprQuickOverview(oss);
2685 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2687 MEDCouplingUMesh *ret=self->getMesh2D();
2690 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2692 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2694 MEDCouplingUMesh *ret=self->getMesh1D();
2697 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2699 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2701 DataArrayInt *ret=self->getMesh3DIds();
2704 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2709 //== MEDCouplingExtrudedMesh End
2711 class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2714 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2715 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2716 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2717 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2718 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2719 virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2722 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2724 int szArr,sw,iTypppArr;
2725 std::vector<int> stdvecTyyppArr;
2726 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2727 self->insertNextCell(tmp,tmp+szArr);
2730 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2732 DataArrayInt *ret=self->getNodalConnectivity();
2733 if(ret) ret->incrRef();
2737 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2739 std::vector< const MEDCoupling1GTUMesh *> parts;
2740 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2741 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2746 //== MEDCoupling1SGTUMesh
2748 class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2751 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2752 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2753 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2754 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2755 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2756 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2757 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2758 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
2759 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
2762 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2764 return MEDCoupling1SGTUMesh::New(name,type);
2767 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2769 return MEDCoupling1SGTUMesh::New(m);
2772 std::string __str__() const throw(INTERP_KERNEL::Exception)
2774 return self->simpleRepr();
2777 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2779 std::ostringstream oss;
2780 self->reprQuickOverview(oss);
2784 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
2786 DataArrayInt *cellPerm(0),*nodePerm(0);
2787 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
2788 PyObject *ret(PyTuple_New(3));
2789 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
2790 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2791 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2795 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2797 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2798 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2799 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2802 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2804 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2805 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2806 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2811 //== MEDCoupling1SGTUMesh End
2813 //== MEDCoupling1DGTUMesh
2815 class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2818 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2819 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2820 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2821 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2822 bool isPacked() const throw(INTERP_KERNEL::Exception);
2825 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2827 return MEDCoupling1DGTUMesh::New(name,type);
2830 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2832 return MEDCoupling1DGTUMesh::New(m);
2835 std::string __str__() const throw(INTERP_KERNEL::Exception)
2837 return self->simpleRepr();
2840 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2842 std::ostringstream oss;
2843 self->reprQuickOverview(oss);
2847 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2849 DataArrayInt *ret=self->getNodalConnectivityIndex();
2850 if(ret) ret->incrRef();
2854 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2856 DataArrayInt *ret1=0,*ret2=0;
2857 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2858 PyObject *ret0Py=ret0?Py_True:Py_False;
2860 PyObject *ret=PyTuple_New(3);
2861 PyTuple_SetItem(ret,0,ret0Py);
2862 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2863 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2867 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
2870 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
2871 PyObject *ret=PyTuple_New(2);
2872 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
2873 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
2874 PyTuple_SetItem(ret,1,ret1Py);
2878 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2880 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2881 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2882 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
2885 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2887 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2888 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2889 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
2892 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
2894 std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
2895 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2896 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
2901 //== MEDCoupling1DGTUMeshEnd
2903 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2906 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2907 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2908 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
2909 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
2910 double computeSquareness() const throw(INTERP_KERNEL::Exception);
2911 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2912 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
2913 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
2914 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
2915 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
2916 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
2917 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
2918 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
2921 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
2923 int tmpp1=-1,tmpp2=-1;
2924 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
2925 std::vector< std::pair<int,int> > inp;
2929 for(int i=0;i<tmpp1;i++)
2930 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2935 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
2936 inp.resize(tmpp1/2);
2937 for(int i=0;i<tmpp1/2;i++)
2938 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2941 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
2942 return self->buildStructuredSubPart(inp);
2945 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
2947 std::vector< std::pair<int,int> > inp;
2948 convertPyToVectorPairInt(part,inp);
2950 int szArr,sw,iTypppArr;
2951 std::vector<int> stdvecTyyppArr;
2952 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
2953 std::vector<int> tmp5(tmp4,tmp4+szArr);
2955 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
2958 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
2960 std::vector< std::pair<int,int> > inp;
2961 convertPyToVectorPairInt(part,inp);
2962 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
2965 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
2967 std::vector< std::pair<int,int> > inp;
2968 convertPyToVectorPairInt(part,inp);
2969 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
2972 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
2974 std::vector< std::pair<int,int> > inp;
2975 convertPyToVectorPairInt(part,inp);
2976 std::vector<int> stWithGhost;
2977 std::vector< std::pair<int,int> > partWithGhost;
2978 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
2979 PyObject *ret(PyTuple_New(2));
2980 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
2981 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
2985 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
2987 std::vector< std::pair<int,int> > inp;
2988 convertPyToVectorPairInt(partCompactFormat,inp);
2989 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
2992 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
2994 std::vector< std::pair<int,int> > inp;
2995 convertPyToVectorPairInt(partCompactFormat,inp);
2996 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
2999 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3001 std::vector< std::pair<int,int> > inp;
3002 convertPyToVectorPairInt(part,inp);
3003 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3006 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3008 int szArr,sw,iTypppArr;
3009 std::vector<int> stdvecTyyppArr;
3010 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3011 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3014 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3016 int szArr,sw,iTypppArr;
3017 std::vector<int> stdvecTyyppArr;
3018 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3019 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3022 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3024 std::vector< std::pair<int,int> > inp;
3025 convertPyToVectorPairInt(partCompactFormat,inp);
3026 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3029 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3031 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3032 PyObject *retPy=PyList_New(ret.size());
3033 for(std::size_t i=0;i<ret.size();i++)
3035 PyObject *tmp=PyTuple_New(2);
3036 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3037 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3038 PyList_SetItem(retPy,i,tmp);
3043 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3045 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3046 convertPyToVectorPairInt(r1,r1Cpp);
3047 convertPyToVectorPairInt(r2,r2Cpp);
3048 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3049 PyObject *retPy=PyList_New(ret.size());
3050 for(std::size_t i=0;i<ret.size();i++)
3052 PyObject *tmp=PyTuple_New(2);
3053 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3054 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3055 PyList_SetItem(retPy,i,tmp);
3060 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3062 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3063 convertPyToVectorPairInt(r1,r1Cpp);
3064 convertPyToVectorPairInt(r2,r2Cpp);
3065 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3068 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3070 int szArr,sw,iTypppArr;
3071 std::vector<int> stdvecTyyppArr;
3072 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3073 int szArr2,sw2,iTypppArr2;
3074 std::vector<int> stdvecTyyppArr2;
3075 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3076 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3077 std::vector< std::pair<int,int> > partCompactFormat;
3078 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3079 PyObject *ret=PyTuple_New(2);
3080 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3081 PyTuple_SetItem(ret,0,ret0Py);
3082 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3083 for(std::size_t i=0;i<partCompactFormat.size();i++)
3085 PyObject *tmp4=PyTuple_New(2);
3086 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3087 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3088 PyList_SetItem(ret1Py,i,tmp4);
3090 PyTuple_SetItem(ret,1,ret1Py);
3094 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3096 std::vector< std::pair<int,int> > param0,param1,ret;
3097 convertPyToVectorPairInt(bigInAbs,param0);
3098 convertPyToVectorPairInt(partOfBigInAbs,param1);
3099 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3100 PyObject *retPy(PyList_New(ret.size()));
3101 for(std::size_t i=0;i<ret.size();i++)
3103 PyObject *tmp(PyTuple_New(2));
3104 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3105 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3106 PyList_SetItem(retPy,i,tmp);
3111 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3113 std::vector< std::pair<int,int> > param0;
3114 convertPyToVectorPairInt(part,param0);
3115 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3116 PyObject *retPy(PyList_New(ret.size()));
3117 for(std::size_t i=0;i<ret.size();i++)
3119 PyObject *tmp(PyTuple_New(2));
3120 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3121 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3122 PyList_SetItem(retPy,i,tmp);
3127 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3129 std::vector< std::pair<int,int> > param0,param1;
3130 convertPyToVectorPairInt(startingFrom,param0);
3131 convertPyToVectorPairInt(goingTo,param1);
3132 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3135 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3137 std::vector< std::pair<int,int> > param0,param1,ret;
3138 convertPyToVectorPairInt(bigInAbs,param0);
3139 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3140 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3141 PyObject *retPy(PyList_New(ret.size()));
3142 for(std::size_t i=0;i<ret.size();i++)
3144 PyObject *tmp(PyTuple_New(2));
3145 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3146 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3147 PyList_SetItem(retPy,i,tmp);
3154 //== MEDCouplingCMesh
3156 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3159 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3160 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3161 MEDCouplingCMesh *clone(bool recDeepCpy) const;
3162 void setCoords(const DataArrayDouble *coordsX,
3163 const DataArrayDouble *coordsY=0,
3164 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3165 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3167 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3169 return MEDCouplingCMesh::New();
3171 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3173 return MEDCouplingCMesh::New(meshName);
3175 std::string __str__() const throw(INTERP_KERNEL::Exception)
3177 return self->simpleRepr();
3179 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3181 std::ostringstream oss;
3182 self->reprQuickOverview(oss);
3185 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3187 DataArrayDouble *ret=self->getCoordsAt(i);
3195 //== MEDCouplingCMesh End
3197 //== MEDCouplingCurveLinearMesh
3199 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3202 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3203 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3204 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
3205 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3207 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3209 return MEDCouplingCurveLinearMesh::New();
3211 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3213 return MEDCouplingCurveLinearMesh::New(meshName);
3215 std::string __str__() const throw(INTERP_KERNEL::Exception)
3217 return self->simpleRepr();
3219 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3221 std::ostringstream oss;
3222 self->reprQuickOverview(oss);
3225 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3227 DataArrayDouble *ret=self->getCoords();
3232 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3234 int szArr,sw,iTypppArr;
3235 std::vector<int> stdvecTyyppArr;
3236 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3237 self->setNodeGridStructure(tmp,tmp+szArr);
3242 //== MEDCouplingCurveLinearMesh End
3244 //== MEDCouplingIMesh
3246 class MEDCouplingIMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3249 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3251 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3252 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3253 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3254 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3255 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3256 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3257 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3258 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3259 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3260 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3261 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3266 return MEDCouplingIMesh::New();
3268 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3270 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3271 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3272 const int *nodeStrctPtr(0);
3273 const double *originPtr(0),*dxyzPtr(0);
3275 std::vector<int> bb0;
3276 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3279 std::vector<double> bb,bb2;
3281 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3282 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3284 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3287 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3289 return ParaMEDMEM_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3292 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3295 std::vector<int> bb0;
3296 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3297 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3300 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3302 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3305 DataArrayDoubleTuple *aa;
3306 std::vector<double> bb;
3308 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3309 self->setOrigin(originPtr,originPtr+nbTuples);
3312 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3314 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3317 DataArrayDoubleTuple *aa;
3318 std::vector<double> bb;
3320 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3321 self->setDXYZ(originPtr,originPtr+nbTuples);
3324 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3326 std::vector< std::pair<int,int> > inp;
3327 convertPyToVectorPairInt(fineLocInCoarse,inp);
3328 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3331 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)
3333 std::vector< std::pair<int,int> > inp;
3334 convertPyToVectorPairInt(fineLocInCoarse,inp);
3335 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3338 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3340 std::vector< std::pair<int,int> > inp;
3341 convertPyToVectorPairInt(fineLocInCoarse,inp);
3342 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3345 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)
3347 std::vector< std::pair<int,int> > inp;
3348 convertPyToVectorPairInt(fineLocInCoarse,inp);
3349 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3352 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)
3354 std::vector< std::pair<int,int> > inp;
3355 convertPyToVectorPairInt(fineLocInCoarse,inp);
3356 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3359 std::string __str__() const throw(INTERP_KERNEL::Exception)
3361 return self->simpleRepr();
3363 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3365 std::ostringstream oss;
3366 self->reprQuickOverview(oss);
3372 //== MEDCouplingIMesh End
3376 namespace ParaMEDMEM
3378 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3381 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3382 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3383 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3384 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3385 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3386 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3387 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3388 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3389 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3390 std::string getName() const throw(INTERP_KERNEL::Exception);
3391 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3392 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3393 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3394 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3395 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3396 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3397 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3398 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3399 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3400 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3401 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3402 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3403 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3404 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3405 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3406 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3408 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3410 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3413 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3416 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3418 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3421 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3424 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3426 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3427 return convertIntArrToPyList3(ret);
3430 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3433 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3434 PyObject *ret=PyTuple_New(2);
3435 PyObject *ret0Py=ret0?Py_True:Py_False;
3437 PyTuple_SetItem(ret,0,ret0Py);
3438 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3442 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3444 DataArrayInt *ret1=0;
3445 MEDCouplingMesh *ret0=0;
3447 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3448 if (!SWIG_IsOK(res1))
3451 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3452 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3456 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3458 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3459 da2->checkAllocated();
3460 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3462 PyObject *res = PyList_New(2);
3463 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3464 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3468 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3470 DataArrayInt *ret1=0;
3472 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3473 PyObject *res=PyTuple_New(2);
3474 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3476 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3479 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3480 PyTuple_SetItem(res,1,res1);
3485 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3488 int v0; std::vector<int> v1;
3489 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3490 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3493 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3494 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3497 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3498 if (!SWIG_IsOK(res1))
3501 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3502 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3506 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3508 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3509 da2->checkAllocated();
3510 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3514 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3516 std::vector<int> tmp;
3517 self->getCellIdsHavingGaussLocalization(locId,tmp);
3518 DataArrayInt *ret=DataArrayInt::New();
3519 ret->alloc((int)tmp.size(),1);
3520 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3521 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3524 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3526 std::vector<int> inp0;
3527 convertPyToNewIntArr4(code,1,3,inp0);
3528 std::vector<const DataArrayInt *> inp1;
3529 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3530 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3535 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3538 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3539 static MEDCouplingFieldTemplate *New(TypeOfField type);
3540 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3541 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3544 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3546 return MEDCouplingFieldTemplate::New(f);
3549 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3551 return MEDCouplingFieldTemplate::New(type);
3554 std::string __str__() const throw(INTERP_KERNEL::Exception)
3556 return self->simpleRepr();
3559 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3561 std::ostringstream oss;
3562 self->reprQuickOverview(oss);
3568 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3571 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3572 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3573 void setTimeUnit(const std::string& unit);
3574 std::string getTimeUnit() const;
3575 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3576 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3577 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3578 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3579 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3580 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3581 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3582 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3583 MEDCouplingFieldDouble *deepCpy() const;
3584 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3585 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3586 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3587 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3588 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3589 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3590 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3591 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3592 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3593 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3594 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3595 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3596 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3597 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3598 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3599 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3600 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3601 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3602 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3603 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3604 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3605 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3606 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3607 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3608 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3609 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3610 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3611 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3612 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3613 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3614 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3615 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3616 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3617 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3618 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3619 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3620 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3621 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3622 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3623 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3624 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3625 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3626 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3627 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3628 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3629 void fillFromAnalytic2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3630 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3631 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3632 void applyFunc2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3633 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3634 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3635 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3636 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3637 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3638 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3639 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3640 double getMinValue() const throw(INTERP_KERNEL::Exception);
3641 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3642 double norm2() const throw(INTERP_KERNEL::Exception);
3643 double normMax() const throw(INTERP_KERNEL::Exception);
3644 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3645 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3646 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3647 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3648 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3649 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3650 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3651 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3652 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3653 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3654 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3655 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3656 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3657 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3658 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3659 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3660 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3661 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3662 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3663 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3664 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3665 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3667 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3669 return MEDCouplingFieldDouble::New(type,td);
3672 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3674 return MEDCouplingFieldDouble::New(ft,td);
3677 std::string __str__() const throw(INTERP_KERNEL::Exception)
3679 return self->simpleRepr();
3682 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3684 std::ostringstream oss;
3685 self->reprQuickOverview(oss);
3689 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3691 DataArrayDouble *ret=self->getArray();
3697 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3699 std::vector<DataArrayDouble *> arrs=self->getArrays();
3700 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3704 PyObject *ret=PyTuple_New(sz);
3705 for(int i=0;i<sz;i++)
3708 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3710 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3715 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3717 std::vector<const DataArrayDouble *> tmp;
3718 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3720 std::vector<DataArrayDouble *> arrs(sz);
3721 for(int i=0;i<sz;i++)
3722 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3723 self->setArrays(arrs);
3726 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3728 DataArrayDouble *ret=self->getEndArray();
3734 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3738 DataArrayDoubleTuple *aa;
3739 std::vector<double> bb;
3741 const MEDCouplingMesh *mesh=self->getMesh();
3743 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3744 int spaceDim=mesh->getSpaceDimension();
3745 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3746 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3748 int sz=self->getNumberOfComponents();
3749 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3750 self->getValueOn(spaceLoc,res);
3751 return convertDblArrToPyList(res,sz);
3754 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3756 int sz=self->getNumberOfComponents();
3757 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3758 self->getValueOnPos(i,j,k,res);
3759 return convertDblArrToPyList(res,sz);
3762 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3764 const MEDCouplingMesh *mesh(self->getMesh());
3766 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3769 double v0; ParaMEDMEM::DataArrayDouble *v1(0); ParaMEDMEM::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3770 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3771 mesh->getSpaceDimension(),true,nbPts);
3772 return self->getValueOnMulti(inp,nbPts);
3775 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3779 DataArrayDoubleTuple *aa;
3780 std::vector<double> bb;
3782 const MEDCouplingMesh *mesh=self->getMesh();
3784 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3785 int spaceDim=mesh->getSpaceDimension();
3786 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3787 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3790 int sz=self->getNumberOfComponents();
3791 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3792 self->getValueOn(spaceLoc,time,res);
3793 return convertDblArrToPyList(res,sz);
3796 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3798 if(self->getArray()!=0)
3799 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3802 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3803 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3804 self->setArray(arr);
3808 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3811 double tmp0=self->getTime(tmp1,tmp2);
3812 PyObject *res = PyList_New(3);
3813 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3814 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3815 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3819 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3822 double tmp0=self->getStartTime(tmp1,tmp2);
3823 PyObject *res = PyList_New(3);
3824 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3825 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3826 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3830 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3833 double tmp0=self->getEndTime(tmp1,tmp2);
3834 PyObject *res = PyList_New(3);
3835 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3836 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3837 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3840 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3842 int sz=self->getNumberOfComponents();
3843 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3844 self->accumulate(tmp);
3845 return convertDblArrToPyList(tmp,sz);
3847 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3849 int sz=self->getNumberOfComponents();
3850 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3851 self->integral(isWAbs,tmp);
3852 return convertDblArrToPyList(tmp,sz);
3854 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3856 int sz=self->getNumberOfComponents();
3857 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3858 self->getWeightedAverageValue(tmp,isWAbs);
3859 return convertDblArrToPyList(tmp,sz);
3861 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3863 int sz=self->getNumberOfComponents();
3864 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3866 return convertDblArrToPyList(tmp,sz);
3868 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3870 int sz=self->getNumberOfComponents();
3871 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3873 return convertDblArrToPyList(tmp,sz);
3875 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3877 int szArr,sw,iTypppArr;
3878 std::vector<int> stdvecTyyppArr;
3879 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3880 self->renumberCells(tmp,check);
3883 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3885 int szArr,sw,iTypppArr;
3886 std::vector<int> stdvecTyyppArr;
3887 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3888 self->renumberCellsWithoutMesh(tmp,check);
3891 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3893 int szArr,sw,iTypppArr;
3894 std::vector<int> stdvecTyyppArr;
3895 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3896 self->renumberNodes(tmp,eps);
3899 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3901 int szArr,sw,iTypppArr;
3902 std::vector<int> stdvecTyyppArr;
3903 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3904 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
3907 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3911 std::vector<int> multiVal;
3912 std::pair<int, std::pair<int,int> > slic;
3913 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3914 const MEDCouplingMesh *mesh=self->getMesh();
3916 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3917 int nbc=mesh->getNumberOfCells();
3918 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3925 std::ostringstream oss;
3926 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3927 throw INTERP_KERNEL::Exception(oss.str().c_str());
3930 return self->buildSubPart(&singleVal,&singleVal+1);
3935 int tmp=nbc+singleVal;
3936 return self->buildSubPart(&tmp,&tmp+1);
3940 std::ostringstream oss;
3941 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3942 throw INTERP_KERNEL::Exception(oss.str().c_str());
3948 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3952 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3957 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3958 daIntTyypp->checkAllocated();
3959 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3962 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3966 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3968 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";
3969 if(PyTuple_Check(li))
3971 Py_ssize_t sz=PyTuple_Size(li);
3973 throw INTERP_KERNEL::Exception(msg);
3974 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3977 std::vector<int> multiVal;
3978 std::pair<int, std::pair<int,int> > slic;
3979 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3980 if(!self->getArray())
3981 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3983 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3984 catch(INTERP_KERNEL::Exception& e)
3985 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3986 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3987 DataArrayDouble *ret0Arr=ret0->getArray();
3989 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3994 std::vector<int> v2(1,singleVal);
3995 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
3996 ret0->setArray(aarr);
4001 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4002 ret0->setArray(aarr);
4007 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4008 std::vector<int> v2(nbOfComp);
4009 for(int i=0;i<nbOfComp;i++)
4010 v2[i]=slic.first+i*slic.second.second;
4011 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4012 ret0->setArray(aarr);
4016 throw INTERP_KERNEL::Exception(msg);
4021 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
4024 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4027 double r1=self->getMaxValue2(tmp);
4028 PyObject *ret=PyTuple_New(2);
4029 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4030 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4034 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4037 double r1=self->getMinValue2(tmp);
4038 PyObject *ret=PyTuple_New(2);
4039 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4040 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4044 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4046 std::vector<int> tmp;
4047 convertPyToNewIntArr3(li,tmp);
4048 return self->keepSelectedComponents(tmp);
4051 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4053 std::vector<int> tmp;
4054 convertPyToNewIntArr3(li,tmp);
4055 self->setSelectedComponents(f,tmp);
4058 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4061 DataArrayDouble *a,*a2;
4062 DataArrayDoubleTuple *aa,*aa2;
4063 std::vector<double> bb,bb2;
4066 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4067 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4068 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4069 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4071 return self->extractSlice3D(orig,vect,eps);
4074 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4076 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
4079 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4081 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
4084 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4086 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.";
4087 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4090 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4092 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4094 return (*self)-(*other);
4096 throw INTERP_KERNEL::Exception(msg);
4101 DataArrayDoubleTuple *aa;
4102 std::vector<double> bb;
4104 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4109 if(!self->getArray())
4110 throw INTERP_KERNEL::Exception(msg2);
4111 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4112 ret->applyLin(1.,-val);
4113 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4114 ret2->setArray(ret);
4119 if(!self->getArray())
4120 throw INTERP_KERNEL::Exception(msg2);
4121 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4122 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4123 ret2->setArray(ret);
4128 if(!self->getArray())
4129 throw INTERP_KERNEL::Exception(msg2);
4130 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4131 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4132 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4133 ret2->setArray(ret);
4138 if(!self->getArray())
4139 throw INTERP_KERNEL::Exception(msg2);
4140 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4141 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4142 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4143 ret2->setArray(ret);
4147 { throw INTERP_KERNEL::Exception(msg); }
4151 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4153 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4156 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4158 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
4161 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4163 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4166 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4168 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.";
4169 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4172 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4174 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4176 return (*self)/(*other);
4178 throw INTERP_KERNEL::Exception(msg);
4183 DataArrayDoubleTuple *aa;
4184 std::vector<double> bb;
4186 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4192 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4193 if(!self->getArray())
4194 throw INTERP_KERNEL::Exception(msg2);
4195 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4196 ret->applyLin(1./val,0);
4197 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4198 ret2->setArray(ret);
4203 if(!self->getArray())
4204 throw INTERP_KERNEL::Exception(msg2);
4205 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4206 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4207 ret2->setArray(ret);
4212 if(!self->getArray())
4213 throw INTERP_KERNEL::Exception(msg2);
4214 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4215 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4216 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4217 ret2->setArray(ret);
4222 if(!self->getArray())
4223 throw INTERP_KERNEL::Exception(msg2);
4224 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4225 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4226 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4227 ret2->setArray(ret);
4231 { throw INTERP_KERNEL::Exception(msg); }
4235 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4237 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4240 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4242 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.";
4243 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4246 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4248 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4250 return (*self)^(*other);
4252 throw INTERP_KERNEL::Exception(msg);
4257 DataArrayDoubleTuple *aa;
4258 std::vector<double> bb;
4260 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4265 if(!self->getArray())
4266 throw INTERP_KERNEL::Exception(msg2);
4267 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4269 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4270 ret2->setArray(ret);
4275 if(!self->getArray())
4276 throw INTERP_KERNEL::Exception(msg2);
4277 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4278 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4279 ret2->setArray(ret);
4284 if(!self->getArray())
4285 throw INTERP_KERNEL::Exception(msg2);
4286 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4287 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4288 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4289 ret2->setArray(ret);
4294 if(!self->getArray())
4295 throw INTERP_KERNEL::Exception(msg2);
4296 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4297 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4298 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4299 ret2->setArray(ret);
4303 { throw INTERP_KERNEL::Exception(msg); }
4307 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4309 return self->negate();
4312 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4314 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.";
4315 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4318 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4320 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4324 Py_XINCREF(trueSelf);
4328 throw INTERP_KERNEL::Exception(msg);
4333 DataArrayDoubleTuple *aa;
4334 std::vector<double> bb;
4336 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4341 if(!self->getArray())
4342 throw INTERP_KERNEL::Exception(msg2);
4343 self->getArray()->applyLin(1.,val);
4344 Py_XINCREF(trueSelf);
4349 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4352 Py_XINCREF(trueSelf);
4357 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4358 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4359 ret2->setArray(aaa);
4361 Py_XINCREF(trueSelf);
4366 if(!self->getArray())
4367 throw INTERP_KERNEL::Exception(msg2);
4368 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4369 self->getArray()->addEqual(aaa);
4370 Py_XINCREF(trueSelf);
4374 { throw INTERP_KERNEL::Exception(msg); }
4378 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4380 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.";
4381 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4384 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4386 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4390 Py_XINCREF(trueSelf);
4394 throw INTERP_KERNEL::Exception(msg);
4399 DataArrayDoubleTuple *aa;
4400 std::vector<double> bb;
4402 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4407 if(!self->getArray())
4408 throw INTERP_KERNEL::Exception(msg2);
4409 self->getArray()->applyLin(1.,-val);
4410 Py_XINCREF(trueSelf);
4415 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4418 Py_XINCREF(trueSelf);
4423 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4424 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4425 ret2->setArray(aaa);
4427 Py_XINCREF(trueSelf);
4432 if(!self->getArray())
4433 throw INTERP_KERNEL::Exception(msg2);
4434 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4435 self->getArray()->substractEqual(aaa);
4436 Py_XINCREF(trueSelf);
4440 { throw INTERP_KERNEL::Exception(msg); }
4444 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4446 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.";
4447 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4450 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4452 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4456 Py_XINCREF(trueSelf);
4460 throw INTERP_KERNEL::Exception(msg);
4465 DataArrayDoubleTuple *aa;
4466 std::vector<double> bb;
4468 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4473 if(!self->getArray())
4474 throw INTERP_KERNEL::Exception(msg2);
4475 self->getArray()->applyLin(val,0);
4476 Py_XINCREF(trueSelf);
4481 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4484 Py_XINCREF(trueSelf);
4489 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4490 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4491 ret2->setArray(aaa);
4493 Py_XINCREF(trueSelf);
4498 if(!self->getArray())
4499 throw INTERP_KERNEL::Exception(msg2);
4500 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4501 self->getArray()->multiplyEqual(aaa);
4502 Py_XINCREF(trueSelf);
4506 { throw INTERP_KERNEL::Exception(msg); }
4510 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4512 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.";
4513 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4516 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4518 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4522 Py_XINCREF(trueSelf);
4526 throw INTERP_KERNEL::Exception(msg);
4531 DataArrayDoubleTuple *aa;
4532 std::vector<double> bb;
4534 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4540 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4541 if(!self->getArray())
4542 throw INTERP_KERNEL::Exception(msg2);
4543 self->getArray()->applyLin(1./val,0);
4544 Py_XINCREF(trueSelf);
4549 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4552 Py_XINCREF(trueSelf);
4557 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4558 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4559 ret2->setArray(aaa);
4561 Py_XINCREF(trueSelf);
4566 if(!self->getArray())
4567 throw INTERP_KERNEL::Exception(msg2);
4568 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4569 self->getArray()->divideEqual(aaa);
4570 Py_XINCREF(trueSelf);
4574 { throw INTERP_KERNEL::Exception(msg); }
4578 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4580 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.";
4581 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4584 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4586 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4590 Py_XINCREF(trueSelf);
4594 throw INTERP_KERNEL::Exception(msg);
4599 DataArrayDoubleTuple *aa;
4600 std::vector<double> bb;
4602 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4607 if(!self->getArray())
4608 throw INTERP_KERNEL::Exception(msg2);
4609 self->getArray()->applyPow(val);
4610 Py_XINCREF(trueSelf);
4615 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4618 Py_XINCREF(trueSelf);
4623 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4624 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4625 ret2->setArray(aaa);
4627 Py_XINCREF(trueSelf);
4632 if(!self->getArray())
4633 throw INTERP_KERNEL::Exception(msg2);
4634 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4635 self->getArray()->powEqual(aaa);
4636 Py_XINCREF(trueSelf);
4640 { throw INTERP_KERNEL::Exception(msg); }
4644 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4646 std::vector<const MEDCouplingFieldDouble *> tmp;
4647 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4648 return MEDCouplingFieldDouble::MergeFields(tmp);
4651 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4653 std::vector<const MEDCouplingFieldDouble *> tmp;
4654 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4655 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4660 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4663 int getNumberOfFields() const;
4664 MEDCouplingMultiFields *deepCpy() const;
4665 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4666 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4667 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4668 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4669 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4672 std::string __str__() const throw(INTERP_KERNEL::Exception)
4674 return self->simpleRepr();
4676 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4678 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4679 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4681 std::vector<MEDCouplingFieldDouble *> fs(sz);
4682 for(int i=0;i<sz;i++)
4683 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4684 return MEDCouplingMultiFields::New(fs);
4686 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4688 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4689 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4691 std::vector<MEDCouplingFieldDouble *> fs(sz);
4692 for(int i=0;i<sz;i++)
4693 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4694 return MEDCouplingMultiFields::New(fs);
4696 PyObject *getFields() const
4698 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4699 int sz=fields.size();
4700 PyObject *res = PyList_New(sz);
4701 for(int i=0;i<sz;i++)
4705 fields[i]->incrRef();
4706 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4710 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4715 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4717 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4721 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4724 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4726 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4728 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4730 PyObject *res = PyList_New(sz);
4731 for(int i=0;i<sz;i++)
4736 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4740 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4745 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4747 std::vector<int> refs;
4748 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4750 PyObject *res = PyList_New(sz);
4751 for(int i=0;i<sz;i++)
4756 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4760 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4764 PyObject *ret=PyTuple_New(2);
4765 PyTuple_SetItem(ret,0,res);
4766 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4769 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4771 std::vector<DataArrayDouble *> ms=self->getArrays();
4773 PyObject *res = PyList_New(sz);
4774 for(int i=0;i<sz;i++)
4779 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4783 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4788 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4790 std::vector< std::vector<int> > refs;
4791 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4793 PyObject *res = PyList_New(sz);
4794 PyObject *res2 = PyList_New(sz);
4795 for(int i=0;i<sz;i++)
4800 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4804 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4806 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4809 PyObject *ret=PyTuple_New(2);
4810 PyTuple_SetItem(ret,0,res);
4811 PyTuple_SetItem(ret,1,res2);
4817 class MEDCouplingDefinitionTime
4820 MEDCouplingDefinitionTime();
4821 void assign(const MEDCouplingDefinitionTime& other);
4822 bool isEqual(const MEDCouplingDefinitionTime& other) const;
4823 double getTimeResolution() const;
4824 std::vector<double> getHotSpotsTime() const;
4827 std::string __str__() const throw(INTERP_KERNEL::Exception)
4829 std::ostringstream oss;
4830 self->appendRepr(oss);
4834 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4836 int meshId,arrId,arrIdInField,fieldId;
4837 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4838 PyObject *res=PyList_New(4);
4839 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4840 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4841 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4842 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4846 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4848 int meshId,arrId,arrIdInField,fieldId;
4849 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4850 PyObject *res=PyList_New(4);
4851 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4852 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4853 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4854 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4860 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4863 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4864 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4868 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4870 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4871 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4873 std::vector<MEDCouplingFieldDouble *> fs(sz);
4874 for(int i=0;i<sz;i++)
4875 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4876 return MEDCouplingFieldOverTime::New(fs);
4878 std::string __str__() const throw(INTERP_KERNEL::Exception)
4880 return self->simpleRepr();
4882 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4884 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4885 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4887 std::vector<MEDCouplingFieldDouble *> fs(sz);
4888 for(int i=0;i<sz;i++)
4889 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4890 return MEDCouplingFieldOverTime::New(fs);
4895 class MEDCouplingCartesianAMRMesh;
4897 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
4900 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
4901 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
4902 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
4905 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
4907 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
4915 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
4918 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
4919 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
4920 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
4923 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
4925 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
4926 return convertFromVectorPairInt(ret);
4929 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
4931 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
4932 return convertFromVectorPairInt(ret);
4935 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
4937 std::vector< std::pair<int,int> > inp;
4938 convertPyToVectorPairInt(bottomLeftTopRight,inp);
4939 self->addPatch(inp,factors);
4942 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
4944 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
4946 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
4947 if(patchId==mesh->getNumberOfPatches())
4949 std::ostringstream oss;
4950 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
4951 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
4954 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
4960 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
4962 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
4964 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
4965 mesh->removePatch(patchId);
4968 int __len__() const throw(INTERP_KERNEL::Exception)
4970 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
4972 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
4973 return mesh->getNumberOfPatches();
4978 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
4982 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
4985 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
4986 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
4987 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
4988 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
4989 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
4990 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
4991 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
4992 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
4993 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
4994 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
4995 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
4996 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
4997 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
4999 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5000 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5001 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5002 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5003 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5004 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5005 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5006 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5007 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5008 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5009 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5010 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5011 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5012 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5013 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5014 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5015 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5016 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5017 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5018 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5021 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5023 std::vector< std::pair<int,int> > inp;
5024 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5025 self->addPatch(inp,factors);
5028 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5030 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5032 PyObject *ret = PyList_New(sz);
5033 for(int i=0;i<sz;i++)
5035 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5038 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5043 // agy : don't know why typemap fails here ??? let it in the extend section
5044 PyObject *deepCpy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5046 return convertCartesianAMRMesh(self->deepCpy(father), SWIG_POINTER_OWN | 0 );
5049 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5051 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5052 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5058 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5060 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5061 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5067 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5069 std::vector<int> out1;
5070 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5071 PyObject *ret(PyTuple_New(2));
5072 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5073 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5077 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5079 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5081 PyObject *ret = PyList_New(sz);
5082 for(int i=0;i<sz;i++)
5083 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5087 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5089 std::vector<const DataArrayDouble *> inp;
5090 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",inp);
5091 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5094 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5096 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5102 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5104 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5110 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5112 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5118 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5120 const MEDCouplingIMesh *ret(self->getImageMesh());
5123 return const_cast<MEDCouplingIMesh *>(ret);
5126 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5128 if(patchId==self->getNumberOfPatches())
5130 std::ostringstream oss;
5131 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5132 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5135 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5141 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5143 std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
5144 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5145 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5148 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5150 std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
5151 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5152 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5155 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5157 self->removePatch(patchId);
5160 int __len__() const throw(INTERP_KERNEL::Exception)
5162 return self->getNumberOfPatches();
5167 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5171 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5174 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5177 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5179 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5180 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5181 const int *nodeStrctPtr(0);
5182 const double *originPtr(0),*dxyzPtr(0);
5184 std::vector<int> bb0;
5185 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5188 std::vector<double> bb,bb2;
5190 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5191 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5193 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5196 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5198 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5199 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5200 std::vector< std::vector<int> > inp2;
5201 convertPyToVectorOfVectorOfInt(factors,inp2);
5202 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5205 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5207 return ParaMEDMEM_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5210 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5212 return MEDCouplingCartesianAMRMesh::New(mesh);
5217 class MEDCouplingDataForGodFather : public RefCountObject
5220 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5221 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5222 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5223 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5224 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5225 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5226 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5227 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5228 virtual void alloc() throw(INTERP_KERNEL::Exception);
5229 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5232 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5234 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5242 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5245 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5246 MEDCouplingAMRAttribute *deepCpy() const throw(INTERP_KERNEL::Exception);
5247 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5248 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5249 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5250 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5251 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5252 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5253 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5256 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5258 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5259 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5260 MEDCouplingAMRAttribute *ret(0);
5263 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5264 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5266 catch(INTERP_KERNEL::Exception&)
5268 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5269 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5274 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5276 return ParaMEDMEM_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5279 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5281 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5282 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5288 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5290 std::vector< std::vector<std::string> > compNamesCpp;
5291 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5292 self->spillInfoOnComponents(compNamesCpp);
5295 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5297 std::vector<int> inp0;
5298 if(!fillIntVector(nfs,inp0))
5299 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5300 std::size_t sz(inp0.size());
5301 std::vector<NatureOfField> inp00(sz);
5302 for(std::size_t i=0;i<sz;i++)
5303 inp00[i]=(NatureOfField)inp0[i];
5304 self->spillNatures(inp00);
5307 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5309 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5310 int sz((int)ret.size());
5311 PyObject *retPy(PyList_New(sz));
5312 for(int i=0;i<sz;i++)
5313 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5319 class DenseMatrix : public RefCountObject, public TimeLabel
5322 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5323 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5324 DenseMatrix *deepCpy() const throw(INTERP_KERNEL::Exception);
5325 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5327 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5328 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5329 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5330 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5331 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5332 void transpose() throw(INTERP_KERNEL::Exception);
5334 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5335 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5336 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5339 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5341 return DenseMatrix::New(nbRows,nbCols);
5344 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5346 return DenseMatrix::New(array,nbRows,nbCols);
5349 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5352 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5353 PyObject *ret=PyTuple_New(2);
5354 PyObject *ret0Py=ret0?Py_True:Py_False;
5356 PyTuple_SetItem(ret,0,ret0Py);
5357 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5361 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5363 DataArrayDouble *ret(self->getData());
5369 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5371 return ParaMEDMEM::DenseMatrix::Add(self,other);
5374 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5376 return ParaMEDMEM::DenseMatrix::Substract(self,other);
5379 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5381 return ParaMEDMEM::DenseMatrix::Multiply(self,other);
5384 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5386 return ParaMEDMEM::DenseMatrix::Multiply(self,other);
5389 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5391 self->addEqual(other);
5392 Py_XINCREF(trueSelf);
5396 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5398 self->substractEqual(other);
5399 Py_XINCREF(trueSelf);
5403 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5405 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5412 class PartDefinition : public RefCountObject, public TimeLabel
5415 static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5416 static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5417 virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
5418 virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
5419 virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
5422 virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
5424 return (*self)+other;
5428 virtual ~PartDefinition();
5431 class DataArrayPartDefinition : public PartDefinition
5434 static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5437 DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
5439 return DataArrayPartDefinition::New(listOfIds);
5442 std::string __str__() const throw(INTERP_KERNEL::Exception)
5444 return self->getRepr();
5447 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5449 std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
5450 oss << self->getRepr();
5455 virtual ~DataArrayPartDefinition();
5458 class SlicePartDefinition : public PartDefinition
5461 static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5462 int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
5465 SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
5467 return SlicePartDefinition::New(start,stop,step);
5470 PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
5473 self->getSlice(a,b,c);
5474 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
5477 std::string __str__() const throw(INTERP_KERNEL::Exception)
5479 return self->getRepr();
5482 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5484 std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
5485 oss << self->getRepr();
5490 virtual ~SlicePartDefinition();
5496 __filename=os.environ.get('PYTHONSTARTUP')
5497 if __filename and os.path.isfile(__filename):
5498 execfile(__filename)