1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
27 #include "MEDCouplingMemArray.hxx"
28 #include "MEDCouplingUMesh.hxx"
29 #include "MEDCouplingExtrudedMesh.hxx"
30 #include "MEDCouplingCMesh.hxx"
31 #include "MEDCouplingIMesh.hxx"
32 #include "MEDCouplingCurveLinearMesh.hxx"
33 #include "MEDCoupling1GTUMesh.hxx"
34 #include "MEDCouplingField.hxx"
35 #include "MEDCouplingFieldDouble.hxx"
36 #include "MEDCouplingFieldTemplate.hxx"
37 #include "MEDCouplingGaussLocalization.hxx"
38 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
39 #include "MEDCouplingMultiFields.hxx"
40 #include "MEDCouplingFieldOverTime.hxx"
41 #include "MEDCouplingDefinitionTime.hxx"
42 #include "MEDCouplingFieldDiscretization.hxx"
43 #include "MEDCouplingCartesianAMRMesh.hxx"
44 #include "MEDCouplingAMRAttribute.hxx"
45 #include "MEDCouplingMatrix.hxx"
46 #include "MEDCouplingPartDefinition.hxx"
47 #include "MEDCouplingTypemaps.i"
49 #include "InterpKernelAutoPtr.hxx"
50 #include "BoxSplittingOptions.hxx"
52 using namespace ParaMEDMEM;
53 using namespace INTERP_KERNEL;
57 %template(ivec) std::vector<int>;
58 %template(dvec) std::vector<double>;
59 %template(svec) std::vector<std::string>;
62 %typemap(out) ParaMEDMEM::MEDCouplingMesh*
64 $result=convertMesh($1,$owner);
67 %typemap(out) MEDCouplingMesh*
69 $result=convertMesh($1,$owner);
74 %typemap(out) ParaMEDMEM::MEDCouplingPointSet*
76 $result=convertMesh($1,$owner);
79 %typemap(out) MEDCouplingPointSet*
81 $result=convertMesh($1,$owner);
86 %typemap(out) MEDCouplingCartesianAMRPatchGen*
88 $result=convertCartesianAMRPatch($1,$owner);
93 %typemap(out) MEDCouplingCartesianAMRMeshGen*
95 $result=convertCartesianAMRMesh($1,$owner);
100 %typemap(out) MEDCouplingDataForGodFather*
102 $result=convertDataForGodFather($1,$owner);
107 %typemap(out) ParaMEDMEM::MEDCoupling1GTUMesh*
109 $result=convertMesh($1,$owner);
112 %typemap(out) MEDCoupling1GTUMesh*
114 $result=convertMesh($1,$owner);
119 %typemap(out) ParaMEDMEM::MEDCouplingStructuredMesh*
121 $result=convertMesh($1,$owner);
124 %typemap(out) MEDCouplingStructuredMesh*
126 $result=convertMesh($1,$owner);
131 %typemap(out) ParaMEDMEM::MEDCouplingFieldDiscretization*
133 $result=convertFieldDiscretization($1,$owner);
136 %typemap(out) MEDCouplingFieldDiscretization*
138 $result=convertFieldDiscretization($1,$owner);
143 %typemap(out) ParaMEDMEM::MEDCouplingMultiFields*
145 $result=convertMultiFields($1,$owner);
148 %typemap(out) MEDCouplingMultiFields*
150 $result=convertMultiFields($1,$owner);
155 %typemap(out) ParaMEDMEM::PartDefinition*
157 $result=convertPartDefinition($1,$owner);
160 %typemap(out) PartDefinition*
162 $result=convertPartDefinition($1,$owner);
167 %init %{ import_array(); %}
170 %feature("autodoc", "1");
171 %feature("docstring");
173 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
174 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
175 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
176 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
177 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
178 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
179 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
180 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
181 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
182 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
183 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
184 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
185 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
186 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
187 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
188 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
189 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
190 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
191 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
192 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
193 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
194 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
195 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
196 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
197 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
198 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
199 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
200 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
201 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
202 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
203 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
204 %newobject ParaMEDMEM::MEDCouplingFieldDouble::negate;
205 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
206 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
207 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPartRange;
208 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
209 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__neg__;
210 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__add__;
211 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__sub__;
212 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__mul__;
213 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__div__;
214 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__pow__;
215 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__radd__;
216 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rsub__;
217 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rmul__;
218 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rdiv__;
219 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
220 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
221 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
222 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
223 %newobject ParaMEDMEM::MEDCouplingFieldDouble::nodeToCellDiscretization;
224 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cellToNodeDiscretization;
225 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
226 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
227 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
228 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
229 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
230 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
231 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfFacesPerCell;
232 %newobject ParaMEDMEM::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
233 %newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
234 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
235 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
236 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
237 %newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
238 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
239 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
240 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
241 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
242 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
243 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
244 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
245 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
246 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
247 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
248 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
249 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
250 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
251 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
252 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
253 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
254 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
255 %newobject ParaMEDMEM::MEDCouplingPointSet::zipConnectivityTraducer;
256 %newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
257 %newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
258 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
259 %newobject ParaMEDMEM::MEDCouplingPointSet::deepCpyConnectivityOnly;
260 %newobject ParaMEDMEM::MEDCouplingPointSet::getBoundingBoxForBBTree;
261 %newobject ParaMEDMEM::MEDCouplingPointSet::computeFetchedNodeIds;
262 %newobject ParaMEDMEM::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
263 %newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
264 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
265 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
266 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
267 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
268 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
269 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
270 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
271 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
272 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
273 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
274 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
275 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
276 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
277 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
278 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
279 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
280 %newobject ParaMEDMEM::MEDCouplingUMesh::conformize2D;
281 %newobject ParaMEDMEM::MEDCouplingUMesh::colinearize2D;
282 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
283 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
284 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
285 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
286 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
287 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
288 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
289 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
290 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
291 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
292 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
293 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
294 %newobject ParaMEDMEM::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
295 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
296 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
297 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
298 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
299 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
300 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
301 %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
302 %newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
303 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
304 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
305 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
306 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
307 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
308 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
309 %newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf2DMesh;
310 %newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf3DMesh;
311 %newobject ParaMEDMEM::MEDCouplingUMesh::orderConsecutiveCells1D;
312 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
313 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
314 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
315 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
316 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
317 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
318 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::getNodalConnectivity;
319 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
320 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::New;
321 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
322 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::computeDualMesh;
323 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
324 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::sortHexa8EachOther;
325 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
326 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
327 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::New;
328 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
329 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
330 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
331 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
332 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
333 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
334 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::buildStructuredSubPart;
335 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTUnstructured;
336 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
337 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
338 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
339 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
340 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
341 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::ComputeCornersGhost;
342 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
343 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
344 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
345 %newobject ParaMEDMEM::MEDCouplingIMesh::New;
346 %newobject ParaMEDMEM::MEDCouplingIMesh::asSingleCell;
347 %newobject ParaMEDMEM::MEDCouplingIMesh::buildWithGhost;
348 %newobject ParaMEDMEM::MEDCouplingIMesh::convertToCartesian;
349 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
350 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
351 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
352 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
353 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
354 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
355 %newobject ParaMEDMEM::MEDCouplingCartesianAMRPatchGen::getMesh;
356 %newobject ParaMEDMEM::MEDCouplingCartesianAMRPatchGen::__getitem__;
357 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::deepCpy;
358 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
359 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
360 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
361 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
362 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getImageMesh;
363 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getGodFather;
364 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getFather;
365 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getPatch;
366 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
367 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
368 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
369 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
370 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::__getitem__;
371 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::New;
372 %newobject ParaMEDMEM::MEDCouplingDataForGodFather::getMyGodFather;
373 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::New;
374 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::deepCpy;
375 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
376 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::getFieldOn;
377 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::projectTo;
378 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
379 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
380 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
381 %newobject ParaMEDMEM::DenseMatrix::New;
382 %newobject ParaMEDMEM::DenseMatrix::deepCpy;
383 %newobject ParaMEDMEM::DenseMatrix::shallowCpy;
384 %newobject ParaMEDMEM::DenseMatrix::getData;
385 %newobject ParaMEDMEM::DenseMatrix::matVecMult;
386 %newobject ParaMEDMEM::DenseMatrix::MatVecMult;
387 %newobject ParaMEDMEM::DenseMatrix::__add__;
388 %newobject ParaMEDMEM::DenseMatrix::__sub__;
389 %newobject ParaMEDMEM::DenseMatrix::__mul__;
390 %newobject ParaMEDMEM::PartDefinition::New;
391 %newobject ParaMEDMEM::PartDefinition::toDAI;
392 %newobject ParaMEDMEM::PartDefinition::__add__;
393 %newobject ParaMEDMEM::PartDefinition::composeWith;
394 %newobject ParaMEDMEM::PartDefinition::tryToSimplify;
395 %newobject ParaMEDMEM::DataArrayPartDefinition::New;
396 %newobject ParaMEDMEM::SlicePartDefinition::New;
398 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
399 %feature("unref") MEDCouplingMesh "$this->decrRef();"
400 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
401 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
402 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
403 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
404 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
405 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
406 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
407 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
408 %feature("unref") MEDCouplingField "$this->decrRef();"
409 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
410 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
411 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
412 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
413 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
414 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
415 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
416 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
417 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
418 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
419 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
420 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
421 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
422 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
423 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
424 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
425 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
426 %feature("unref") DenseMatrix "$this->decrRef();"
427 %feature("unref") PartDefinition "$this->decrRef();"
428 %feature("unref") DataArrayPartDefinition "$this->decrRef();"
429 %feature("unref") SlicePartDefinition "$this->decrRef();"
431 %rename(assign) *::operator=;
432 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
433 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
434 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
435 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
439 %rename (InterpKernelException) INTERP_KERNEL::Exception;
441 %include "MEDCouplingRefCountObject.i"
442 %include "MEDCouplingMemArray.i"
444 namespace INTERP_KERNEL
447 * \class BoxSplittingOptions
448 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
450 class BoxSplittingOptions
453 BoxSplittingOptions();
454 void init() throw(INTERP_KERNEL::Exception);
455 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
456 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
457 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
458 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
459 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
460 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
461 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
462 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
463 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
464 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
465 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
466 std::string printOptions() const throw(INTERP_KERNEL::Exception);
469 std::string __str__() const throw(INTERP_KERNEL::Exception)
471 return self->printOptions();
493 CONST_ON_TIME_INTERVAL = 7
494 } TypeOfTimeDiscretization;
502 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
503 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
505 } MEDCouplingMeshType;
508 class DataArrayDouble;
509 class MEDCouplingUMesh;
510 class MEDCouplingFieldDouble;
512 %extend RefCountObject
514 std::string getHiddenCppPointer() const
516 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
521 %extend MEDCouplingGaussLocalization
523 std::string __str__() const throw(INTERP_KERNEL::Exception)
525 return self->getStringRepr();
528 std::string __repr__() const throw(INTERP_KERNEL::Exception)
530 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
531 oss << self->getStringRepr();
538 class MEDCouplingMesh : public RefCountObject, public TimeLabel
541 void setName(const std::string& name);
542 std::string getName() const;
543 void setDescription(const std::string& descr);
544 std::string getDescription() const;
545 void setTime(double val, int iteration, int order);
546 void setTimeUnit(const std::string& unit);
547 std::string getTimeUnit() const;
548 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
549 bool isStructured() const throw(INTERP_KERNEL::Exception);
550 virtual MEDCouplingMesh *deepCpy() const;
551 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
552 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
553 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
554 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
555 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
556 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
557 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
558 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
559 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
560 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
561 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
562 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
563 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
564 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
565 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
566 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
567 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
568 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
569 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
570 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
571 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
572 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
573 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
574 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
575 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
576 virtual std::string getVTKFileExtension() const;
577 std::string getVTKFileNameOf(const std::string& fileName) const;
579 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
580 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
581 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
582 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
583 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
584 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
585 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
586 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
587 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
588 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
589 virtual void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings) throw(INTERP_KERNEL::Exception);
590 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
591 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
592 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
593 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
594 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
595 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
596 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
599 std::string __str__() const throw(INTERP_KERNEL::Exception)
601 return self->simpleRepr();
604 PyObject *getTime() throw(INTERP_KERNEL::Exception)
607 double tmp0=self->getTime(tmp1,tmp2);
608 PyObject *res = PyList_New(3);
609 PyList_SetItem(res,0,SWIG_From_double(tmp0));
610 PyList_SetItem(res,1,SWIG_From_int(tmp1));
611 PyList_SetItem(res,2,SWIG_From_int(tmp2));
615 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
619 DataArrayDoubleTuple *aa;
620 std::vector<double> bb;
622 int spaceDim=self->getSpaceDimension();
623 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
624 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
625 return self->getCellContainingPoint(pos,eps);
628 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
632 DataArrayDoubleTuple *aa;
633 std::vector<double> bb;
635 int spaceDim=self->getSpaceDimension();
636 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
637 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
638 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
639 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
640 PyObject *ret=PyTuple_New(2);
641 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
642 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
646 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
648 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
649 int spaceDim=self->getSpaceDimension();
651 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
652 if (!SWIG_IsOK(res1))
655 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
656 int nbOfPoints=size/spaceDim;
659 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
661 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
665 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
667 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
668 da2->checkAllocated();
669 int size=da2->getNumberOfTuples();
670 int nbOfCompo=da2->getNumberOfComponents();
671 if(nbOfCompo!=spaceDim)
673 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
675 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
677 PyObject *ret=PyTuple_New(2);
678 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
679 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
683 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
687 DataArrayDoubleTuple *aa;
688 std::vector<double> bb;
690 int spaceDim=self->getSpaceDimension();
691 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
692 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
693 std::vector<int> elts;
694 self->getCellsContainingPoint(pos,eps,elts);
695 DataArrayInt *ret=DataArrayInt::New();
696 ret->alloc((int)elts.size(),1);
697 std::copy(elts.begin(),elts.end(),ret->getPointer());
698 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
701 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
703 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
704 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
705 self->getReverseNodalConnectivity(d0,d1);
706 PyObject *ret=PyTuple_New(2);
707 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
708 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
712 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
715 int v0; std::vector<int> v1;
716 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
717 self->renumberCells(ids,check);
720 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
722 DataArrayInt *cellCor, *nodeCor;
723 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
724 PyObject *res = PyList_New(2);
725 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
726 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
730 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
732 DataArrayInt *cellCor=0,*nodeCor=0;
733 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
734 PyObject *res = PyList_New(2);
735 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
736 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
740 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
742 DataArrayInt *cellCor=0;
743 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
747 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
750 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
751 if (!SWIG_IsOK(res1))
754 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
755 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
759 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
761 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
762 da2->checkAllocated();
763 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
766 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
768 std::vector<int> conn;
769 self->getNodeIdsOfCell(cellId,conn);
770 return convertIntArrToPyList2(conn);
773 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
775 std::vector<double> coo;
776 self->getCoordinatesOfNode(nodeId,coo);
777 return convertDblArrToPyList2(coo);
780 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
784 DataArrayDoubleTuple *aa;
785 std::vector<double> bb;
787 int spaceDim=self->getSpaceDimension();
788 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
789 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
790 self->scale(pointPtr,factor);
793 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
795 int spaceDim=self->getSpaceDimension();
796 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
797 self->getBoundingBox(tmp);
798 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
802 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
805 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
806 PyObject *ret=PyTuple_New(2);
807 PyObject *ret0Py=ret0?Py_True:Py_False;
809 PyTuple_SetItem(ret,0,ret0Py);
810 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
814 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
816 int szArr,sw,iTypppArr;
817 std::vector<int> stdvecTyyppArr;
818 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
819 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
820 if(sw==3)//DataArrayInt
822 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
823 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
824 std::string name=argpt->getName();
826 ret->setName(name.c_str());
828 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
831 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
833 int szArr,sw,iTypppArr;
834 std::vector<int> stdvecTyyppArr;
836 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
837 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
838 if(sw==3)//DataArrayInt
840 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
841 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
842 std::string name=argpt->getName();
844 ret->setName(name.c_str());
847 PyObject *res = PyList_New(2);
848 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
849 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
850 PyList_SetItem(res,0,obj0);
851 PyList_SetItem(res,1,obj1);
855 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
859 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
860 PyObject *res = PyTuple_New(2);
861 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
864 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
866 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
867 PyTuple_SetItem(res,0,obj0);
868 PyTuple_SetItem(res,1,obj1);
872 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
874 std::vector<int> vals=self->getDistributionOfTypes();
876 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
877 PyObject *ret=PyList_New((int)vals.size()/3);
878 for(int j=0;j<(int)vals.size()/3;j++)
880 PyObject *ret1=PyList_New(3);
881 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
882 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
883 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
884 PyList_SetItem(ret,j,ret1);
889 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
891 std::vector<int> code;
892 std::vector<const DataArrayInt *> idsPerType;
893 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
894 convertPyToNewIntArr4(li,1,3,code);
895 return self->checkTypeConsistencyAndContig(code,idsPerType);
898 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
900 std::vector<int> code;
901 std::vector<DataArrayInt *> idsInPflPerType;
902 std::vector<DataArrayInt *> idsPerType;
903 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
904 PyObject *ret=PyTuple_New(3);
907 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
908 PyObject *ret0=PyList_New((int)code.size()/3);
909 for(int j=0;j<(int)code.size()/3;j++)
911 PyObject *ret00=PyList_New(3);
912 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
913 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
914 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
915 PyList_SetItem(ret0,j,ret00);
917 PyTuple_SetItem(ret,0,ret0);
919 PyObject *ret1=PyList_New(idsInPflPerType.size());
920 for(std::size_t j=0;j<idsInPflPerType.size();j++)
921 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
922 PyTuple_SetItem(ret,1,ret1);
923 int n=idsPerType.size();
924 PyObject *ret2=PyList_New(n);
926 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
927 PyTuple_SetItem(ret,2,ret2);
931 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
935 DataArrayDoubleTuple *aa;
936 std::vector<double> bb;
938 int spaceDim=self->getSpaceDimension();
939 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
940 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
941 self->translate(vectorPtr);
944 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
946 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
949 DataArrayDoubleTuple *aa;
950 std::vector<double> bb;
952 int spaceDim=self->getSpaceDimension();
953 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
954 self->rotate(centerPtr,0,alpha);
957 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
959 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
961 DataArrayDouble *a,*a2;
962 DataArrayDoubleTuple *aa,*aa2;
963 std::vector<double> bb,bb2;
965 int spaceDim=self->getSpaceDimension();
966 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
967 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
968 self->rotate(centerPtr,vectorPtr,alpha);
971 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
973 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
974 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
975 PyObject *res=PyList_New(result.size());
976 for(int i=0;iL!=result.end(); i++, iL++)
977 PyList_SetItem(res,i,PyInt_FromLong(*iL));
981 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
983 std::vector<double> a0;
985 std::vector<std::string> a2;
986 self->getTinySerializationInformation(a0,a1,a2);
987 PyObject *ret(PyTuple_New(3));
988 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
989 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
991 PyObject *ret2(PyList_New(sz));
993 for(int i=0;i<sz;i++)
994 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
996 PyTuple_SetItem(ret,2,ret2);
1000 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1002 DataArrayInt *a0Tmp(0);
1003 DataArrayDouble *a1Tmp(0);
1004 self->serialize(a0Tmp,a1Tmp);
1005 PyObject *ret(PyTuple_New(2));
1006 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1007 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1011 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1013 std::vector<std::string> littleStrings;
1014 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1017 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1018 {// put an empty dict in input to say to __new__ to call __init__...
1019 PyObject *ret(PyTuple_New(1));
1020 PyObject *ret0(PyDict_New());
1021 PyTuple_SetItem(ret,0,ret0);
1025 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1027 PyObject *ret0(ParaMEDMEM_MEDCouplingMesh_getTinySerializationInformation(self));
1028 PyObject *ret1(ParaMEDMEM_MEDCouplingMesh_serialize(self));
1029 PyObject *ret(PyTuple_New(2));
1030 PyTuple_SetItem(ret,0,ret0);
1031 PyTuple_SetItem(ret,1,ret1);
1035 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1037 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1038 if(!PyTuple_Check(inp))
1039 throw INTERP_KERNEL::Exception(MSG);
1040 int sz(PyTuple_Size(inp));
1042 throw INTERP_KERNEL::Exception(MSG);
1043 PyObject *elt0(PyTuple_GetItem(inp,0));
1044 PyObject *elt1(PyTuple_GetItem(inp,1));
1045 std::vector<double> a0;
1046 std::vector<int> a1;
1047 std::vector<std::string> a2;
1048 DataArrayInt *b0(0);
1049 DataArrayDouble *b1(0);
1051 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1052 throw INTERP_KERNEL::Exception(MSG);
1053 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1055 fillArrayWithPyListDbl3(a0py,tmp,a0);
1056 convertPyToNewIntArr3(a1py,a1);
1057 fillStringVector(a2py,a2);
1060 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1061 throw INTERP_KERNEL::Exception(MSG);
1062 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1064 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0));
1065 if(!SWIG_IsOK(status))
1066 throw INTERP_KERNEL::Exception(MSG);
1067 b0=reinterpret_cast<DataArrayInt *>(argp);
1068 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0);
1069 if(!SWIG_IsOK(status))
1070 throw INTERP_KERNEL::Exception(MSG);
1071 b1=reinterpret_cast<DataArrayDouble *>(argp);
1073 // useless here to call resizeForUnserialization because arrays are well resized.
1074 self->unserialization(a0,a1,b0,b1,a2);
1077 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1079 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
1080 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1081 return MEDCouplingMesh::MergeMeshes(tmp);
1087 //== MEDCouplingMesh End
1089 %include "NormalizedGeometricTypes"
1090 %include "MEDCouplingNatureOfFieldEnum"
1092 namespace ParaMEDMEM
1094 class MEDCouplingNatureOfField
1097 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1098 static std::string GetReprNoThrow(NatureOfField nat);
1099 static std::string GetAllPossibilitiesStr();
1103 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1104 // include "MEDCouplingTimeDiscretization.i"
1106 namespace ParaMEDMEM
1108 class MEDCouplingGaussLocalization
1111 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1112 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1113 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1114 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1115 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1116 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1117 int getDimension() const throw(INTERP_KERNEL::Exception);
1118 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1119 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1120 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1121 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1123 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1124 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1125 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1126 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1127 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1128 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1129 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1130 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1131 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1132 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1133 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1134 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1136 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1140 %include "MEDCouplingFieldDiscretization.i"
1142 //== MEDCouplingPointSet
1144 namespace ParaMEDMEM
1146 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
1149 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1150 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1151 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1152 void zipCoords() throw(INTERP_KERNEL::Exception);
1153 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1154 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1155 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1156 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1157 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1158 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1159 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1160 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1161 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1162 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1163 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1164 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1165 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1166 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1167 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1168 virtual DataArrayInt *findBoundaryNodes() const;
1169 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1170 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1171 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1172 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1173 virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1174 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1175 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1178 std::string __str__() const throw(INTERP_KERNEL::Exception)
1180 return self->simpleRepr();
1183 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1186 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1187 PyObject *res = PyList_New(2);
1188 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1189 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1193 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1195 DataArrayInt *comm, *commIndex;
1196 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1197 PyObject *res = PyList_New(2);
1198 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1199 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1203 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1205 DataArrayDouble *ret1=self->getCoords();
1208 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1211 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1213 int szArr,sw,iTypppArr;
1214 std::vector<int> stdvecTyyppArr;
1215 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1216 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1217 if(sw==3)//DataArrayInt
1219 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1220 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1221 std::string name=argpt->getName();
1223 ret->setName(name.c_str());
1225 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1228 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1230 int szArr,sw,iTypppArr;
1231 std::vector<int> stdvecTyyppArr;
1232 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1233 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1234 if(sw==3)//DataArrayInt
1236 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1237 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1238 std::string name=argpt->getName();
1240 ret->setName(name.c_str());
1242 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1245 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1247 int szArr,sw,iTypppArr;
1248 std::vector<int> stdvecTyyppArr;
1249 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1250 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1251 if(sw==3)//DataArrayInt
1253 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1254 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1255 std::string name=argpt->getName();
1257 ret->setName(name.c_str());
1259 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1262 virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1264 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1265 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1268 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1270 int szArr,sw,iTypppArr;
1271 std::vector<int> stdvecTyyppArr;
1272 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1273 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1274 if(sw==3)//DataArrayInt
1276 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1277 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1278 std::string name=argpt->getName();
1280 ret->setName(name.c_str());
1282 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1285 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1287 int szArr,sw,iTypppArr;
1288 std::vector<int> stdvecTyyppArr;
1289 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1290 self->renumberNodes(tmp,newNbOfNodes);
1293 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1295 int szArr,sw,iTypppArr;
1296 std::vector<int> stdvecTyyppArr;
1297 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1298 self->renumberNodes2(tmp,newNbOfNodes);
1301 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1303 int spaceDim=self->getSpaceDimension();
1305 DataArrayDouble *a,*a2;
1306 DataArrayDoubleTuple *aa,*aa2;
1307 std::vector<double> bb,bb2;
1309 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1310 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1311 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1312 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1313 std::vector<int> nodes;
1314 self->findNodesOnLine(p,v,eps,nodes);
1315 DataArrayInt *ret=DataArrayInt::New();
1316 ret->alloc((int)nodes.size(),1);
1317 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1318 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1320 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1322 int spaceDim=self->getSpaceDimension();
1324 DataArrayDouble *a,*a2;
1325 DataArrayDoubleTuple *aa,*aa2;
1326 std::vector<double> bb,bb2;
1328 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1329 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1330 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1331 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1332 std::vector<int> nodes;
1333 self->findNodesOnPlane(p,v,eps,nodes);
1334 DataArrayInt *ret=DataArrayInt::New();
1335 ret->alloc((int)nodes.size(),1);
1336 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1337 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1340 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1344 DataArrayDoubleTuple *aa;
1345 std::vector<double> bb;
1347 int spaceDim=self->getSpaceDimension();
1348 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1349 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1350 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1351 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1354 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1356 DataArrayInt *c=0,*cI=0;
1360 DataArrayDoubleTuple *aa;
1361 std::vector<double> bb;
1363 int spaceDim=self->getSpaceDimension();
1364 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1365 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1366 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1367 PyObject *ret=PyTuple_New(2);
1368 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1369 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1373 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1375 DataArrayInt *c=0,*cI=0;
1376 int spaceDim=self->getSpaceDimension();
1379 DataArrayDoubleTuple *aa;
1380 std::vector<double> bb;
1383 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1384 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1386 PyObject *ret=PyTuple_New(2);
1387 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1388 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1392 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1396 DataArrayDoubleTuple *aa;
1397 std::vector<double> bb;
1399 int spaceDim=self->getSpaceDimension();
1400 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1401 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1403 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1404 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1407 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1411 std::vector<int> multiVal;
1412 std::pair<int, std::pair<int,int> > slic;
1413 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1414 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1418 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1420 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1422 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1424 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1428 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1430 DataArrayInt *v0=0,*v1=0;
1431 self->findCommonCells(compType,startCellId,v0,v1);
1432 PyObject *res = PyList_New(2);
1433 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1434 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1439 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1442 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1443 if (!SWIG_IsOK(res1))
1446 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1447 self->renumberNodesInConn(tmp);
1451 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1453 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1454 da2->checkAllocated();
1455 self->renumberNodesInConn(da2->getConstPointer());
1459 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1462 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1463 PyObject *ret=PyTuple_New(2);
1464 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1465 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1469 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1471 DataArrayInt *ret=0;
1473 int szArr,sw,iTypppArr;
1474 std::vector<int> stdvecTyyppArr;
1475 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1476 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1480 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1484 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1485 PyObject *res = PyList_New(3);
1486 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1487 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1488 PyList_SetItem(res,2,SWIG_From_int(ret2));
1492 virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1496 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1497 PyObject *res = PyList_New(3);
1498 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1499 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1500 PyList_SetItem(res,2,SWIG_From_int(ret2));
1504 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1507 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1508 if (!SWIG_IsOK(res1))
1511 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1512 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1516 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1518 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1519 da2->checkAllocated();
1520 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1524 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1528 std::vector<int> multiVal;
1529 std::pair<int, std::pair<int,int> > slic;
1530 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1531 int nbc=self->getNumberOfCells();
1532 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1539 std::ostringstream oss;
1540 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1541 throw INTERP_KERNEL::Exception(oss.str().c_str());
1544 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1549 int tmp=nbc+singleVal;
1550 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1554 std::ostringstream oss;
1555 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1556 throw INTERP_KERNEL::Exception(oss.str().c_str());
1562 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1566 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1571 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1572 daIntTyypp->checkAllocated();
1573 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1576 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1580 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1583 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1584 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1585 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1586 for(int i=0;i<sz;i++)
1587 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1590 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1593 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1595 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1596 std::vector<double> val3;
1597 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1598 "Rotate2DAlg",2,true,nbNodes);
1600 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1601 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1604 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1607 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1608 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1609 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1610 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1611 for(int i=0;i<sz;i++)
1612 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1615 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1618 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1620 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1621 std::vector<double> val3;
1622 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1623 "Rotate3DAlg",3,true,nbNodes);
1625 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1626 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1627 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1632 //== MEDCouplingPointSet End
1634 class MEDCouplingUMeshCell
1637 INTERP_KERNEL::NormalizedCellType getType() const;
1640 std::string __str__() const throw(INTERP_KERNEL::Exception)
1642 return self->repr();
1645 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1648 const int *r=self->getAllConn(ret2);
1649 PyObject *ret=PyTuple_New(ret2);
1650 for(int i=0;i<ret2;i++)
1651 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1657 class MEDCouplingUMeshCellIterator
1664 MEDCouplingUMeshCell *ret=self->nextt();
1666 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1669 PyErr_SetString(PyExc_StopIteration,"No more data.");
1676 class MEDCouplingUMeshCellByTypeIterator
1679 ~MEDCouplingUMeshCellByTypeIterator();
1684 MEDCouplingUMeshCellEntry *ret=self->nextt();
1686 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1689 PyErr_SetString(PyExc_StopIteration,"No more data.");
1696 class MEDCouplingUMeshCellByTypeEntry
1699 ~MEDCouplingUMeshCellByTypeEntry();
1702 MEDCouplingUMeshCellByTypeIterator *__iter__()
1704 return self->iterator();
1709 class MEDCouplingUMeshCellEntry
1712 INTERP_KERNEL::NormalizedCellType getType() const;
1713 int getNumberOfElems() const;
1716 MEDCouplingUMeshCellIterator *__iter__()
1718 return self->iterator();
1723 //== MEDCouplingUMesh
1725 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1728 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1729 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1730 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1731 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1732 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1733 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1734 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1735 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1736 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1737 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1738 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1739 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1740 void computeTypes() throw(INTERP_KERNEL::Exception);
1741 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1742 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1744 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1745 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1746 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1747 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1748 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1749 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1750 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1751 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1752 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1753 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1754 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1755 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1756 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1757 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1758 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1759 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1760 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1761 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1762 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1763 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1764 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1765 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1766 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1767 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1768 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1769 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1770 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1771 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1772 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1773 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1774 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1775 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1776 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1777 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1778 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1779 ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1780 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1781 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1782 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1783 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1784 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1785 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1786 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1787 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1788 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);
1789 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1790 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1791 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1792 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1793 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1795 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1797 return MEDCouplingUMesh::New();
1800 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1802 return MEDCouplingUMesh::New(meshName,meshDim);
1806 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1808 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1811 std::string __str__() const throw(INTERP_KERNEL::Exception)
1813 return self->simpleRepr();
1816 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1818 std::ostringstream oss;
1819 self->reprQuickOverview(oss);
1823 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1825 return self->cellIterator();
1828 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1830 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1831 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1832 PyObject *res=PyList_New(result.size());
1833 for(int i=0;iL!=result.end(); i++, iL++)
1834 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1838 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1842 std::vector<int> multiVal;
1843 std::pair<int, std::pair<int,int> > slic;
1844 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1845 int nbc=self->getNumberOfCells();
1846 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1853 std::ostringstream oss;
1854 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1855 throw INTERP_KERNEL::Exception(oss.str().c_str());
1859 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1866 int tmp=nbc+singleVal;
1867 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1872 std::ostringstream oss;
1873 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1874 throw INTERP_KERNEL::Exception(oss.str().c_str());
1880 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1886 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1887 daIntTyypp->checkAllocated();
1888 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1892 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1896 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1900 std::vector<int> multiVal;
1901 std::pair<int, std::pair<int,int> > slic;
1902 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1903 int nbc=self->getNumberOfCells();
1904 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1911 std::ostringstream oss;
1912 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1913 throw INTERP_KERNEL::Exception(oss.str().c_str());
1917 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1924 int tmp=nbc+singleVal;
1925 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1930 std::ostringstream oss;
1931 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1932 throw INTERP_KERNEL::Exception(oss.str().c_str());
1938 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1943 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1949 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1950 daIntTyypp->checkAllocated();
1951 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1955 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1959 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1961 int szArr,sw,iTypppArr;
1962 std::vector<int> stdvecTyyppArr;
1963 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1966 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1967 throw INTERP_KERNEL::Exception(oss.str().c_str());
1969 self->insertNextCell(type,size,tmp);
1972 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1974 int szArr,sw,iTypppArr;
1975 std::vector<int> stdvecTyyppArr;
1976 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1977 self->insertNextCell(type,szArr,tmp);
1980 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1982 DataArrayInt *ret=self->getNodalConnectivity();
1987 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1989 DataArrayInt *ret=self->getNodalConnectivityIndex();
1995 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1997 int szArr,sw,iTypppArr;
1998 std::vector<int> stdvecTyyppArr;
1999 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2000 int nbOfDepthPeelingPerformed=0;
2001 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2002 PyObject *res=PyTuple_New(2);
2003 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2004 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2008 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2010 DataArrayInt *v0=0,*v1=0;
2011 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2012 PyObject *res = PyList_New(2);
2013 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2014 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2018 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2022 DataArrayDoubleTuple *aa;
2023 std::vector<double> bb;
2025 int nbOfCompo=self->getSpaceDimension();
2026 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2029 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2030 PyObject *ret=PyTuple_New(2);
2031 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2032 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2036 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2038 DataArrayInt *ret1=0;
2039 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2040 PyObject *ret=PyTuple_New(2);
2041 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2042 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2046 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2049 DataArrayInt *ret1(0);
2050 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2051 PyObject *ret=PyTuple_New(3);
2052 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2053 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2054 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2058 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2060 std::vector<int> cells;
2061 self->checkButterflyCells(cells,eps);
2062 DataArrayInt *ret=DataArrayInt::New();
2063 ret->alloc((int)cells.size(),1);
2064 std::copy(cells.begin(),cells.end(),ret->getPointer());
2065 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2068 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2070 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2072 PyObject *ret = PyList_New(sz);
2073 for(int i=0;i<sz;i++)
2074 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2078 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2080 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2081 int sz=retCpp.size();
2082 PyObject *ret=PyList_New(sz);
2083 for(int i=0;i<sz;i++)
2084 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2088 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2091 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2092 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2093 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2096 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2099 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2100 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2104 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2107 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2108 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2112 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2114 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2115 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2116 PyObject *ret=PyTuple_New(3);
2117 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2118 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2119 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2123 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2125 DataArrayInt *tmp0=0,*tmp1=0;
2126 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2127 PyObject *ret=PyTuple_New(2);
2128 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2129 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2133 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2137 std::vector<int> multiVal;
2138 std::pair<int, std::pair<int,int> > slic;
2139 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2140 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2144 return self->duplicateNodes(&singleVal,&singleVal+1);
2146 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2148 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2150 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2154 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2158 std::vector<int> multiVal;
2159 std::pair<int, std::pair<int,int> > slic;
2160 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2161 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2165 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2167 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2169 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2171 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2175 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2178 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2179 DataArrayInt *tmp0,*tmp1=0;
2180 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2181 PyObject *ret=PyTuple_New(2);
2182 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2183 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2187 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2189 DataArrayInt *ret0=0,*ret1=0;
2190 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2191 PyObject *ret=PyTuple_New(2);
2192 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2193 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2197 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2199 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2200 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2201 DataArrayInt *ret1=0,*ret2=0;
2202 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2203 PyObject *ret=PyTuple_New(3);
2204 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2205 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2206 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2210 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2212 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2213 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2214 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2215 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2218 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2221 std::vector<const MEDCouplingUMesh *> meshes;
2222 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2223 std::vector<DataArrayInt *> corr;
2224 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2226 PyObject *ret1=PyList_New(sz);
2227 for(int i=0;i<sz;i++)
2228 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2229 PyObject *ret=PyList_New(2);
2230 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2231 PyList_SetItem(ret,1,ret1);
2235 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2237 std::vector<MEDCouplingUMesh *> meshes;
2238 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2239 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2242 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2244 std::vector<MEDCouplingUMesh *> meshes;
2245 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2246 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2249 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2253 std::vector<int> multiVal;
2254 std::pair<int, std::pair<int,int> > slic;
2255 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2257 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2258 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2262 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2264 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2266 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2268 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2272 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2274 DataArrayInt *arrOut=0,*arrIndexOut=0;
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::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2282 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2287 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2292 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2297 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2301 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2303 PyObject *ret=PyTuple_New(2);
2304 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2305 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2309 static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2311 DataArrayInt *arrOut=0,*arrIndexOut=0;
2312 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2313 PyObject *ret=PyTuple_New(2);
2314 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2315 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2319 static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2321 if(!PySlice_Check(slic))
2322 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2323 Py_ssize_t strt=2,stp=2,step=2;
2324 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2326 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2327 arrIndxIn->checkAllocated();
2328 if(arrIndxIn->getNumberOfComponents()!=1)
2329 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2330 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2331 DataArrayInt *arrOut=0,*arrIndexOut=0;
2332 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2333 PyObject *ret=PyTuple_New(2);
2334 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2335 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2339 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2340 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2341 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2343 DataArrayInt *arrOut=0,*arrIndexOut=0;
2346 std::vector<int> multiVal;
2347 std::pair<int, std::pair<int,int> > slic;
2348 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2350 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2351 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2356 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2361 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2366 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2370 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2372 PyObject *ret=PyTuple_New(2);
2373 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2374 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2378 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2379 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2383 std::vector<int> multiVal;
2384 std::pair<int, std::pair<int,int> > slic;
2385 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2387 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2388 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2393 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2398 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2403 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2407 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2411 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2415 DataArrayDoubleTuple *aa;
2416 std::vector<double> bb;
2418 int spaceDim=self->getSpaceDimension();
2419 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2420 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2422 std::vector<int> cells;
2423 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2424 DataArrayInt *ret=DataArrayInt::New();
2425 ret->alloc((int)cells.size(),1);
2426 std::copy(cells.begin(),cells.end(),ret->getPointer());
2427 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2430 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2434 DataArrayDoubleTuple *aa;
2435 std::vector<double> bb;
2437 int spaceDim=self->getSpaceDimension();
2438 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2439 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2440 self->orientCorrectly2DCells(v,polyOnly);
2443 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2445 std::vector<int> cells;
2446 self->arePolyhedronsNotCorrectlyOriented(cells);
2447 DataArrayInt *ret=DataArrayInt::New();
2448 ret->alloc((int)cells.size(),1);
2449 std::copy(cells.begin(),cells.end(),ret->getPointer());
2450 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2453 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2457 self->getFastAveragePlaneOfThis(vec,pos);
2459 std::copy(vec,vec+3,vals);
2460 std::copy(pos,pos+3,vals+3);
2461 return convertDblArrToPyListOfTuple(vals,3,2);
2464 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2466 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2467 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2468 return MEDCouplingUMesh::MergeUMeshes(tmp);
2471 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2474 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2475 PyObject *ret=PyTuple_New(2);
2476 PyObject *ret0Py=ret0?Py_True:Py_False;
2478 PyTuple_SetItem(ret,0,ret0Py);
2479 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2483 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2486 bool ret0=self->areCellsIncludedIn2(other,ret1);
2487 PyObject *ret=PyTuple_New(2);
2488 PyObject *ret0Py=ret0?Py_True:Py_False;
2490 PyTuple_SetItem(ret,0,ret0Py);
2491 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2495 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2497 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2498 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2499 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2500 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2501 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2502 PyObject *ret=PyTuple_New(5);
2503 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2504 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2505 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2506 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2507 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2511 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2513 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2514 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2515 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2516 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2517 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2518 PyObject *ret=PyTuple_New(5);
2519 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2520 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2521 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2522 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2523 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2527 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2529 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2530 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2531 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2532 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2533 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2534 PyObject *ret=PyTuple_New(5);
2535 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2536 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2537 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2538 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2539 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2543 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2545 DataArrayInt *neighbors=0,*neighborsIdx=0;
2546 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2547 PyObject *ret=PyTuple_New(2);
2548 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2549 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2553 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2555 DataArrayInt *neighbors=0,*neighborsIdx=0;
2556 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2557 PyObject *ret=PyTuple_New(2);
2558 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2559 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2563 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2565 DataArrayInt *neighbors=0,*neighborsIdx=0;
2566 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2567 PyObject *ret=PyTuple_New(2);
2568 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2569 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2573 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2575 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2576 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2577 DataArrayInt *d2,*d3,*d4,*dd5;
2578 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2579 PyObject *ret=PyTuple_New(7);
2580 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2581 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2582 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2583 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2584 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2585 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2586 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2590 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2593 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2594 da->checkAllocated();
2595 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2598 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2601 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2602 da->checkAllocated();
2603 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2606 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2609 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2610 da->checkAllocated();
2611 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2614 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2617 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2618 da->checkAllocated();
2619 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2620 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2621 PyObject *res = PyList_New(result.size());
2622 for (int i=0;iL!=result.end(); i++, iL++)
2623 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2627 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2630 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2631 da->checkAllocated();
2632 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2633 ret->setName(da->getName().c_str());
2637 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2639 DataArrayInt *cellNb1=0,*cellNb2=0;
2640 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2641 PyObject *ret=PyTuple_New(3);
2642 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2643 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2644 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2648 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2650 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2651 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2652 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2653 PyObject *ret(PyTuple_New(4));
2654 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2655 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2656 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2657 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2661 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2663 int spaceDim=self->getSpaceDimension();
2665 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2667 DataArrayDouble *a,*a2;
2668 DataArrayDoubleTuple *aa,*aa2;
2669 std::vector<double> bb,bb2;
2671 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2672 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2673 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2674 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2676 DataArrayInt *cellIds=0;
2677 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2678 PyObject *ret=PyTuple_New(2);
2679 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2680 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2684 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2686 int spaceDim=self->getSpaceDimension();
2688 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2690 DataArrayDouble *a,*a2;
2691 DataArrayDoubleTuple *aa,*aa2;
2692 std::vector<double> bb,bb2;
2694 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2695 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2696 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2697 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2699 DataArrayInt *cellIds=0;
2700 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2701 PyObject *ret=PyTuple_New(2);
2702 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2703 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2707 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2709 int spaceDim=self->getSpaceDimension();
2711 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2713 DataArrayDouble *a,*a2;
2714 DataArrayDoubleTuple *aa,*aa2;
2715 std::vector<double> bb,bb2;
2717 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2718 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2719 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2720 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2721 return self->getCellIdsCrossingPlane(orig,vect,eps);
2724 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2728 std::vector<int> pos2;
2729 DataArrayInt *pos3=0;
2730 DataArrayIntTuple *pos4=0;
2731 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2736 self->convertToPolyTypes(&pos1,&pos1+1);
2743 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2748 self->convertToPolyTypes(pos3->begin(),pos3->end());
2752 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2756 void convertAllToPoly();
2757 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2758 bool unPolyze() throw(INTERP_KERNEL::Exception);
2759 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2760 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2761 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2764 //== MEDCouplingUMesh End
2766 //== MEDCouplingExtrudedMesh
2768 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2771 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2772 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2774 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2776 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2779 MEDCouplingExtrudedMesh()
2781 return MEDCouplingExtrudedMesh::New();
2784 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2786 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingExtrudedMesh");
2789 std::string __str__() const throw(INTERP_KERNEL::Exception)
2791 return self->simpleRepr();
2794 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2796 std::ostringstream oss;
2797 self->reprQuickOverview(oss);
2801 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2803 MEDCouplingUMesh *ret=self->getMesh2D();
2806 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2808 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2810 MEDCouplingUMesh *ret=self->getMesh1D();
2813 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2815 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2817 DataArrayInt *ret=self->getMesh3DIds();
2820 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2825 //== MEDCouplingExtrudedMesh End
2827 class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2830 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2831 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2832 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2833 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2834 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2835 virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2838 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2840 int szArr,sw,iTypppArr;
2841 std::vector<int> stdvecTyyppArr;
2842 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2843 self->insertNextCell(tmp,tmp+szArr);
2846 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2848 DataArrayInt *ret=self->getNodalConnectivity();
2849 if(ret) ret->incrRef();
2853 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2855 std::vector< const MEDCoupling1GTUMesh *> parts;
2856 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2857 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2862 //== MEDCoupling1SGTUMesh
2864 class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2867 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2868 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2869 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2870 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2871 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2872 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2873 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2874 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
2875 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
2878 MEDCoupling1SGTUMesh()
2880 return MEDCoupling1SGTUMesh::New();
2883 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2885 return MEDCoupling1SGTUMesh::New(name,type);
2888 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2890 return MEDCoupling1SGTUMesh::New(m);
2893 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2895 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
2898 std::string __str__() const throw(INTERP_KERNEL::Exception)
2900 return self->simpleRepr();
2903 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2905 std::ostringstream oss;
2906 self->reprQuickOverview(oss);
2910 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
2912 DataArrayInt *cellPerm(0),*nodePerm(0);
2913 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
2914 PyObject *ret(PyTuple_New(3));
2915 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
2916 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2917 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2921 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2923 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2924 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2925 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2928 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2930 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2931 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2932 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2937 //== MEDCoupling1SGTUMesh End
2939 //== MEDCoupling1DGTUMesh
2941 class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2944 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2945 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2946 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2947 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2948 bool isPacked() const throw(INTERP_KERNEL::Exception);
2951 MEDCoupling1DGTUMesh()
2953 return MEDCoupling1DGTUMesh::New();
2955 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2957 return MEDCoupling1DGTUMesh::New(name,type);
2960 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2962 return MEDCoupling1DGTUMesh::New(m);
2965 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2967 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
2970 std::string __str__() const throw(INTERP_KERNEL::Exception)
2972 return self->simpleRepr();
2975 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2977 std::ostringstream oss;
2978 self->reprQuickOverview(oss);
2982 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2984 DataArrayInt *ret=self->getNodalConnectivityIndex();
2985 if(ret) ret->incrRef();
2989 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2991 DataArrayInt *ret1=0,*ret2=0;
2992 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2993 PyObject *ret0Py=ret0?Py_True:Py_False;
2995 PyObject *ret=PyTuple_New(3);
2996 PyTuple_SetItem(ret,0,ret0Py);
2997 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2998 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3002 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3005 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3006 PyObject *ret=PyTuple_New(2);
3007 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3008 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3009 PyTuple_SetItem(ret,1,ret1Py);
3013 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3015 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
3016 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3017 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3020 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3022 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
3023 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3024 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3027 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3029 std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
3030 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3031 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3036 //== MEDCoupling1DGTUMeshEnd
3038 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
3041 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3042 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3043 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3044 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3045 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3046 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3047 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3048 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3049 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3050 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3051 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3052 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3053 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3054 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3055 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3058 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3060 int tmpp1=-1,tmpp2=-1;
3061 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3062 std::vector< std::pair<int,int> > inp;
3066 for(int i=0;i<tmpp1;i++)
3067 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3072 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3073 inp.resize(tmpp1/2);
3074 for(int i=0;i<tmpp1/2;i++)
3075 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3078 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3079 return self->buildStructuredSubPart(inp);
3082 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3084 std::vector< std::pair<int,int> > inp;
3085 convertPyToVectorPairInt(part,inp);
3087 int szArr,sw,iTypppArr;
3088 std::vector<int> stdvecTyyppArr;
3089 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3090 std::vector<int> tmp5(tmp4,tmp4+szArr);
3092 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3095 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3097 std::vector< std::pair<int,int> > inp;
3098 convertPyToVectorPairInt(part,inp);
3099 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3102 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3104 std::vector< std::pair<int,int> > inp;
3105 convertPyToVectorPairInt(part,inp);
3106 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3109 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3111 std::vector< std::pair<int,int> > inp;
3112 convertPyToVectorPairInt(part,inp);
3113 std::vector<int> stWithGhost;
3114 std::vector< std::pair<int,int> > partWithGhost;
3115 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3116 PyObject *ret(PyTuple_New(2));
3117 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3118 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3122 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3124 std::vector< std::pair<int,int> > inp;
3125 convertPyToVectorPairInt(partCompactFormat,inp);
3126 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3129 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3131 std::vector< std::pair<int,int> > inp;
3132 convertPyToVectorPairInt(partCompactFormat,inp);
3133 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3136 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3138 std::vector< std::pair<int,int> > inp;
3139 convertPyToVectorPairInt(part,inp);
3140 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3143 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3145 int szArr,sw,iTypppArr;
3146 std::vector<int> stdvecTyyppArr;
3147 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3148 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3151 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3153 int szArr,sw,iTypppArr;
3154 std::vector<int> stdvecTyyppArr;
3155 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3156 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3159 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3161 std::vector< std::pair<int,int> > inp;
3162 convertPyToVectorPairInt(partCompactFormat,inp);
3163 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3166 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3168 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3169 PyObject *retPy=PyList_New(ret.size());
3170 for(std::size_t i=0;i<ret.size();i++)
3172 PyObject *tmp=PyTuple_New(2);
3173 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3174 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3175 PyList_SetItem(retPy,i,tmp);
3180 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3182 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3183 convertPyToVectorPairInt(r1,r1Cpp);
3184 convertPyToVectorPairInt(r2,r2Cpp);
3185 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3186 PyObject *retPy=PyList_New(ret.size());
3187 for(std::size_t i=0;i<ret.size();i++)
3189 PyObject *tmp=PyTuple_New(2);
3190 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3191 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3192 PyList_SetItem(retPy,i,tmp);
3197 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3199 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3200 convertPyToVectorPairInt(r1,r1Cpp);
3201 convertPyToVectorPairInt(r2,r2Cpp);
3202 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3205 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3207 int szArr,sw,iTypppArr;
3208 std::vector<int> stdvecTyyppArr;
3209 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3210 int szArr2,sw2,iTypppArr2;
3211 std::vector<int> stdvecTyyppArr2;
3212 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3213 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3214 std::vector< std::pair<int,int> > partCompactFormat;
3215 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3216 PyObject *ret=PyTuple_New(2);
3217 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3218 PyTuple_SetItem(ret,0,ret0Py);
3219 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3220 for(std::size_t i=0;i<partCompactFormat.size();i++)
3222 PyObject *tmp4=PyTuple_New(2);
3223 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3224 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3225 PyList_SetItem(ret1Py,i,tmp4);
3227 PyTuple_SetItem(ret,1,ret1Py);
3231 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3233 std::vector< std::pair<int,int> > param0,param1,ret;
3234 convertPyToVectorPairInt(bigInAbs,param0);
3235 convertPyToVectorPairInt(partOfBigInAbs,param1);
3236 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3237 PyObject *retPy(PyList_New(ret.size()));
3238 for(std::size_t i=0;i<ret.size();i++)
3240 PyObject *tmp(PyTuple_New(2));
3241 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3242 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3243 PyList_SetItem(retPy,i,tmp);
3248 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3250 std::vector< std::pair<int,int> > param0;
3251 convertPyToVectorPairInt(part,param0);
3252 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3253 PyObject *retPy(PyList_New(ret.size()));
3254 for(std::size_t i=0;i<ret.size();i++)
3256 PyObject *tmp(PyTuple_New(2));
3257 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3258 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3259 PyList_SetItem(retPy,i,tmp);
3264 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3266 std::vector< std::pair<int,int> > param0,param1;
3267 convertPyToVectorPairInt(startingFrom,param0);
3268 convertPyToVectorPairInt(goingTo,param1);
3269 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3272 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3274 std::vector< std::pair<int,int> > param0,param1,ret;
3275 convertPyToVectorPairInt(bigInAbs,param0);
3276 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3277 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3278 PyObject *retPy(PyList_New(ret.size()));
3279 for(std::size_t i=0;i<ret.size();i++)
3281 PyObject *tmp(PyTuple_New(2));
3282 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3283 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3284 PyList_SetItem(retPy,i,tmp);
3291 //== MEDCouplingCMesh
3293 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3296 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3297 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3298 MEDCouplingCMesh *clone(bool recDeepCpy) const;
3299 void setCoords(const DataArrayDouble *coordsX,
3300 const DataArrayDouble *coordsY=0,
3301 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3302 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3304 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3306 return MEDCouplingCMesh::New();
3308 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3310 return MEDCouplingCMesh::New(meshName);
3313 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3315 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3317 std::string __str__() const throw(INTERP_KERNEL::Exception)
3319 return self->simpleRepr();
3321 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3323 std::ostringstream oss;
3324 self->reprQuickOverview(oss);
3327 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3329 DataArrayDouble *ret=self->getCoordsAt(i);
3337 //== MEDCouplingCMesh End
3339 //== MEDCouplingCurveLinearMesh
3341 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3344 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3345 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3346 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
3347 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3349 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3351 return MEDCouplingCurveLinearMesh::New();
3353 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3355 return MEDCouplingCurveLinearMesh::New(meshName);
3357 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3359 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3361 std::string __str__() const throw(INTERP_KERNEL::Exception)
3363 return self->simpleRepr();
3365 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3367 std::ostringstream oss;
3368 self->reprQuickOverview(oss);
3371 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3373 DataArrayDouble *ret=self->getCoords();
3378 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3380 int szArr,sw,iTypppArr;
3381 std::vector<int> stdvecTyyppArr;
3382 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3383 self->setNodeGridStructure(tmp,tmp+szArr);
3388 //== MEDCouplingCurveLinearMesh End
3390 //== MEDCouplingIMesh
3392 class MEDCouplingIMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3395 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3397 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3398 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3399 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3400 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3401 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3402 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3403 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3404 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3405 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3406 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3407 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3412 return MEDCouplingIMesh::New();
3414 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3416 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3417 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3418 const int *nodeStrctPtr(0);
3419 const double *originPtr(0),*dxyzPtr(0);
3421 std::vector<int> bb0;
3422 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3425 std::vector<double> bb,bb2;
3427 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3428 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3430 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3433 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3435 return ParaMEDMEM_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3438 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3440 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3443 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3446 std::vector<int> bb0;
3447 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3448 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3451 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3453 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3456 DataArrayDoubleTuple *aa;
3457 std::vector<double> bb;
3459 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3460 self->setOrigin(originPtr,originPtr+nbTuples);
3463 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3465 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3468 DataArrayDoubleTuple *aa;
3469 std::vector<double> bb;
3471 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3472 self->setDXYZ(originPtr,originPtr+nbTuples);
3475 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3477 std::vector< std::pair<int,int> > inp;
3478 convertPyToVectorPairInt(fineLocInCoarse,inp);
3479 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3482 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)
3484 std::vector< std::pair<int,int> > inp;
3485 convertPyToVectorPairInt(fineLocInCoarse,inp);
3486 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3489 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3491 std::vector< std::pair<int,int> > inp;
3492 convertPyToVectorPairInt(fineLocInCoarse,inp);
3493 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3496 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)
3498 std::vector< std::pair<int,int> > inp;
3499 convertPyToVectorPairInt(fineLocInCoarse,inp);
3500 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3503 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)
3505 std::vector< std::pair<int,int> > inp;
3506 convertPyToVectorPairInt(fineLocInCoarse,inp);
3507 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3510 std::string __str__() const throw(INTERP_KERNEL::Exception)
3512 return self->simpleRepr();
3514 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3516 std::ostringstream oss;
3517 self->reprQuickOverview(oss);
3523 //== MEDCouplingIMesh End
3527 namespace ParaMEDMEM
3529 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3532 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3533 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3534 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3535 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3536 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3537 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3538 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3539 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3540 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3541 std::string getName() const throw(INTERP_KERNEL::Exception);
3542 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3543 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3544 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3545 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3546 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3547 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3548 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3549 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3550 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3551 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3552 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3553 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3554 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3555 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3556 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3557 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3559 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3561 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3564 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3567 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3569 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3572 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3575 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3577 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3578 return convertIntArrToPyList3(ret);
3581 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3584 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3585 PyObject *ret=PyTuple_New(2);
3586 PyObject *ret0Py=ret0?Py_True:Py_False;
3588 PyTuple_SetItem(ret,0,ret0Py);
3589 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3593 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3595 DataArrayInt *ret1=0;
3596 MEDCouplingMesh *ret0=0;
3598 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3599 if (!SWIG_IsOK(res1))
3602 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3603 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3607 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3609 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3610 da2->checkAllocated();
3611 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3613 PyObject *res = PyList_New(2);
3614 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3615 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3619 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3621 DataArrayInt *ret1=0;
3623 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3624 PyObject *res=PyTuple_New(2);
3625 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3627 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3630 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3631 PyTuple_SetItem(res,1,res1);
3636 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3639 int v0; std::vector<int> v1;
3640 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3641 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3644 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3645 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3648 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3649 if (!SWIG_IsOK(res1))
3652 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3653 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3657 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3659 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3660 da2->checkAllocated();
3661 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3665 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3667 std::vector<int> tmp;
3668 self->getCellIdsHavingGaussLocalization(locId,tmp);
3669 DataArrayInt *ret=DataArrayInt::New();
3670 ret->alloc((int)tmp.size(),1);
3671 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3672 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3675 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3677 std::vector<int> inp0;
3678 convertPyToNewIntArr4(code,1,3,inp0);
3679 std::vector<const DataArrayInt *> inp1;
3680 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3681 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3686 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3689 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3690 static MEDCouplingFieldTemplate *New(TypeOfField type);
3691 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3692 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3695 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3697 return MEDCouplingFieldTemplate::New(f);
3700 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3702 return MEDCouplingFieldTemplate::New(type);
3705 std::string __str__() const throw(INTERP_KERNEL::Exception)
3707 return self->simpleRepr();
3710 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3712 std::ostringstream oss;
3713 self->reprQuickOverview(oss);
3719 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3722 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3723 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3724 void setTimeUnit(const std::string& unit);
3725 std::string getTimeUnit() const;
3726 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3727 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3728 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3729 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3730 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3731 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3732 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3733 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3734 MEDCouplingFieldDouble *deepCpy() const;
3735 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3736 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3737 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3738 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3739 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3740 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3741 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3742 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3743 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3744 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3745 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3746 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3747 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3748 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3749 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3750 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3751 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3752 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3753 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3754 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3755 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3756 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3757 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3758 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3759 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3760 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3761 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3762 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3763 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3764 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3765 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3766 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3767 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3768 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3769 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3770 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3771 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3772 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3773 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3774 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3775 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3776 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3777 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3778 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3779 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3780 void fillFromAnalytic2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3781 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3782 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3783 void applyFunc2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3784 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3785 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3786 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3787 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3788 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3789 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3790 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3791 double getMinValue() const throw(INTERP_KERNEL::Exception);
3792 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3793 double norm2() const throw(INTERP_KERNEL::Exception);
3794 double normMax() const throw(INTERP_KERNEL::Exception);
3795 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3796 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3797 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3798 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3799 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3800 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3801 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3802 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3803 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3804 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3805 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3806 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3807 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3808 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3809 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3810 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3811 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3812 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3813 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3814 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3815 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3816 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3818 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3820 return MEDCouplingFieldDouble::New(type,td);
3823 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3825 return MEDCouplingFieldDouble::New(ft,td);
3828 std::string __str__() const throw(INTERP_KERNEL::Exception)
3830 return self->simpleRepr();
3833 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3835 std::ostringstream oss;
3836 self->reprQuickOverview(oss);
3840 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3842 DataArrayDouble *ret=self->getArray();
3848 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3850 std::vector<DataArrayDouble *> arrs=self->getArrays();
3851 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3855 PyObject *ret=PyTuple_New(sz);
3856 for(int i=0;i<sz;i++)
3859 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3861 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3866 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3868 std::vector<const DataArrayDouble *> tmp;
3869 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3871 std::vector<DataArrayDouble *> arrs(sz);
3872 for(int i=0;i<sz;i++)
3873 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3874 self->setArrays(arrs);
3877 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3879 DataArrayDouble *ret=self->getEndArray();
3885 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3889 DataArrayDoubleTuple *aa;
3890 std::vector<double> bb;
3892 const MEDCouplingMesh *mesh=self->getMesh();
3894 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3895 int spaceDim=mesh->getSpaceDimension();
3896 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3897 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3899 int sz=self->getNumberOfComponents();
3900 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3901 self->getValueOn(spaceLoc,res);
3902 return convertDblArrToPyList(res,sz);
3905 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3907 int sz=self->getNumberOfComponents();
3908 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3909 self->getValueOnPos(i,j,k,res);
3910 return convertDblArrToPyList(res,sz);
3913 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3915 const MEDCouplingMesh *mesh(self->getMesh());
3917 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3920 double v0; ParaMEDMEM::DataArrayDouble *v1(0); ParaMEDMEM::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3921 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3922 mesh->getSpaceDimension(),true,nbPts);
3923 return self->getValueOnMulti(inp,nbPts);
3926 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3930 DataArrayDoubleTuple *aa;
3931 std::vector<double> bb;
3933 const MEDCouplingMesh *mesh=self->getMesh();
3935 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3936 int spaceDim=mesh->getSpaceDimension();
3937 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3938 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3941 int sz=self->getNumberOfComponents();
3942 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3943 self->getValueOn(spaceLoc,time,res);
3944 return convertDblArrToPyList(res,sz);
3947 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3949 if(self->getArray()!=0)
3950 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3953 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3954 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3955 self->setArray(arr);
3959 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3962 double tmp0=self->getTime(tmp1,tmp2);
3963 PyObject *res = PyList_New(3);
3964 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3965 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3966 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3970 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3973 double tmp0=self->getStartTime(tmp1,tmp2);
3974 PyObject *res = PyList_New(3);
3975 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3976 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3977 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3981 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3984 double tmp0=self->getEndTime(tmp1,tmp2);
3985 PyObject *res = PyList_New(3);
3986 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3987 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3988 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3991 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3993 int sz=self->getNumberOfComponents();
3994 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3995 self->accumulate(tmp);
3996 return convertDblArrToPyList(tmp,sz);
3998 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4000 int sz=self->getNumberOfComponents();
4001 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4002 self->integral(isWAbs,tmp);
4003 return convertDblArrToPyList(tmp,sz);
4005 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4007 int sz=self->getNumberOfComponents();
4008 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4009 self->getWeightedAverageValue(tmp,isWAbs);
4010 return convertDblArrToPyList(tmp,sz);
4012 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4014 int sz=self->getNumberOfComponents();
4015 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4017 return convertDblArrToPyList(tmp,sz);
4019 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4021 int sz=self->getNumberOfComponents();
4022 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4024 return convertDblArrToPyList(tmp,sz);
4026 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4028 int szArr,sw,iTypppArr;
4029 std::vector<int> stdvecTyyppArr;
4030 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4031 self->renumberCells(tmp,check);
4034 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4036 int szArr,sw,iTypppArr;
4037 std::vector<int> stdvecTyyppArr;
4038 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4039 self->renumberCellsWithoutMesh(tmp,check);
4042 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4044 int szArr,sw,iTypppArr;
4045 std::vector<int> stdvecTyyppArr;
4046 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4047 self->renumberNodes(tmp,eps);
4050 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4052 int szArr,sw,iTypppArr;
4053 std::vector<int> stdvecTyyppArr;
4054 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4055 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4058 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4062 std::vector<int> multiVal;
4063 std::pair<int, std::pair<int,int> > slic;
4064 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4065 const MEDCouplingMesh *mesh=self->getMesh();
4067 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4068 int nbc=mesh->getNumberOfCells();
4069 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4076 std::ostringstream oss;
4077 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4078 throw INTERP_KERNEL::Exception(oss.str().c_str());
4081 return self->buildSubPart(&singleVal,&singleVal+1);
4086 int tmp=nbc+singleVal;
4087 return self->buildSubPart(&tmp,&tmp+1);
4091 std::ostringstream oss;
4092 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4093 throw INTERP_KERNEL::Exception(oss.str().c_str());
4099 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4103 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4108 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4109 daIntTyypp->checkAllocated();
4110 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4113 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4117 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4119 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";
4120 if(PyTuple_Check(li))
4122 Py_ssize_t sz=PyTuple_Size(li);
4124 throw INTERP_KERNEL::Exception(msg);
4125 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4128 std::vector<int> multiVal;
4129 std::pair<int, std::pair<int,int> > slic;
4130 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4131 if(!self->getArray())
4132 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4134 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4135 catch(INTERP_KERNEL::Exception& e)
4136 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4137 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4138 DataArrayDouble *ret0Arr=ret0->getArray();
4140 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4145 std::vector<int> v2(1,singleVal);
4146 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4147 ret0->setArray(aarr);
4152 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4153 ret0->setArray(aarr);
4158 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4159 std::vector<int> v2(nbOfComp);
4160 for(int i=0;i<nbOfComp;i++)
4161 v2[i]=slic.first+i*slic.second.second;
4162 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4163 ret0->setArray(aarr);
4167 throw INTERP_KERNEL::Exception(msg);
4172 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
4175 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4178 double r1=self->getMaxValue2(tmp);
4179 PyObject *ret=PyTuple_New(2);
4180 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4181 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4185 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4188 double r1=self->getMinValue2(tmp);
4189 PyObject *ret=PyTuple_New(2);
4190 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4191 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4195 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4197 std::vector<int> tmp;
4198 convertPyToNewIntArr3(li,tmp);
4199 return self->keepSelectedComponents(tmp);
4202 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4204 std::vector<int> tmp;
4205 convertPyToNewIntArr3(li,tmp);
4206 self->setSelectedComponents(f,tmp);
4209 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4212 DataArrayDouble *a,*a2;
4213 DataArrayDoubleTuple *aa,*aa2;
4214 std::vector<double> bb,bb2;
4217 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4218 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4219 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4220 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4222 return self->extractSlice3D(orig,vect,eps);
4225 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4227 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
4230 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4232 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
4235 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4237 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.";
4238 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4241 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4243 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4245 return (*self)-(*other);
4247 throw INTERP_KERNEL::Exception(msg);
4252 DataArrayDoubleTuple *aa;
4253 std::vector<double> bb;
4255 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4260 if(!self->getArray())
4261 throw INTERP_KERNEL::Exception(msg2);
4262 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4263 ret->applyLin(1.,-val);
4264 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4265 ret2->setArray(ret);
4270 if(!self->getArray())
4271 throw INTERP_KERNEL::Exception(msg2);
4272 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4273 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4274 ret2->setArray(ret);
4279 if(!self->getArray())
4280 throw INTERP_KERNEL::Exception(msg2);
4281 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4282 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4283 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4284 ret2->setArray(ret);
4289 if(!self->getArray())
4290 throw INTERP_KERNEL::Exception(msg2);
4291 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4292 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4293 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4294 ret2->setArray(ret);
4298 { throw INTERP_KERNEL::Exception(msg); }
4302 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4304 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4307 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4309 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
4312 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4314 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4317 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4319 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.";
4320 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4323 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4325 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4327 return (*self)/(*other);
4329 throw INTERP_KERNEL::Exception(msg);
4334 DataArrayDoubleTuple *aa;
4335 std::vector<double> bb;
4337 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4343 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4344 if(!self->getArray())
4345 throw INTERP_KERNEL::Exception(msg2);
4346 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4347 ret->applyLin(1./val,0);
4348 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4349 ret2->setArray(ret);
4354 if(!self->getArray())
4355 throw INTERP_KERNEL::Exception(msg2);
4356 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4357 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4358 ret2->setArray(ret);
4363 if(!self->getArray())
4364 throw INTERP_KERNEL::Exception(msg2);
4365 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4366 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4367 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4368 ret2->setArray(ret);
4373 if(!self->getArray())
4374 throw INTERP_KERNEL::Exception(msg2);
4375 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4376 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4377 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4378 ret2->setArray(ret);
4382 { throw INTERP_KERNEL::Exception(msg); }
4386 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4388 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4391 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4393 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.";
4394 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4397 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4399 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4401 return (*self)^(*other);
4403 throw INTERP_KERNEL::Exception(msg);
4408 DataArrayDoubleTuple *aa;
4409 std::vector<double> bb;
4411 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4416 if(!self->getArray())
4417 throw INTERP_KERNEL::Exception(msg2);
4418 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4420 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4421 ret2->setArray(ret);
4426 if(!self->getArray())
4427 throw INTERP_KERNEL::Exception(msg2);
4428 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4429 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4430 ret2->setArray(ret);
4435 if(!self->getArray())
4436 throw INTERP_KERNEL::Exception(msg2);
4437 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4438 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4439 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4440 ret2->setArray(ret);
4445 if(!self->getArray())
4446 throw INTERP_KERNEL::Exception(msg2);
4447 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4448 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4449 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4450 ret2->setArray(ret);
4454 { throw INTERP_KERNEL::Exception(msg); }
4458 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4460 return self->negate();
4463 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4465 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.";
4466 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4469 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4471 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4475 Py_XINCREF(trueSelf);
4479 throw INTERP_KERNEL::Exception(msg);
4484 DataArrayDoubleTuple *aa;
4485 std::vector<double> bb;
4487 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4492 if(!self->getArray())
4493 throw INTERP_KERNEL::Exception(msg2);
4494 self->getArray()->applyLin(1.,val);
4495 Py_XINCREF(trueSelf);
4500 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4503 Py_XINCREF(trueSelf);
4508 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4509 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4510 ret2->setArray(aaa);
4512 Py_XINCREF(trueSelf);
4517 if(!self->getArray())
4518 throw INTERP_KERNEL::Exception(msg2);
4519 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4520 self->getArray()->addEqual(aaa);
4521 Py_XINCREF(trueSelf);
4525 { throw INTERP_KERNEL::Exception(msg); }
4529 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4531 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.";
4532 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4535 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4537 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4541 Py_XINCREF(trueSelf);
4545 throw INTERP_KERNEL::Exception(msg);
4550 DataArrayDoubleTuple *aa;
4551 std::vector<double> bb;
4553 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4558 if(!self->getArray())
4559 throw INTERP_KERNEL::Exception(msg2);
4560 self->getArray()->applyLin(1.,-val);
4561 Py_XINCREF(trueSelf);
4566 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4569 Py_XINCREF(trueSelf);
4574 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4575 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4576 ret2->setArray(aaa);
4578 Py_XINCREF(trueSelf);
4583 if(!self->getArray())
4584 throw INTERP_KERNEL::Exception(msg2);
4585 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4586 self->getArray()->substractEqual(aaa);
4587 Py_XINCREF(trueSelf);
4591 { throw INTERP_KERNEL::Exception(msg); }
4595 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4597 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.";
4598 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4601 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4603 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4607 Py_XINCREF(trueSelf);
4611 throw INTERP_KERNEL::Exception(msg);
4616 DataArrayDoubleTuple *aa;
4617 std::vector<double> bb;
4619 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4624 if(!self->getArray())
4625 throw INTERP_KERNEL::Exception(msg2);
4626 self->getArray()->applyLin(val,0);
4627 Py_XINCREF(trueSelf);
4632 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4635 Py_XINCREF(trueSelf);
4640 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4641 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4642 ret2->setArray(aaa);
4644 Py_XINCREF(trueSelf);
4649 if(!self->getArray())
4650 throw INTERP_KERNEL::Exception(msg2);
4651 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4652 self->getArray()->multiplyEqual(aaa);
4653 Py_XINCREF(trueSelf);
4657 { throw INTERP_KERNEL::Exception(msg); }
4661 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4663 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.";
4664 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4667 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4669 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4673 Py_XINCREF(trueSelf);
4677 throw INTERP_KERNEL::Exception(msg);
4682 DataArrayDoubleTuple *aa;
4683 std::vector<double> bb;
4685 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4691 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4692 if(!self->getArray())
4693 throw INTERP_KERNEL::Exception(msg2);
4694 self->getArray()->applyLin(1./val,0);
4695 Py_XINCREF(trueSelf);
4700 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4703 Py_XINCREF(trueSelf);
4708 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4709 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4710 ret2->setArray(aaa);
4712 Py_XINCREF(trueSelf);
4717 if(!self->getArray())
4718 throw INTERP_KERNEL::Exception(msg2);
4719 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4720 self->getArray()->divideEqual(aaa);
4721 Py_XINCREF(trueSelf);
4725 { throw INTERP_KERNEL::Exception(msg); }
4729 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4731 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.";
4732 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4735 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4737 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4741 Py_XINCREF(trueSelf);
4745 throw INTERP_KERNEL::Exception(msg);
4750 DataArrayDoubleTuple *aa;
4751 std::vector<double> bb;
4753 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4758 if(!self->getArray())
4759 throw INTERP_KERNEL::Exception(msg2);
4760 self->getArray()->applyPow(val);
4761 Py_XINCREF(trueSelf);
4766 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4769 Py_XINCREF(trueSelf);
4774 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4775 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4776 ret2->setArray(aaa);
4778 Py_XINCREF(trueSelf);
4783 if(!self->getArray())
4784 throw INTERP_KERNEL::Exception(msg2);
4785 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4786 self->getArray()->powEqual(aaa);
4787 Py_XINCREF(trueSelf);
4791 { throw INTERP_KERNEL::Exception(msg); }
4795 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4797 std::vector<const MEDCouplingFieldDouble *> tmp;
4798 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4799 return MEDCouplingFieldDouble::MergeFields(tmp);
4802 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4804 std::vector<const MEDCouplingFieldDouble *> tmp;
4805 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4806 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4809 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4811 std::vector<double> a0;
4812 std::vector<int> a1;
4813 std::vector<std::string> a2;
4814 self->getTinySerializationDbleInformation(a0);
4815 self->getTinySerializationIntInformation(a1);
4816 self->getTinySerializationStrInformation(a2);
4818 PyObject *ret(PyTuple_New(3));
4819 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4820 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
4822 PyObject *ret2(PyList_New(sz));
4824 for(int i=0;i<sz;i++)
4825 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
4827 PyTuple_SetItem(ret,2,ret2);
4831 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
4833 DataArrayInt *ret0(0);
4834 std::vector<DataArrayDouble *> ret1;
4835 self->serialize(ret0,ret1);
4838 std::size_t sz(ret1.size());
4839 PyObject *ret(PyTuple_New(2));
4840 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4841 PyObject *ret1Py(PyList_New(sz));
4842 for(std::size_t i=0;i<sz;i++)
4846 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4848 PyTuple_SetItem(ret,1,ret1Py);
4852 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
4854 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
4855 if(!PyTuple_Check(args))
4856 throw INTERP_KERNEL::Exception(MSG);
4857 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
4858 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
4859 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
4861 PyObject *tmp0(PyTuple_New(1));
4862 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
4863 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
4865 Py_DECREF(selfMeth);
4866 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
4867 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
4868 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
4870 PyObject *a(PyInt_FromLong(0));
4871 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
4874 throw INTERP_KERNEL::Exception(MSG);
4875 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
4876 throw INTERP_KERNEL::Exception(MSG);
4877 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
4880 Py_DECREF(initMeth);
4885 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
4886 {// put an empty dict in input to say to __new__ to call __init__...
4887 self->checkCoherency();
4888 PyObject *ret(PyTuple_New(1));
4889 PyObject *ret0(PyDict_New());
4891 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
4892 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
4893 PyDict_SetItem(ret0,a,d);
4894 Py_DECREF(a); Py_DECREF(d);
4896 PyTuple_SetItem(ret,0,ret0);
4900 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
4902 self->checkCoherency();
4903 PyObject *ret0(ParaMEDMEM_MEDCouplingFieldDouble_getTinySerializationInformation(self));
4904 PyObject *ret1(ParaMEDMEM_MEDCouplingFieldDouble_serialize(self));
4905 const MEDCouplingMesh *mesh(self->getMesh());
4908 PyObject *ret(PyTuple_New(3));
4909 PyTuple_SetItem(ret,0,ret0);
4910 PyTuple_SetItem(ret,1,ret1);
4911 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
4915 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
4917 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
4918 if(!PyTuple_Check(inp))
4919 throw INTERP_KERNEL::Exception(MSG);
4920 int sz(PyTuple_Size(inp));
4922 throw INTERP_KERNEL::Exception(MSG);
4924 PyObject *elt2(PyTuple_GetItem(inp,2));
4926 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,0|0));
4927 if(!SWIG_IsOK(status))
4928 throw INTERP_KERNEL::Exception(MSG);
4929 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
4931 PyObject *elt0(PyTuple_GetItem(inp,0));
4932 PyObject *elt1(PyTuple_GetItem(inp,1));
4933 std::vector<double> a0;
4934 std::vector<int> a1;
4935 std::vector<std::string> a2;
4936 DataArrayInt *b0(0);
4937 std::vector<DataArrayDouble *>b1;
4939 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
4940 throw INTERP_KERNEL::Exception(MSG);
4941 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
4943 fillArrayWithPyListDbl3(a0py,tmp,a0);
4944 convertPyToNewIntArr3(a1py,a1);
4945 fillStringVector(a2py,a2);
4948 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
4949 throw INTERP_KERNEL::Exception(MSG);
4950 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
4952 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0));
4953 if(!SWIG_IsOK(status))
4954 throw INTERP_KERNEL::Exception(MSG);
4955 b0=reinterpret_cast<DataArrayInt *>(argp);
4956 convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayDouble *>(b1py,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",b1);
4958 self->checkForUnserialization(a1,b0,b1);
4959 // useless here to call resizeForUnserialization because arrays are well resized.
4960 self->finishUnserialization(a1,a0,a2);
4965 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4968 int getNumberOfFields() const;
4969 MEDCouplingMultiFields *deepCpy() const;
4970 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4971 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4972 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4973 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4974 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4977 std::string __str__() const throw(INTERP_KERNEL::Exception)
4979 return self->simpleRepr();
4981 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4983 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4984 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4986 std::vector<MEDCouplingFieldDouble *> fs(sz);
4987 for(int i=0;i<sz;i++)
4988 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4989 return MEDCouplingMultiFields::New(fs);
4991 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4993 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4994 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4996 std::vector<MEDCouplingFieldDouble *> fs(sz);
4997 for(int i=0;i<sz;i++)
4998 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4999 return MEDCouplingMultiFields::New(fs);
5001 PyObject *getFields() const
5003 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5004 int sz=fields.size();
5005 PyObject *res = PyList_New(sz);
5006 for(int i=0;i<sz;i++)
5010 fields[i]->incrRef();
5011 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5015 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
5020 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5022 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5026 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5029 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
5031 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5033 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5035 PyObject *res = PyList_New(sz);
5036 for(int i=0;i<sz;i++)
5041 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5045 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
5050 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5052 std::vector<int> refs;
5053 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5055 PyObject *res = PyList_New(sz);
5056 for(int i=0;i<sz;i++)
5061 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5065 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
5069 PyObject *ret=PyTuple_New(2);
5070 PyTuple_SetItem(ret,0,res);
5071 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5074 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5076 std::vector<DataArrayDouble *> ms=self->getArrays();
5078 PyObject *res = PyList_New(sz);
5079 for(int i=0;i<sz;i++)
5084 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5088 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
5093 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5095 std::vector< std::vector<int> > refs;
5096 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5098 PyObject *res = PyList_New(sz);
5099 PyObject *res2 = PyList_New(sz);
5100 for(int i=0;i<sz;i++)
5105 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5109 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
5111 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5114 PyObject *ret=PyTuple_New(2);
5115 PyTuple_SetItem(ret,0,res);
5116 PyTuple_SetItem(ret,1,res2);
5122 class MEDCouplingDefinitionTime
5125 MEDCouplingDefinitionTime();
5126 void assign(const MEDCouplingDefinitionTime& other);
5127 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5128 double getTimeResolution() const;
5129 std::vector<double> getHotSpotsTime() const;
5132 std::string __str__() const throw(INTERP_KERNEL::Exception)
5134 std::ostringstream oss;
5135 self->appendRepr(oss);
5139 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5141 int meshId,arrId,arrIdInField,fieldId;
5142 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5143 PyObject *res=PyList_New(4);
5144 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5145 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5146 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5147 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5151 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5153 int meshId,arrId,arrIdInField,fieldId;
5154 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5155 PyObject *res=PyList_New(4);
5156 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5157 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5158 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5159 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5165 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5168 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5169 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5173 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5175 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
5176 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5178 std::vector<MEDCouplingFieldDouble *> fs(sz);
5179 for(int i=0;i<sz;i++)
5180 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5181 return MEDCouplingFieldOverTime::New(fs);
5183 std::string __str__() const throw(INTERP_KERNEL::Exception)
5185 return self->simpleRepr();
5187 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5189 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
5190 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5192 std::vector<MEDCouplingFieldDouble *> fs(sz);
5193 for(int i=0;i<sz;i++)
5194 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5195 return MEDCouplingFieldOverTime::New(fs);
5200 class MEDCouplingCartesianAMRMesh;
5202 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5205 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5206 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5207 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5210 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5212 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5220 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5223 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5224 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5225 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5228 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5230 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5231 return convertFromVectorPairInt(ret);
5234 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5236 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5237 return convertFromVectorPairInt(ret);
5240 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5242 std::vector< std::pair<int,int> > inp;
5243 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5244 self->addPatch(inp,factors);
5247 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5249 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5251 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5252 if(patchId==mesh->getNumberOfPatches())
5254 std::ostringstream oss;
5255 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5256 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5259 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5265 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5267 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5269 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5270 mesh->removePatch(patchId);
5273 int __len__() const throw(INTERP_KERNEL::Exception)
5275 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5277 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5278 return mesh->getNumberOfPatches();
5283 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5287 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5290 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5291 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5292 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5293 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5294 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5295 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5296 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5297 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5298 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5299 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5300 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5301 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5302 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5304 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5305 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5306 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5307 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5308 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5309 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5310 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5311 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5312 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5313 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5314 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5315 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5316 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5317 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5318 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5319 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5320 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5321 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5322 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5323 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5326 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5328 std::vector< std::pair<int,int> > inp;
5329 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5330 self->addPatch(inp,factors);
5333 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5335 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5337 PyObject *ret = PyList_New(sz);
5338 for(int i=0;i<sz;i++)
5340 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5343 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5348 // agy : don't know why typemap fails here ??? let it in the extend section
5349 PyObject *deepCpy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5351 return convertCartesianAMRMesh(self->deepCpy(father), SWIG_POINTER_OWN | 0 );
5354 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5356 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5357 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5363 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5365 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5366 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5372 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5374 std::vector<int> out1;
5375 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5376 PyObject *ret(PyTuple_New(2));
5377 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5378 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5382 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5384 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5386 PyObject *ret = PyList_New(sz);
5387 for(int i=0;i<sz;i++)
5388 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5392 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5394 std::vector<const DataArrayDouble *> inp;
5395 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",inp);
5396 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5399 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5401 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5407 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5409 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5415 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5417 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5423 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5425 const MEDCouplingIMesh *ret(self->getImageMesh());
5428 return const_cast<MEDCouplingIMesh *>(ret);
5431 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5433 if(patchId==self->getNumberOfPatches())
5435 std::ostringstream oss;
5436 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5437 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5440 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5446 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5448 std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
5449 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5450 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5453 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5455 std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
5456 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5457 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5460 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5462 self->removePatch(patchId);
5465 int __len__() const throw(INTERP_KERNEL::Exception)
5467 return self->getNumberOfPatches();
5472 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5476 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5479 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5482 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5484 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5485 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5486 const int *nodeStrctPtr(0);
5487 const double *originPtr(0),*dxyzPtr(0);
5489 std::vector<int> bb0;
5490 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5493 std::vector<double> bb,bb2;
5495 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5496 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5498 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5501 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5503 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5504 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5505 std::vector< std::vector<int> > inp2;
5506 convertPyToVectorOfVectorOfInt(factors,inp2);
5507 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5510 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5512 return ParaMEDMEM_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5515 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5517 return MEDCouplingCartesianAMRMesh::New(mesh);
5522 class MEDCouplingDataForGodFather : public RefCountObject
5525 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5526 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5527 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5528 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5529 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5530 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5531 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5532 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5533 virtual void alloc() throw(INTERP_KERNEL::Exception);
5534 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5537 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5539 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5547 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5550 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5551 MEDCouplingAMRAttribute *deepCpy() const throw(INTERP_KERNEL::Exception);
5552 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5553 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5554 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5555 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5556 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5557 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5558 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5561 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5563 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5564 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5565 MEDCouplingAMRAttribute *ret(0);
5568 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5569 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5571 catch(INTERP_KERNEL::Exception&)
5573 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5574 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5579 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5581 return ParaMEDMEM_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5584 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5586 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5587 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5593 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5595 std::vector< std::vector<std::string> > compNamesCpp;
5596 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5597 self->spillInfoOnComponents(compNamesCpp);
5600 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5602 std::vector<int> inp0;
5603 if(!fillIntVector(nfs,inp0))
5604 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5605 std::size_t sz(inp0.size());
5606 std::vector<NatureOfField> inp00(sz);
5607 for(std::size_t i=0;i<sz;i++)
5608 inp00[i]=(NatureOfField)inp0[i];
5609 self->spillNatures(inp00);
5612 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5614 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5615 int sz((int)ret.size());
5616 PyObject *retPy(PyList_New(sz));
5617 for(int i=0;i<sz;i++)
5618 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5624 class DenseMatrix : public RefCountObject, public TimeLabel
5627 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5628 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5629 DenseMatrix *deepCpy() const throw(INTERP_KERNEL::Exception);
5630 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5632 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5633 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5634 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5635 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5636 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5637 void transpose() throw(INTERP_KERNEL::Exception);
5639 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5640 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5641 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5644 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5646 return DenseMatrix::New(nbRows,nbCols);
5649 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5651 return DenseMatrix::New(array,nbRows,nbCols);
5654 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5657 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5658 PyObject *ret=PyTuple_New(2);
5659 PyObject *ret0Py=ret0?Py_True:Py_False;
5661 PyTuple_SetItem(ret,0,ret0Py);
5662 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5666 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5668 DataArrayDouble *ret(self->getData());
5674 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5676 return ParaMEDMEM::DenseMatrix::Add(self,other);
5679 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5681 return ParaMEDMEM::DenseMatrix::Substract(self,other);
5684 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5686 return ParaMEDMEM::DenseMatrix::Multiply(self,other);
5689 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5691 return ParaMEDMEM::DenseMatrix::Multiply(self,other);
5694 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5696 self->addEqual(other);
5697 Py_XINCREF(trueSelf);
5701 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5703 self->substractEqual(other);
5704 Py_XINCREF(trueSelf);
5708 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5710 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5717 class PartDefinition : public RefCountObject, public TimeLabel
5720 static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5721 static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5722 virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
5723 virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
5724 virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
5725 virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
5726 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
5727 virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
5730 virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
5732 return (*self)+other;
5736 virtual ~PartDefinition();
5739 class DataArrayPartDefinition : public PartDefinition
5742 static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5745 DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
5747 return DataArrayPartDefinition::New(listOfIds);
5750 std::string __str__() const throw(INTERP_KERNEL::Exception)
5752 return self->getRepr();
5755 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5757 std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
5758 oss << self->getRepr();
5763 virtual ~DataArrayPartDefinition();
5766 class SlicePartDefinition : public PartDefinition
5769 static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5770 int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
5773 SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
5775 return SlicePartDefinition::New(start,stop,step);
5778 PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
5781 self->getSlice(a,b,c);
5782 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
5785 std::string __str__() const throw(INTERP_KERNEL::Exception)
5787 return self->getRepr();
5790 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5792 std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
5793 oss << self->getRepr();
5798 virtual ~SlicePartDefinition();
5804 __filename=os.environ.get('PYTHONSTARTUP')
5805 if __filename and os.path.isfile(__filename):
5806 execfile(__filename)