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);
1176 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1179 std::string __str__() const throw(INTERP_KERNEL::Exception)
1181 return self->simpleRepr();
1184 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1187 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1188 PyObject *res = PyList_New(2);
1189 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1190 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1194 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1196 DataArrayInt *comm, *commIndex;
1197 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1198 PyObject *res = PyList_New(2);
1199 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1200 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1204 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1206 DataArrayDouble *ret1=self->getCoords();
1209 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1212 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1214 int szArr,sw,iTypppArr;
1215 std::vector<int> stdvecTyyppArr;
1216 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1217 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1218 if(sw==3)//DataArrayInt
1220 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1221 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1222 std::string name=argpt->getName();
1224 ret->setName(name.c_str());
1226 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1229 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1231 int szArr,sw,iTypppArr;
1232 std::vector<int> stdvecTyyppArr;
1233 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1234 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1235 if(sw==3)//DataArrayInt
1237 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1238 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1239 std::string name=argpt->getName();
1241 ret->setName(name.c_str());
1243 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1246 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1248 int szArr,sw,iTypppArr;
1249 std::vector<int> stdvecTyyppArr;
1250 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1251 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1252 if(sw==3)//DataArrayInt
1254 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1255 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1256 std::string name=argpt->getName();
1258 ret->setName(name.c_str());
1260 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1263 virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1265 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1266 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1269 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1271 int szArr,sw,iTypppArr;
1272 std::vector<int> stdvecTyyppArr;
1273 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1274 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1275 if(sw==3)//DataArrayInt
1277 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1278 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1279 std::string name=argpt->getName();
1281 ret->setName(name.c_str());
1283 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1286 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1288 int szArr,sw,iTypppArr;
1289 std::vector<int> stdvecTyyppArr;
1290 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1291 self->renumberNodes(tmp,newNbOfNodes);
1294 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1296 int szArr,sw,iTypppArr;
1297 std::vector<int> stdvecTyyppArr;
1298 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1299 self->renumberNodes2(tmp,newNbOfNodes);
1302 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1304 int spaceDim=self->getSpaceDimension();
1306 DataArrayDouble *a,*a2;
1307 DataArrayDoubleTuple *aa,*aa2;
1308 std::vector<double> bb,bb2;
1310 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1311 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1312 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1313 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1314 std::vector<int> nodes;
1315 self->findNodesOnLine(p,v,eps,nodes);
1316 DataArrayInt *ret=DataArrayInt::New();
1317 ret->alloc((int)nodes.size(),1);
1318 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1319 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1321 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1323 int spaceDim=self->getSpaceDimension();
1325 DataArrayDouble *a,*a2;
1326 DataArrayDoubleTuple *aa,*aa2;
1327 std::vector<double> bb,bb2;
1329 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1330 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1331 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1332 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1333 std::vector<int> nodes;
1334 self->findNodesOnPlane(p,v,eps,nodes);
1335 DataArrayInt *ret=DataArrayInt::New();
1336 ret->alloc((int)nodes.size(),1);
1337 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1338 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1341 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1345 DataArrayDoubleTuple *aa;
1346 std::vector<double> bb;
1348 int spaceDim=self->getSpaceDimension();
1349 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1350 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1351 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1352 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1355 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1357 DataArrayInt *c=0,*cI=0;
1361 DataArrayDoubleTuple *aa;
1362 std::vector<double> bb;
1364 int spaceDim=self->getSpaceDimension();
1365 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1366 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1367 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1368 PyObject *ret=PyTuple_New(2);
1369 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1370 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1374 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1376 DataArrayInt *c=0,*cI=0;
1377 int spaceDim=self->getSpaceDimension();
1380 DataArrayDoubleTuple *aa;
1381 std::vector<double> bb;
1384 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1385 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1387 PyObject *ret=PyTuple_New(2);
1388 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1389 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1393 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1397 DataArrayDoubleTuple *aa;
1398 std::vector<double> bb;
1400 int spaceDim=self->getSpaceDimension();
1401 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1402 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1404 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1405 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1408 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1412 std::vector<int> multiVal;
1413 std::pair<int, std::pair<int,int> > slic;
1414 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1415 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1419 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1421 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1423 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1425 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1429 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1431 DataArrayInt *v0=0,*v1=0;
1432 self->findCommonCells(compType,startCellId,v0,v1);
1433 PyObject *res = PyList_New(2);
1434 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1435 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1440 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1443 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1444 if (!SWIG_IsOK(res1))
1447 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1448 self->renumberNodesInConn(tmp);
1452 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1454 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1455 da2->checkAllocated();
1456 self->renumberNodesInConn(da2->getConstPointer());
1460 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1463 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1464 PyObject *ret=PyTuple_New(2);
1465 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1466 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1470 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1472 DataArrayInt *ret=0;
1474 int szArr,sw,iTypppArr;
1475 std::vector<int> stdvecTyyppArr;
1476 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1477 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1481 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1485 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1486 PyObject *res = PyList_New(3);
1487 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1488 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1489 PyList_SetItem(res,2,SWIG_From_int(ret2));
1493 virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1497 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1498 PyObject *res = PyList_New(3);
1499 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1500 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1501 PyList_SetItem(res,2,SWIG_From_int(ret2));
1505 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1508 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1509 if (!SWIG_IsOK(res1))
1512 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1513 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1517 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1519 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1520 da2->checkAllocated();
1521 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1525 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1529 std::vector<int> multiVal;
1530 std::pair<int, std::pair<int,int> > slic;
1531 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1532 int nbc=self->getNumberOfCells();
1533 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1540 std::ostringstream oss;
1541 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1542 throw INTERP_KERNEL::Exception(oss.str().c_str());
1545 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1550 int tmp=nbc+singleVal;
1551 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1555 std::ostringstream oss;
1556 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1557 throw INTERP_KERNEL::Exception(oss.str().c_str());
1563 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1567 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1572 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1573 daIntTyypp->checkAllocated();
1574 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1577 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1581 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1584 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1585 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1586 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1587 for(int i=0;i<sz;i++)
1588 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1591 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1594 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1596 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1597 std::vector<double> val3;
1598 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1599 "Rotate2DAlg",2,true,nbNodes);
1601 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1602 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1605 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1608 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1609 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1610 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1611 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1612 for(int i=0;i<sz;i++)
1613 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1616 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1619 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1621 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1622 std::vector<double> val3;
1623 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1624 "Rotate3DAlg",3,true,nbNodes);
1626 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1627 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1628 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1633 //== MEDCouplingPointSet End
1635 class MEDCouplingUMeshCell
1638 INTERP_KERNEL::NormalizedCellType getType() const;
1641 std::string __str__() const throw(INTERP_KERNEL::Exception)
1643 return self->repr();
1646 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1649 const int *r=self->getAllConn(ret2);
1650 PyObject *ret=PyTuple_New(ret2);
1651 for(int i=0;i<ret2;i++)
1652 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1658 class MEDCouplingUMeshCellIterator
1665 MEDCouplingUMeshCell *ret=self->nextt();
1667 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1670 PyErr_SetString(PyExc_StopIteration,"No more data.");
1677 class MEDCouplingUMeshCellByTypeIterator
1680 ~MEDCouplingUMeshCellByTypeIterator();
1685 MEDCouplingUMeshCellEntry *ret=self->nextt();
1687 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1690 PyErr_SetString(PyExc_StopIteration,"No more data.");
1697 class MEDCouplingUMeshCellByTypeEntry
1700 ~MEDCouplingUMeshCellByTypeEntry();
1703 MEDCouplingUMeshCellByTypeIterator *__iter__()
1705 return self->iterator();
1710 class MEDCouplingUMeshCellEntry
1713 INTERP_KERNEL::NormalizedCellType getType() const;
1714 int getNumberOfElems() const;
1717 MEDCouplingUMeshCellIterator *__iter__()
1719 return self->iterator();
1724 //== MEDCouplingUMesh
1726 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1729 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1730 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1731 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1732 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1733 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1734 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1735 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1736 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1737 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1738 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1739 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1740 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1741 void computeTypes() throw(INTERP_KERNEL::Exception);
1742 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1743 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1745 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1746 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1747 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1748 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1749 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1750 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1751 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1752 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1753 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1754 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1755 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1756 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1757 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1758 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1759 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1760 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1761 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1762 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1763 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1764 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1765 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1766 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1767 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1768 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1769 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1770 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1771 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1772 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1773 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1774 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1775 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1776 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1777 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1778 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1779 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1780 ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1781 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1782 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1783 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1784 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1785 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1786 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1787 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1788 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1789 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);
1790 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1791 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1792 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1793 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1794 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1796 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1798 return MEDCouplingUMesh::New();
1801 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1803 return MEDCouplingUMesh::New(meshName,meshDim);
1807 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1809 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1812 std::string __str__() const throw(INTERP_KERNEL::Exception)
1814 return self->simpleRepr();
1817 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1819 std::ostringstream oss;
1820 self->reprQuickOverview(oss);
1824 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1826 return self->cellIterator();
1829 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1831 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1832 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1833 PyObject *res=PyList_New(result.size());
1834 for(int i=0;iL!=result.end(); i++, iL++)
1835 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1839 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1843 std::vector<int> multiVal;
1844 std::pair<int, std::pair<int,int> > slic;
1845 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1846 int nbc=self->getNumberOfCells();
1847 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1854 std::ostringstream oss;
1855 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1856 throw INTERP_KERNEL::Exception(oss.str().c_str());
1860 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1867 int tmp=nbc+singleVal;
1868 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1873 std::ostringstream oss;
1874 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1875 throw INTERP_KERNEL::Exception(oss.str().c_str());
1881 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1887 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1888 daIntTyypp->checkAllocated();
1889 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1893 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1897 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1901 std::vector<int> multiVal;
1902 std::pair<int, std::pair<int,int> > slic;
1903 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1904 int nbc=self->getNumberOfCells();
1905 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1912 std::ostringstream oss;
1913 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1914 throw INTERP_KERNEL::Exception(oss.str().c_str());
1918 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1925 int tmp=nbc+singleVal;
1926 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1931 std::ostringstream oss;
1932 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1933 throw INTERP_KERNEL::Exception(oss.str().c_str());
1939 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1944 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1950 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1951 daIntTyypp->checkAllocated();
1952 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1956 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1960 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1962 int szArr,sw,iTypppArr;
1963 std::vector<int> stdvecTyyppArr;
1964 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1967 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1968 throw INTERP_KERNEL::Exception(oss.str().c_str());
1970 self->insertNextCell(type,size,tmp);
1973 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1975 int szArr,sw,iTypppArr;
1976 std::vector<int> stdvecTyyppArr;
1977 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1978 self->insertNextCell(type,szArr,tmp);
1981 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1983 DataArrayInt *ret=self->getNodalConnectivity();
1988 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1990 DataArrayInt *ret=self->getNodalConnectivityIndex();
1996 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1998 int szArr,sw,iTypppArr;
1999 std::vector<int> stdvecTyyppArr;
2000 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2001 int nbOfDepthPeelingPerformed=0;
2002 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2003 PyObject *res=PyTuple_New(2);
2004 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2005 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2009 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2011 DataArrayInt *v0=0,*v1=0;
2012 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2013 PyObject *res = PyList_New(2);
2014 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2015 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2019 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2023 DataArrayDoubleTuple *aa;
2024 std::vector<double> bb;
2026 int nbOfCompo=self->getSpaceDimension();
2027 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2030 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2031 PyObject *ret=PyTuple_New(2);
2032 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2033 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2037 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2039 DataArrayInt *ret1=0;
2040 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2041 PyObject *ret=PyTuple_New(2);
2042 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2043 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2047 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2050 DataArrayInt *ret1(0);
2051 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2052 PyObject *ret=PyTuple_New(3);
2053 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2054 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2055 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2059 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2061 std::vector<int> cells;
2062 self->checkButterflyCells(cells,eps);
2063 DataArrayInt *ret=DataArrayInt::New();
2064 ret->alloc((int)cells.size(),1);
2065 std::copy(cells.begin(),cells.end(),ret->getPointer());
2066 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2069 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2071 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2073 PyObject *ret = PyList_New(sz);
2074 for(int i=0;i<sz;i++)
2075 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2079 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2081 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2082 int sz=retCpp.size();
2083 PyObject *ret=PyList_New(sz);
2084 for(int i=0;i<sz;i++)
2085 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2089 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2092 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2093 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2094 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2097 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2100 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2101 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2105 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2108 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2109 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2113 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2115 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2116 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2117 PyObject *ret=PyTuple_New(3);
2118 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2119 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2120 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2124 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2126 DataArrayInt *tmp0=0,*tmp1=0;
2127 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2128 PyObject *ret=PyTuple_New(2);
2129 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2130 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2134 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2138 std::vector<int> multiVal;
2139 std::pair<int, std::pair<int,int> > slic;
2140 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2141 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2145 return self->duplicateNodes(&singleVal,&singleVal+1);
2147 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2149 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2151 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2155 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2159 std::vector<int> multiVal;
2160 std::pair<int, std::pair<int,int> > slic;
2161 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2162 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2166 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2168 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2170 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2172 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2176 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2179 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2180 DataArrayInt *tmp0,*tmp1=0;
2181 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2182 PyObject *ret=PyTuple_New(2);
2183 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2184 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2188 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2190 DataArrayInt *ret0=0,*ret1=0;
2191 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2192 PyObject *ret=PyTuple_New(2);
2193 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2194 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2198 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2200 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2201 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2202 DataArrayInt *ret1=0,*ret2=0;
2203 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2204 PyObject *ret=PyTuple_New(3);
2205 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2206 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2207 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2211 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2213 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2214 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2215 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2216 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2219 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2222 std::vector<const MEDCouplingUMesh *> meshes;
2223 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2224 std::vector<DataArrayInt *> corr;
2225 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2227 PyObject *ret1=PyList_New(sz);
2228 for(int i=0;i<sz;i++)
2229 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2230 PyObject *ret=PyList_New(2);
2231 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2232 PyList_SetItem(ret,1,ret1);
2236 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2238 std::vector<MEDCouplingUMesh *> meshes;
2239 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2240 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2243 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2245 std::vector<MEDCouplingUMesh *> meshes;
2246 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2247 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2250 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2254 std::vector<int> multiVal;
2255 std::pair<int, std::pair<int,int> > slic;
2256 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2258 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2259 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2263 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2265 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2267 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2269 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2273 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2275 DataArrayInt *arrOut=0,*arrIndexOut=0;
2278 std::vector<int> multiVal;
2279 std::pair<int, std::pair<int,int> > slic;
2280 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2282 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2283 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2288 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2293 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2298 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2302 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2304 PyObject *ret=PyTuple_New(2);
2305 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2306 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2310 static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2312 DataArrayInt *arrOut=0,*arrIndexOut=0;
2313 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2314 PyObject *ret=PyTuple_New(2);
2315 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2316 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2320 static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2322 if(!PySlice_Check(slic))
2323 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2324 Py_ssize_t strt=2,stp=2,step=2;
2325 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2327 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2328 arrIndxIn->checkAllocated();
2329 if(arrIndxIn->getNumberOfComponents()!=1)
2330 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2331 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2332 DataArrayInt *arrOut=0,*arrIndexOut=0;
2333 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2334 PyObject *ret=PyTuple_New(2);
2335 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2336 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2340 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2341 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2342 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2344 DataArrayInt *arrOut=0,*arrIndexOut=0;
2347 std::vector<int> multiVal;
2348 std::pair<int, std::pair<int,int> > slic;
2349 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2351 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2352 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2357 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2362 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2367 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2371 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2373 PyObject *ret=PyTuple_New(2);
2374 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2375 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2379 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2380 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2384 std::vector<int> multiVal;
2385 std::pair<int, std::pair<int,int> > slic;
2386 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2388 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2389 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2394 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2399 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2404 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2408 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2412 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2416 DataArrayDoubleTuple *aa;
2417 std::vector<double> bb;
2419 int spaceDim=self->getSpaceDimension();
2420 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2421 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2423 std::vector<int> cells;
2424 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2425 DataArrayInt *ret=DataArrayInt::New();
2426 ret->alloc((int)cells.size(),1);
2427 std::copy(cells.begin(),cells.end(),ret->getPointer());
2428 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2431 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2435 DataArrayDoubleTuple *aa;
2436 std::vector<double> bb;
2438 int spaceDim=self->getSpaceDimension();
2439 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2440 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2441 self->orientCorrectly2DCells(v,polyOnly);
2444 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2446 std::vector<int> cells;
2447 self->arePolyhedronsNotCorrectlyOriented(cells);
2448 DataArrayInt *ret=DataArrayInt::New();
2449 ret->alloc((int)cells.size(),1);
2450 std::copy(cells.begin(),cells.end(),ret->getPointer());
2451 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2454 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2458 self->getFastAveragePlaneOfThis(vec,pos);
2460 std::copy(vec,vec+3,vals);
2461 std::copy(pos,pos+3,vals+3);
2462 return convertDblArrToPyListOfTuple(vals,3,2);
2465 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2467 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2468 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2469 return MEDCouplingUMesh::MergeUMeshes(tmp);
2472 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2475 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2476 PyObject *ret=PyTuple_New(2);
2477 PyObject *ret0Py=ret0?Py_True:Py_False;
2479 PyTuple_SetItem(ret,0,ret0Py);
2480 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2484 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2487 bool ret0=self->areCellsIncludedIn2(other,ret1);
2488 PyObject *ret=PyTuple_New(2);
2489 PyObject *ret0Py=ret0?Py_True:Py_False;
2491 PyTuple_SetItem(ret,0,ret0Py);
2492 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2496 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2498 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2499 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2500 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2501 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2502 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2503 PyObject *ret=PyTuple_New(5);
2504 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2505 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2506 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2507 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2508 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2512 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2514 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2515 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2516 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2517 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2518 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2519 PyObject *ret=PyTuple_New(5);
2520 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2521 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2522 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2523 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2524 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2528 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2530 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2531 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2532 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2533 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2534 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2535 PyObject *ret=PyTuple_New(5);
2536 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2537 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2538 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2539 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2540 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2544 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2546 DataArrayInt *neighbors=0,*neighborsIdx=0;
2547 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2548 PyObject *ret=PyTuple_New(2);
2549 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2550 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2554 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2556 DataArrayInt *neighbors=0,*neighborsIdx=0;
2557 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2558 PyObject *ret=PyTuple_New(2);
2559 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2560 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2564 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2566 DataArrayInt *neighbors=0,*neighborsIdx=0;
2567 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2568 PyObject *ret=PyTuple_New(2);
2569 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2570 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2574 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2576 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2577 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2578 DataArrayInt *d2,*d3,*d4,*dd5;
2579 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2580 PyObject *ret=PyTuple_New(7);
2581 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2582 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2583 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2584 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2585 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2586 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2587 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2591 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2594 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2595 da->checkAllocated();
2596 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2599 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2602 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2603 da->checkAllocated();
2604 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2607 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2610 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2611 da->checkAllocated();
2612 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2615 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2618 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2619 da->checkAllocated();
2620 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2621 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2622 PyObject *res = PyList_New(result.size());
2623 for (int i=0;iL!=result.end(); i++, iL++)
2624 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2628 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2631 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2632 da->checkAllocated();
2633 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2634 ret->setName(da->getName().c_str());
2638 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2640 DataArrayInt *cellNb1=0,*cellNb2=0;
2641 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2642 PyObject *ret=PyTuple_New(3);
2643 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2644 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2645 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2649 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2651 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2652 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2653 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2654 PyObject *ret(PyTuple_New(4));
2655 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2656 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2657 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2658 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2662 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2664 int spaceDim=self->getSpaceDimension();
2666 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2668 DataArrayDouble *a,*a2;
2669 DataArrayDoubleTuple *aa,*aa2;
2670 std::vector<double> bb,bb2;
2672 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2673 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2674 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2675 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2677 DataArrayInt *cellIds=0;
2678 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2679 PyObject *ret=PyTuple_New(2);
2680 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2681 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2685 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2687 int spaceDim=self->getSpaceDimension();
2689 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2691 DataArrayDouble *a,*a2;
2692 DataArrayDoubleTuple *aa,*aa2;
2693 std::vector<double> bb,bb2;
2695 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2696 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2697 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2698 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2700 DataArrayInt *cellIds=0;
2701 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2702 PyObject *ret=PyTuple_New(2);
2703 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2704 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2708 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2710 int spaceDim=self->getSpaceDimension();
2712 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2714 DataArrayDouble *a,*a2;
2715 DataArrayDoubleTuple *aa,*aa2;
2716 std::vector<double> bb,bb2;
2718 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2719 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2720 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2721 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2722 return self->getCellIdsCrossingPlane(orig,vect,eps);
2725 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2729 std::vector<int> pos2;
2730 DataArrayInt *pos3=0;
2731 DataArrayIntTuple *pos4=0;
2732 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2737 self->convertToPolyTypes(&pos1,&pos1+1);
2744 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2749 self->convertToPolyTypes(pos3->begin(),pos3->end());
2753 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2757 void convertAllToPoly();
2758 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2759 bool unPolyze() throw(INTERP_KERNEL::Exception);
2760 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2761 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2762 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2765 //== MEDCouplingUMesh End
2767 //== MEDCouplingExtrudedMesh
2769 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2772 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2773 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2775 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2777 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2780 MEDCouplingExtrudedMesh()
2782 return MEDCouplingExtrudedMesh::New();
2785 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2787 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingExtrudedMesh");
2790 std::string __str__() const throw(INTERP_KERNEL::Exception)
2792 return self->simpleRepr();
2795 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2797 std::ostringstream oss;
2798 self->reprQuickOverview(oss);
2802 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2804 MEDCouplingUMesh *ret=self->getMesh2D();
2807 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2809 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2811 MEDCouplingUMesh *ret=self->getMesh1D();
2814 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2816 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2818 DataArrayInt *ret=self->getMesh3DIds();
2821 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2826 //== MEDCouplingExtrudedMesh End
2828 class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2831 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2832 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2833 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2834 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2835 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2836 virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2839 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2841 int szArr,sw,iTypppArr;
2842 std::vector<int> stdvecTyyppArr;
2843 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2844 self->insertNextCell(tmp,tmp+szArr);
2847 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2849 DataArrayInt *ret=self->getNodalConnectivity();
2850 if(ret) ret->incrRef();
2854 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2856 std::vector< const MEDCoupling1GTUMesh *> parts;
2857 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2858 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2863 //== MEDCoupling1SGTUMesh
2865 class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2868 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2869 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2870 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2871 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2872 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2873 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2874 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2875 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
2876 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
2879 MEDCoupling1SGTUMesh()
2881 return MEDCoupling1SGTUMesh::New();
2884 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2886 return MEDCoupling1SGTUMesh::New(name,type);
2889 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2891 return MEDCoupling1SGTUMesh::New(m);
2894 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2896 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
2899 std::string __str__() const throw(INTERP_KERNEL::Exception)
2901 return self->simpleRepr();
2904 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2906 std::ostringstream oss;
2907 self->reprQuickOverview(oss);
2911 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
2913 DataArrayInt *cellPerm(0),*nodePerm(0);
2914 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
2915 PyObject *ret(PyTuple_New(3));
2916 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
2917 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2918 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2922 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2924 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2925 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2926 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2929 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2931 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2932 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2933 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2938 //== MEDCoupling1SGTUMesh End
2940 //== MEDCoupling1DGTUMesh
2942 class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2945 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2946 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2947 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2948 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2949 bool isPacked() const throw(INTERP_KERNEL::Exception);
2952 MEDCoupling1DGTUMesh()
2954 return MEDCoupling1DGTUMesh::New();
2956 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2958 return MEDCoupling1DGTUMesh::New(name,type);
2961 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2963 return MEDCoupling1DGTUMesh::New(m);
2966 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2968 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
2971 std::string __str__() const throw(INTERP_KERNEL::Exception)
2973 return self->simpleRepr();
2976 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2978 std::ostringstream oss;
2979 self->reprQuickOverview(oss);
2983 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2985 DataArrayInt *ret=self->getNodalConnectivityIndex();
2986 if(ret) ret->incrRef();
2990 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2992 DataArrayInt *ret1=0,*ret2=0;
2993 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2994 PyObject *ret0Py=ret0?Py_True:Py_False;
2996 PyObject *ret=PyTuple_New(3);
2997 PyTuple_SetItem(ret,0,ret0Py);
2998 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2999 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3003 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3006 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3007 PyObject *ret=PyTuple_New(2);
3008 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3009 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3010 PyTuple_SetItem(ret,1,ret1Py);
3014 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3016 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
3017 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3018 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3021 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3023 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
3024 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3025 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3028 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3030 std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
3031 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3032 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3037 //== MEDCoupling1DGTUMeshEnd
3039 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
3042 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3043 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3044 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3045 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3046 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3047 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3048 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3049 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3050 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3051 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3052 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3053 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3054 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3055 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3056 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3059 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3061 int tmpp1=-1,tmpp2=-1;
3062 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3063 std::vector< std::pair<int,int> > inp;
3067 for(int i=0;i<tmpp1;i++)
3068 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3073 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3074 inp.resize(tmpp1/2);
3075 for(int i=0;i<tmpp1/2;i++)
3076 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3079 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3080 return self->buildStructuredSubPart(inp);
3083 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3085 std::vector< std::pair<int,int> > inp;
3086 convertPyToVectorPairInt(part,inp);
3088 int szArr,sw,iTypppArr;
3089 std::vector<int> stdvecTyyppArr;
3090 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3091 std::vector<int> tmp5(tmp4,tmp4+szArr);
3093 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3096 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3098 std::vector< std::pair<int,int> > inp;
3099 convertPyToVectorPairInt(part,inp);
3100 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3103 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3105 std::vector< std::pair<int,int> > inp;
3106 convertPyToVectorPairInt(part,inp);
3107 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3110 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3112 std::vector< std::pair<int,int> > inp;
3113 convertPyToVectorPairInt(part,inp);
3114 std::vector<int> stWithGhost;
3115 std::vector< std::pair<int,int> > partWithGhost;
3116 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3117 PyObject *ret(PyTuple_New(2));
3118 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3119 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3123 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3125 std::vector< std::pair<int,int> > inp;
3126 convertPyToVectorPairInt(partCompactFormat,inp);
3127 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3130 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3132 std::vector< std::pair<int,int> > inp;
3133 convertPyToVectorPairInt(partCompactFormat,inp);
3134 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3137 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3139 std::vector< std::pair<int,int> > inp;
3140 convertPyToVectorPairInt(part,inp);
3141 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3144 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3146 int szArr,sw,iTypppArr;
3147 std::vector<int> stdvecTyyppArr;
3148 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3149 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3152 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3154 int szArr,sw,iTypppArr;
3155 std::vector<int> stdvecTyyppArr;
3156 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3157 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3160 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3162 std::vector< std::pair<int,int> > inp;
3163 convertPyToVectorPairInt(partCompactFormat,inp);
3164 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3167 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3169 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3170 PyObject *retPy=PyList_New(ret.size());
3171 for(std::size_t i=0;i<ret.size();i++)
3173 PyObject *tmp=PyTuple_New(2);
3174 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3175 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3176 PyList_SetItem(retPy,i,tmp);
3181 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3183 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3184 convertPyToVectorPairInt(r1,r1Cpp);
3185 convertPyToVectorPairInt(r2,r2Cpp);
3186 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3187 PyObject *retPy=PyList_New(ret.size());
3188 for(std::size_t i=0;i<ret.size();i++)
3190 PyObject *tmp=PyTuple_New(2);
3191 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3192 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3193 PyList_SetItem(retPy,i,tmp);
3198 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3200 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3201 convertPyToVectorPairInt(r1,r1Cpp);
3202 convertPyToVectorPairInt(r2,r2Cpp);
3203 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3206 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3208 int szArr,sw,iTypppArr;
3209 std::vector<int> stdvecTyyppArr;
3210 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3211 int szArr2,sw2,iTypppArr2;
3212 std::vector<int> stdvecTyyppArr2;
3213 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3214 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3215 std::vector< std::pair<int,int> > partCompactFormat;
3216 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3217 PyObject *ret=PyTuple_New(2);
3218 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3219 PyTuple_SetItem(ret,0,ret0Py);
3220 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3221 for(std::size_t i=0;i<partCompactFormat.size();i++)
3223 PyObject *tmp4=PyTuple_New(2);
3224 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3225 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3226 PyList_SetItem(ret1Py,i,tmp4);
3228 PyTuple_SetItem(ret,1,ret1Py);
3232 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3234 std::vector< std::pair<int,int> > param0,param1,ret;
3235 convertPyToVectorPairInt(bigInAbs,param0);
3236 convertPyToVectorPairInt(partOfBigInAbs,param1);
3237 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3238 PyObject *retPy(PyList_New(ret.size()));
3239 for(std::size_t i=0;i<ret.size();i++)
3241 PyObject *tmp(PyTuple_New(2));
3242 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3243 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3244 PyList_SetItem(retPy,i,tmp);
3249 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3251 std::vector< std::pair<int,int> > param0;
3252 convertPyToVectorPairInt(part,param0);
3253 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3254 PyObject *retPy(PyList_New(ret.size()));
3255 for(std::size_t i=0;i<ret.size();i++)
3257 PyObject *tmp(PyTuple_New(2));
3258 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3259 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3260 PyList_SetItem(retPy,i,tmp);
3265 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3267 std::vector< std::pair<int,int> > param0,param1;
3268 convertPyToVectorPairInt(startingFrom,param0);
3269 convertPyToVectorPairInt(goingTo,param1);
3270 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3273 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3275 std::vector< std::pair<int,int> > param0,param1,ret;
3276 convertPyToVectorPairInt(bigInAbs,param0);
3277 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3278 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3279 PyObject *retPy(PyList_New(ret.size()));
3280 for(std::size_t i=0;i<ret.size();i++)
3282 PyObject *tmp(PyTuple_New(2));
3283 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3284 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3285 PyList_SetItem(retPy,i,tmp);
3292 //== MEDCouplingCMesh
3294 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3297 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3298 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3299 MEDCouplingCMesh *clone(bool recDeepCpy) const;
3300 void setCoords(const DataArrayDouble *coordsX,
3301 const DataArrayDouble *coordsY=0,
3302 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3303 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3305 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3307 return MEDCouplingCMesh::New();
3309 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3311 return MEDCouplingCMesh::New(meshName);
3314 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3316 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3318 std::string __str__() const throw(INTERP_KERNEL::Exception)
3320 return self->simpleRepr();
3322 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3324 std::ostringstream oss;
3325 self->reprQuickOverview(oss);
3328 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3330 DataArrayDouble *ret=self->getCoordsAt(i);
3338 //== MEDCouplingCMesh End
3340 //== MEDCouplingCurveLinearMesh
3342 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3345 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3346 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3347 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
3348 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3350 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3352 return MEDCouplingCurveLinearMesh::New();
3354 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3356 return MEDCouplingCurveLinearMesh::New(meshName);
3358 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3360 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3362 std::string __str__() const throw(INTERP_KERNEL::Exception)
3364 return self->simpleRepr();
3366 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3368 std::ostringstream oss;
3369 self->reprQuickOverview(oss);
3372 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3374 DataArrayDouble *ret=self->getCoords();
3379 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3381 int szArr,sw,iTypppArr;
3382 std::vector<int> stdvecTyyppArr;
3383 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3384 self->setNodeGridStructure(tmp,tmp+szArr);
3389 //== MEDCouplingCurveLinearMesh End
3391 //== MEDCouplingIMesh
3393 class MEDCouplingIMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3396 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3398 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3399 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3400 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3401 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3402 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3403 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3404 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3405 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3406 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3407 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3408 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3413 return MEDCouplingIMesh::New();
3415 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3417 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3418 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3419 const int *nodeStrctPtr(0);
3420 const double *originPtr(0),*dxyzPtr(0);
3422 std::vector<int> bb0;
3423 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3426 std::vector<double> bb,bb2;
3428 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3429 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3431 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3434 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3436 return ParaMEDMEM_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3439 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3441 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3444 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3447 std::vector<int> bb0;
3448 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3449 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3452 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3454 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3457 DataArrayDoubleTuple *aa;
3458 std::vector<double> bb;
3460 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3461 self->setOrigin(originPtr,originPtr+nbTuples);
3464 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3466 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3469 DataArrayDoubleTuple *aa;
3470 std::vector<double> bb;
3472 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3473 self->setDXYZ(originPtr,originPtr+nbTuples);
3476 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3478 std::vector< std::pair<int,int> > inp;
3479 convertPyToVectorPairInt(fineLocInCoarse,inp);
3480 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3483 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)
3485 std::vector< std::pair<int,int> > inp;
3486 convertPyToVectorPairInt(fineLocInCoarse,inp);
3487 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3490 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3492 std::vector< std::pair<int,int> > inp;
3493 convertPyToVectorPairInt(fineLocInCoarse,inp);
3494 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3497 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)
3499 std::vector< std::pair<int,int> > inp;
3500 convertPyToVectorPairInt(fineLocInCoarse,inp);
3501 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3504 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)
3506 std::vector< std::pair<int,int> > inp;
3507 convertPyToVectorPairInt(fineLocInCoarse,inp);
3508 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3511 std::string __str__() const throw(INTERP_KERNEL::Exception)
3513 return self->simpleRepr();
3515 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3517 std::ostringstream oss;
3518 self->reprQuickOverview(oss);
3524 //== MEDCouplingIMesh End
3528 namespace ParaMEDMEM
3530 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3533 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3534 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3535 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3536 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3537 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3538 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3539 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3540 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3541 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3542 std::string getName() const throw(INTERP_KERNEL::Exception);
3543 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3544 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3545 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3546 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3547 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3548 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3549 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3550 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3551 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3552 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3553 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3554 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3555 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3556 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3557 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3558 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3560 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3562 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3565 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3568 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3570 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3573 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3576 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3578 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3579 return convertIntArrToPyList3(ret);
3582 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3585 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3586 PyObject *ret=PyTuple_New(2);
3587 PyObject *ret0Py=ret0?Py_True:Py_False;
3589 PyTuple_SetItem(ret,0,ret0Py);
3590 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3594 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3596 DataArrayInt *ret1=0;
3597 MEDCouplingMesh *ret0=0;
3599 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3600 if (!SWIG_IsOK(res1))
3603 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3604 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3608 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3610 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3611 da2->checkAllocated();
3612 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3614 PyObject *res = PyList_New(2);
3615 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3616 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3620 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3622 DataArrayInt *ret1=0;
3624 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3625 PyObject *res=PyTuple_New(2);
3626 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3628 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3631 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3632 PyTuple_SetItem(res,1,res1);
3637 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3640 int v0; std::vector<int> v1;
3641 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3642 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3645 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3646 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3649 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3650 if (!SWIG_IsOK(res1))
3653 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3654 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3658 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3660 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3661 da2->checkAllocated();
3662 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3666 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3668 std::vector<int> tmp;
3669 self->getCellIdsHavingGaussLocalization(locId,tmp);
3670 DataArrayInt *ret=DataArrayInt::New();
3671 ret->alloc((int)tmp.size(),1);
3672 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3673 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3676 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3678 std::vector<int> inp0;
3679 convertPyToNewIntArr4(code,1,3,inp0);
3680 std::vector<const DataArrayInt *> inp1;
3681 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3682 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3687 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3690 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3691 static MEDCouplingFieldTemplate *New(TypeOfField type);
3692 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3693 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3696 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3698 return MEDCouplingFieldTemplate::New(f);
3701 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3703 return MEDCouplingFieldTemplate::New(type);
3706 std::string __str__() const throw(INTERP_KERNEL::Exception)
3708 return self->simpleRepr();
3711 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3713 std::ostringstream oss;
3714 self->reprQuickOverview(oss);
3720 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3723 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3724 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3725 void setTimeUnit(const std::string& unit);
3726 std::string getTimeUnit() const;
3727 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3728 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3729 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3730 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3731 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3732 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3733 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3734 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3735 MEDCouplingFieldDouble *deepCpy() const;
3736 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3737 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3738 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3739 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3740 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3741 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3742 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3743 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3744 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3745 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3746 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3747 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3748 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3749 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3750 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3751 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3752 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3753 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3754 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3755 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3756 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3757 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3758 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3759 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3760 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3761 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3762 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3763 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3764 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3765 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3766 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3767 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3768 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3769 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3770 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3771 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3772 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3773 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3774 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3775 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3776 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3777 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3778 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3779 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3780 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3781 void fillFromAnalytic2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3782 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3783 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3784 void applyFunc2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3785 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3786 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3787 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3788 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3789 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3790 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3791 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3792 double getMinValue() const throw(INTERP_KERNEL::Exception);
3793 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3794 double norm2() const throw(INTERP_KERNEL::Exception);
3795 double normMax() const throw(INTERP_KERNEL::Exception);
3796 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3797 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3798 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3799 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3800 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3801 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3802 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3803 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3804 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3805 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3806 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3807 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3808 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3809 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3810 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3811 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3812 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3813 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3814 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3815 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3816 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3817 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3819 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3821 return MEDCouplingFieldDouble::New(type,td);
3824 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3826 return MEDCouplingFieldDouble::New(ft,td);
3829 std::string __str__() const throw(INTERP_KERNEL::Exception)
3831 return self->simpleRepr();
3834 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3836 std::ostringstream oss;
3837 self->reprQuickOverview(oss);
3841 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3843 DataArrayDouble *ret=self->getArray();
3849 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3851 std::vector<DataArrayDouble *> arrs=self->getArrays();
3852 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3856 PyObject *ret=PyTuple_New(sz);
3857 for(int i=0;i<sz;i++)
3860 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3862 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3867 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3869 std::vector<const DataArrayDouble *> tmp;
3870 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3872 std::vector<DataArrayDouble *> arrs(sz);
3873 for(int i=0;i<sz;i++)
3874 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3875 self->setArrays(arrs);
3878 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3880 DataArrayDouble *ret=self->getEndArray();
3886 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3890 DataArrayDoubleTuple *aa;
3891 std::vector<double> bb;
3893 const MEDCouplingMesh *mesh=self->getMesh();
3895 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3896 int spaceDim=mesh->getSpaceDimension();
3897 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3898 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3900 int sz=self->getNumberOfComponents();
3901 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3902 self->getValueOn(spaceLoc,res);
3903 return convertDblArrToPyList(res,sz);
3906 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3908 int sz=self->getNumberOfComponents();
3909 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3910 self->getValueOnPos(i,j,k,res);
3911 return convertDblArrToPyList(res,sz);
3914 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3916 const MEDCouplingMesh *mesh(self->getMesh());
3918 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3921 double v0; ParaMEDMEM::DataArrayDouble *v1(0); ParaMEDMEM::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3922 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3923 mesh->getSpaceDimension(),true,nbPts);
3924 return self->getValueOnMulti(inp,nbPts);
3927 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3931 DataArrayDoubleTuple *aa;
3932 std::vector<double> bb;
3934 const MEDCouplingMesh *mesh=self->getMesh();
3936 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3937 int spaceDim=mesh->getSpaceDimension();
3938 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3939 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3942 int sz=self->getNumberOfComponents();
3943 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3944 self->getValueOn(spaceLoc,time,res);
3945 return convertDblArrToPyList(res,sz);
3948 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3950 if(self->getArray()!=0)
3951 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3954 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3955 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3956 self->setArray(arr);
3960 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3963 double tmp0=self->getTime(tmp1,tmp2);
3964 PyObject *res = PyList_New(3);
3965 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3966 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3967 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3971 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3974 double tmp0=self->getStartTime(tmp1,tmp2);
3975 PyObject *res = PyList_New(3);
3976 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3977 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3978 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3982 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3985 double tmp0=self->getEndTime(tmp1,tmp2);
3986 PyObject *res = PyList_New(3);
3987 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3988 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3989 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3992 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3994 int sz=self->getNumberOfComponents();
3995 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3996 self->accumulate(tmp);
3997 return convertDblArrToPyList(tmp,sz);
3999 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4001 int sz=self->getNumberOfComponents();
4002 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4003 self->integral(isWAbs,tmp);
4004 return convertDblArrToPyList(tmp,sz);
4006 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4008 int sz=self->getNumberOfComponents();
4009 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4010 self->getWeightedAverageValue(tmp,isWAbs);
4011 return convertDblArrToPyList(tmp,sz);
4013 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4015 int sz=self->getNumberOfComponents();
4016 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4018 return convertDblArrToPyList(tmp,sz);
4020 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4022 int sz=self->getNumberOfComponents();
4023 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4025 return convertDblArrToPyList(tmp,sz);
4027 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4029 int szArr,sw,iTypppArr;
4030 std::vector<int> stdvecTyyppArr;
4031 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4032 self->renumberCells(tmp,check);
4035 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4037 int szArr,sw,iTypppArr;
4038 std::vector<int> stdvecTyyppArr;
4039 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4040 self->renumberCellsWithoutMesh(tmp,check);
4043 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4045 int szArr,sw,iTypppArr;
4046 std::vector<int> stdvecTyyppArr;
4047 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4048 self->renumberNodes(tmp,eps);
4051 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4053 int szArr,sw,iTypppArr;
4054 std::vector<int> stdvecTyyppArr;
4055 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4056 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4059 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4063 std::vector<int> multiVal;
4064 std::pair<int, std::pair<int,int> > slic;
4065 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4066 const MEDCouplingMesh *mesh=self->getMesh();
4068 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4069 int nbc=mesh->getNumberOfCells();
4070 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4077 std::ostringstream oss;
4078 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4079 throw INTERP_KERNEL::Exception(oss.str().c_str());
4082 return self->buildSubPart(&singleVal,&singleVal+1);
4087 int tmp=nbc+singleVal;
4088 return self->buildSubPart(&tmp,&tmp+1);
4092 std::ostringstream oss;
4093 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4094 throw INTERP_KERNEL::Exception(oss.str().c_str());
4100 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4104 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4109 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4110 daIntTyypp->checkAllocated();
4111 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4114 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4118 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4120 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";
4121 if(PyTuple_Check(li))
4123 Py_ssize_t sz=PyTuple_Size(li);
4125 throw INTERP_KERNEL::Exception(msg);
4126 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4129 std::vector<int> multiVal;
4130 std::pair<int, std::pair<int,int> > slic;
4131 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4132 if(!self->getArray())
4133 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4135 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4136 catch(INTERP_KERNEL::Exception& e)
4137 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4138 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4139 DataArrayDouble *ret0Arr=ret0->getArray();
4141 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4146 std::vector<int> v2(1,singleVal);
4147 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4148 ret0->setArray(aarr);
4153 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4154 ret0->setArray(aarr);
4159 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4160 std::vector<int> v2(nbOfComp);
4161 for(int i=0;i<nbOfComp;i++)
4162 v2[i]=slic.first+i*slic.second.second;
4163 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4164 ret0->setArray(aarr);
4168 throw INTERP_KERNEL::Exception(msg);
4173 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
4176 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4179 double r1=self->getMaxValue2(tmp);
4180 PyObject *ret=PyTuple_New(2);
4181 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4182 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4186 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4189 double r1=self->getMinValue2(tmp);
4190 PyObject *ret=PyTuple_New(2);
4191 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4192 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4196 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4198 std::vector<int> tmp;
4199 convertPyToNewIntArr3(li,tmp);
4200 return self->keepSelectedComponents(tmp);
4203 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4205 std::vector<int> tmp;
4206 convertPyToNewIntArr3(li,tmp);
4207 self->setSelectedComponents(f,tmp);
4210 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4213 DataArrayDouble *a,*a2;
4214 DataArrayDoubleTuple *aa,*aa2;
4215 std::vector<double> bb,bb2;
4218 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4219 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4220 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4221 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4223 return self->extractSlice3D(orig,vect,eps);
4226 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4228 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
4231 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4233 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
4236 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4238 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.";
4239 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4242 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4244 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4246 return (*self)-(*other);
4248 throw INTERP_KERNEL::Exception(msg);
4253 DataArrayDoubleTuple *aa;
4254 std::vector<double> bb;
4256 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4261 if(!self->getArray())
4262 throw INTERP_KERNEL::Exception(msg2);
4263 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4264 ret->applyLin(1.,-val);
4265 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4266 ret2->setArray(ret);
4271 if(!self->getArray())
4272 throw INTERP_KERNEL::Exception(msg2);
4273 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4274 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4275 ret2->setArray(ret);
4280 if(!self->getArray())
4281 throw INTERP_KERNEL::Exception(msg2);
4282 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4283 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4284 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4285 ret2->setArray(ret);
4290 if(!self->getArray())
4291 throw INTERP_KERNEL::Exception(msg2);
4292 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4293 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4294 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4295 ret2->setArray(ret);
4299 { throw INTERP_KERNEL::Exception(msg); }
4303 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4305 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4308 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4310 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
4313 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4315 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4318 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4320 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.";
4321 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4324 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4326 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4328 return (*self)/(*other);
4330 throw INTERP_KERNEL::Exception(msg);
4335 DataArrayDoubleTuple *aa;
4336 std::vector<double> bb;
4338 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4344 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4345 if(!self->getArray())
4346 throw INTERP_KERNEL::Exception(msg2);
4347 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4348 ret->applyLin(1./val,0);
4349 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4350 ret2->setArray(ret);
4355 if(!self->getArray())
4356 throw INTERP_KERNEL::Exception(msg2);
4357 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4358 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4359 ret2->setArray(ret);
4364 if(!self->getArray())
4365 throw INTERP_KERNEL::Exception(msg2);
4366 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4367 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4368 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4369 ret2->setArray(ret);
4374 if(!self->getArray())
4375 throw INTERP_KERNEL::Exception(msg2);
4376 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4377 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4378 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4379 ret2->setArray(ret);
4383 { throw INTERP_KERNEL::Exception(msg); }
4387 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4389 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4392 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4394 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.";
4395 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4398 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4400 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4402 return (*self)^(*other);
4404 throw INTERP_KERNEL::Exception(msg);
4409 DataArrayDoubleTuple *aa;
4410 std::vector<double> bb;
4412 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4417 if(!self->getArray())
4418 throw INTERP_KERNEL::Exception(msg2);
4419 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4421 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4422 ret2->setArray(ret);
4427 if(!self->getArray())
4428 throw INTERP_KERNEL::Exception(msg2);
4429 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4430 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4431 ret2->setArray(ret);
4436 if(!self->getArray())
4437 throw INTERP_KERNEL::Exception(msg2);
4438 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4439 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4440 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4441 ret2->setArray(ret);
4446 if(!self->getArray())
4447 throw INTERP_KERNEL::Exception(msg2);
4448 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4449 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4450 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4451 ret2->setArray(ret);
4455 { throw INTERP_KERNEL::Exception(msg); }
4459 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4461 return self->negate();
4464 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4466 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.";
4467 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4470 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4472 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4476 Py_XINCREF(trueSelf);
4480 throw INTERP_KERNEL::Exception(msg);
4485 DataArrayDoubleTuple *aa;
4486 std::vector<double> bb;
4488 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4493 if(!self->getArray())
4494 throw INTERP_KERNEL::Exception(msg2);
4495 self->getArray()->applyLin(1.,val);
4496 Py_XINCREF(trueSelf);
4501 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4504 Py_XINCREF(trueSelf);
4509 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4510 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4511 ret2->setArray(aaa);
4513 Py_XINCREF(trueSelf);
4518 if(!self->getArray())
4519 throw INTERP_KERNEL::Exception(msg2);
4520 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4521 self->getArray()->addEqual(aaa);
4522 Py_XINCREF(trueSelf);
4526 { throw INTERP_KERNEL::Exception(msg); }
4530 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4532 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.";
4533 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4536 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4538 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4542 Py_XINCREF(trueSelf);
4546 throw INTERP_KERNEL::Exception(msg);
4551 DataArrayDoubleTuple *aa;
4552 std::vector<double> bb;
4554 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4559 if(!self->getArray())
4560 throw INTERP_KERNEL::Exception(msg2);
4561 self->getArray()->applyLin(1.,-val);
4562 Py_XINCREF(trueSelf);
4567 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4570 Py_XINCREF(trueSelf);
4575 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4576 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4577 ret2->setArray(aaa);
4579 Py_XINCREF(trueSelf);
4584 if(!self->getArray())
4585 throw INTERP_KERNEL::Exception(msg2);
4586 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4587 self->getArray()->substractEqual(aaa);
4588 Py_XINCREF(trueSelf);
4592 { throw INTERP_KERNEL::Exception(msg); }
4596 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4598 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.";
4599 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4602 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4604 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4608 Py_XINCREF(trueSelf);
4612 throw INTERP_KERNEL::Exception(msg);
4617 DataArrayDoubleTuple *aa;
4618 std::vector<double> bb;
4620 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4625 if(!self->getArray())
4626 throw INTERP_KERNEL::Exception(msg2);
4627 self->getArray()->applyLin(val,0);
4628 Py_XINCREF(trueSelf);
4633 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4636 Py_XINCREF(trueSelf);
4641 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4642 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4643 ret2->setArray(aaa);
4645 Py_XINCREF(trueSelf);
4650 if(!self->getArray())
4651 throw INTERP_KERNEL::Exception(msg2);
4652 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4653 self->getArray()->multiplyEqual(aaa);
4654 Py_XINCREF(trueSelf);
4658 { throw INTERP_KERNEL::Exception(msg); }
4662 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4664 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.";
4665 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4668 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4670 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4674 Py_XINCREF(trueSelf);
4678 throw INTERP_KERNEL::Exception(msg);
4683 DataArrayDoubleTuple *aa;
4684 std::vector<double> bb;
4686 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4692 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4693 if(!self->getArray())
4694 throw INTERP_KERNEL::Exception(msg2);
4695 self->getArray()->applyLin(1./val,0);
4696 Py_XINCREF(trueSelf);
4701 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4704 Py_XINCREF(trueSelf);
4709 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4710 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4711 ret2->setArray(aaa);
4713 Py_XINCREF(trueSelf);
4718 if(!self->getArray())
4719 throw INTERP_KERNEL::Exception(msg2);
4720 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4721 self->getArray()->divideEqual(aaa);
4722 Py_XINCREF(trueSelf);
4726 { throw INTERP_KERNEL::Exception(msg); }
4730 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4732 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.";
4733 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4736 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4738 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4742 Py_XINCREF(trueSelf);
4746 throw INTERP_KERNEL::Exception(msg);
4751 DataArrayDoubleTuple *aa;
4752 std::vector<double> bb;
4754 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4759 if(!self->getArray())
4760 throw INTERP_KERNEL::Exception(msg2);
4761 self->getArray()->applyPow(val);
4762 Py_XINCREF(trueSelf);
4767 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4770 Py_XINCREF(trueSelf);
4775 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4776 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4777 ret2->setArray(aaa);
4779 Py_XINCREF(trueSelf);
4784 if(!self->getArray())
4785 throw INTERP_KERNEL::Exception(msg2);
4786 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4787 self->getArray()->powEqual(aaa);
4788 Py_XINCREF(trueSelf);
4792 { throw INTERP_KERNEL::Exception(msg); }
4796 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4798 std::vector<const MEDCouplingFieldDouble *> tmp;
4799 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4800 return MEDCouplingFieldDouble::MergeFields(tmp);
4803 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4805 std::vector<const MEDCouplingFieldDouble *> tmp;
4806 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4807 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4810 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4812 std::vector<double> a0;
4813 std::vector<int> a1;
4814 std::vector<std::string> a2;
4815 self->getTinySerializationDbleInformation(a0);
4816 self->getTinySerializationIntInformation(a1);
4817 self->getTinySerializationStrInformation(a2);
4819 PyObject *ret(PyTuple_New(3));
4820 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4821 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
4823 PyObject *ret2(PyList_New(sz));
4825 for(int i=0;i<sz;i++)
4826 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
4828 PyTuple_SetItem(ret,2,ret2);
4832 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
4834 DataArrayInt *ret0(0);
4835 std::vector<DataArrayDouble *> ret1;
4836 self->serialize(ret0,ret1);
4839 std::size_t sz(ret1.size());
4840 PyObject *ret(PyTuple_New(2));
4841 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4842 PyObject *ret1Py(PyList_New(sz));
4843 for(std::size_t i=0;i<sz;i++)
4847 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4849 PyTuple_SetItem(ret,1,ret1Py);
4853 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
4855 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
4856 if(!PyTuple_Check(args))
4857 throw INTERP_KERNEL::Exception(MSG);
4858 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
4859 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
4860 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
4862 PyObject *tmp0(PyTuple_New(1));
4863 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
4864 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
4866 Py_DECREF(selfMeth);
4867 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
4868 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
4869 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
4871 PyObject *a(PyInt_FromLong(0));
4872 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
4875 throw INTERP_KERNEL::Exception(MSG);
4876 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
4877 throw INTERP_KERNEL::Exception(MSG);
4878 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
4881 Py_DECREF(initMeth);
4886 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
4887 {// put an empty dict in input to say to __new__ to call __init__...
4888 self->checkCoherency();
4889 PyObject *ret(PyTuple_New(1));
4890 PyObject *ret0(PyDict_New());
4892 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
4893 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
4894 PyDict_SetItem(ret0,a,d);
4895 Py_DECREF(a); Py_DECREF(d);
4897 PyTuple_SetItem(ret,0,ret0);
4901 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
4903 self->checkCoherency();
4904 PyObject *ret0(ParaMEDMEM_MEDCouplingFieldDouble_getTinySerializationInformation(self));
4905 PyObject *ret1(ParaMEDMEM_MEDCouplingFieldDouble_serialize(self));
4906 const MEDCouplingMesh *mesh(self->getMesh());
4909 PyObject *ret(PyTuple_New(3));
4910 PyTuple_SetItem(ret,0,ret0);
4911 PyTuple_SetItem(ret,1,ret1);
4912 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
4916 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
4918 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
4919 if(!PyTuple_Check(inp))
4920 throw INTERP_KERNEL::Exception(MSG);
4921 int sz(PyTuple_Size(inp));
4923 throw INTERP_KERNEL::Exception(MSG);
4925 PyObject *elt2(PyTuple_GetItem(inp,2));
4927 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,0|0));
4928 if(!SWIG_IsOK(status))
4929 throw INTERP_KERNEL::Exception(MSG);
4930 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
4932 PyObject *elt0(PyTuple_GetItem(inp,0));
4933 PyObject *elt1(PyTuple_GetItem(inp,1));
4934 std::vector<double> a0;
4935 std::vector<int> a1;
4936 std::vector<std::string> a2;
4937 DataArrayInt *b0(0);
4938 std::vector<DataArrayDouble *>b1;
4940 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
4941 throw INTERP_KERNEL::Exception(MSG);
4942 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
4944 fillArrayWithPyListDbl3(a0py,tmp,a0);
4945 convertPyToNewIntArr3(a1py,a1);
4946 fillStringVector(a2py,a2);
4949 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
4950 throw INTERP_KERNEL::Exception(MSG);
4951 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
4953 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0));
4954 if(!SWIG_IsOK(status))
4955 throw INTERP_KERNEL::Exception(MSG);
4956 b0=reinterpret_cast<DataArrayInt *>(argp);
4957 convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayDouble *>(b1py,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",b1);
4959 self->checkForUnserialization(a1,b0,b1);
4960 // useless here to call resizeForUnserialization because arrays are well resized.
4961 self->finishUnserialization(a1,a0,a2);
4966 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4969 int getNumberOfFields() const;
4970 MEDCouplingMultiFields *deepCpy() const;
4971 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4972 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4973 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4974 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4975 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4978 std::string __str__() const throw(INTERP_KERNEL::Exception)
4980 return self->simpleRepr();
4982 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4984 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4985 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4987 std::vector<MEDCouplingFieldDouble *> fs(sz);
4988 for(int i=0;i<sz;i++)
4989 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4990 return MEDCouplingMultiFields::New(fs);
4992 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4994 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4995 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4997 std::vector<MEDCouplingFieldDouble *> fs(sz);
4998 for(int i=0;i<sz;i++)
4999 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5000 return MEDCouplingMultiFields::New(fs);
5002 PyObject *getFields() const
5004 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5005 int sz=fields.size();
5006 PyObject *res = PyList_New(sz);
5007 for(int i=0;i<sz;i++)
5011 fields[i]->incrRef();
5012 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5016 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
5021 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5023 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5027 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5030 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
5032 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5034 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5036 PyObject *res = PyList_New(sz);
5037 for(int i=0;i<sz;i++)
5042 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5046 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
5051 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5053 std::vector<int> refs;
5054 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5056 PyObject *res = PyList_New(sz);
5057 for(int i=0;i<sz;i++)
5062 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5066 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
5070 PyObject *ret=PyTuple_New(2);
5071 PyTuple_SetItem(ret,0,res);
5072 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5075 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5077 std::vector<DataArrayDouble *> ms=self->getArrays();
5079 PyObject *res = PyList_New(sz);
5080 for(int i=0;i<sz;i++)
5085 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5089 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
5094 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5096 std::vector< std::vector<int> > refs;
5097 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5099 PyObject *res = PyList_New(sz);
5100 PyObject *res2 = PyList_New(sz);
5101 for(int i=0;i<sz;i++)
5106 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5110 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
5112 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5115 PyObject *ret=PyTuple_New(2);
5116 PyTuple_SetItem(ret,0,res);
5117 PyTuple_SetItem(ret,1,res2);
5123 class MEDCouplingDefinitionTime
5126 MEDCouplingDefinitionTime();
5127 void assign(const MEDCouplingDefinitionTime& other);
5128 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5129 double getTimeResolution() const;
5130 std::vector<double> getHotSpotsTime() const;
5133 std::string __str__() const throw(INTERP_KERNEL::Exception)
5135 std::ostringstream oss;
5136 self->appendRepr(oss);
5140 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5142 int meshId,arrId,arrIdInField,fieldId;
5143 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5144 PyObject *res=PyList_New(4);
5145 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5146 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5147 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5148 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5152 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5154 int meshId,arrId,arrIdInField,fieldId;
5155 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5156 PyObject *res=PyList_New(4);
5157 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5158 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5159 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5160 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5166 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5169 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5170 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5174 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5176 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
5177 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5179 std::vector<MEDCouplingFieldDouble *> fs(sz);
5180 for(int i=0;i<sz;i++)
5181 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5182 return MEDCouplingFieldOverTime::New(fs);
5184 std::string __str__() const throw(INTERP_KERNEL::Exception)
5186 return self->simpleRepr();
5188 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5190 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
5191 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5193 std::vector<MEDCouplingFieldDouble *> fs(sz);
5194 for(int i=0;i<sz;i++)
5195 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5196 return MEDCouplingFieldOverTime::New(fs);
5201 class MEDCouplingCartesianAMRMesh;
5203 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5206 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5207 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5208 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5211 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5213 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5221 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5224 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5225 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5226 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5229 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5231 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5232 return convertFromVectorPairInt(ret);
5235 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5237 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5238 return convertFromVectorPairInt(ret);
5241 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5243 std::vector< std::pair<int,int> > inp;
5244 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5245 self->addPatch(inp,factors);
5248 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5250 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5252 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5253 if(patchId==mesh->getNumberOfPatches())
5255 std::ostringstream oss;
5256 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5257 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5260 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5266 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5268 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5270 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5271 mesh->removePatch(patchId);
5274 int __len__() const throw(INTERP_KERNEL::Exception)
5276 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5278 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5279 return mesh->getNumberOfPatches();
5284 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5288 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5291 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5292 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5293 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5294 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5295 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5296 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5297 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5298 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5299 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5300 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5301 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5302 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5303 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5305 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5306 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5307 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5308 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5309 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5310 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5311 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5312 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5313 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5314 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5315 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5316 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5317 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5318 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5319 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5320 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5321 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5322 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5323 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5324 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5327 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5329 std::vector< std::pair<int,int> > inp;
5330 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5331 self->addPatch(inp,factors);
5334 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5336 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5338 PyObject *ret = PyList_New(sz);
5339 for(int i=0;i<sz;i++)
5341 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5344 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5349 // agy : don't know why typemap fails here ??? let it in the extend section
5350 PyObject *deepCpy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5352 return convertCartesianAMRMesh(self->deepCpy(father), SWIG_POINTER_OWN | 0 );
5355 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5357 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5358 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5364 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5366 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5367 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5373 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5375 std::vector<int> out1;
5376 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5377 PyObject *ret(PyTuple_New(2));
5378 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5379 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5383 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5385 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5387 PyObject *ret = PyList_New(sz);
5388 for(int i=0;i<sz;i++)
5389 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5393 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5395 std::vector<const DataArrayDouble *> inp;
5396 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",inp);
5397 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5400 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5402 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5408 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5410 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5416 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5418 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5424 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5426 const MEDCouplingIMesh *ret(self->getImageMesh());
5429 return const_cast<MEDCouplingIMesh *>(ret);
5432 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5434 if(patchId==self->getNumberOfPatches())
5436 std::ostringstream oss;
5437 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5438 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5441 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5447 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5449 std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
5450 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5451 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5454 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5456 std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
5457 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5458 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5461 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5463 self->removePatch(patchId);
5466 int __len__() const throw(INTERP_KERNEL::Exception)
5468 return self->getNumberOfPatches();
5473 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5477 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5480 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5483 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5485 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5486 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5487 const int *nodeStrctPtr(0);
5488 const double *originPtr(0),*dxyzPtr(0);
5490 std::vector<int> bb0;
5491 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5494 std::vector<double> bb,bb2;
5496 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5497 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5499 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5502 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5504 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5505 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5506 std::vector< std::vector<int> > inp2;
5507 convertPyToVectorOfVectorOfInt(factors,inp2);
5508 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5511 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5513 return ParaMEDMEM_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5516 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5518 return MEDCouplingCartesianAMRMesh::New(mesh);
5523 class MEDCouplingDataForGodFather : public RefCountObject
5526 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5527 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5528 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5529 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5530 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5531 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5532 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5533 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5534 virtual void alloc() throw(INTERP_KERNEL::Exception);
5535 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5538 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5540 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5548 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5551 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5552 MEDCouplingAMRAttribute *deepCpy() const throw(INTERP_KERNEL::Exception);
5553 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5554 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5555 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5556 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5557 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5558 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5559 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5562 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5564 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5565 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5566 MEDCouplingAMRAttribute *ret(0);
5569 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5570 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5572 catch(INTERP_KERNEL::Exception&)
5574 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5575 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5580 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5582 return ParaMEDMEM_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5585 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5587 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5588 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5594 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5596 std::vector< std::vector<std::string> > compNamesCpp;
5597 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5598 self->spillInfoOnComponents(compNamesCpp);
5601 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5603 std::vector<int> inp0;
5604 if(!fillIntVector(nfs,inp0))
5605 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5606 std::size_t sz(inp0.size());
5607 std::vector<NatureOfField> inp00(sz);
5608 for(std::size_t i=0;i<sz;i++)
5609 inp00[i]=(NatureOfField)inp0[i];
5610 self->spillNatures(inp00);
5613 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5615 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5616 int sz((int)ret.size());
5617 PyObject *retPy(PyList_New(sz));
5618 for(int i=0;i<sz;i++)
5619 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5625 class DenseMatrix : public RefCountObject, public TimeLabel
5628 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5629 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5630 DenseMatrix *deepCpy() const throw(INTERP_KERNEL::Exception);
5631 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5633 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5634 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5635 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5636 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5637 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5638 void transpose() throw(INTERP_KERNEL::Exception);
5640 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5641 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5642 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5645 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5647 return DenseMatrix::New(nbRows,nbCols);
5650 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5652 return DenseMatrix::New(array,nbRows,nbCols);
5655 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5658 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5659 PyObject *ret=PyTuple_New(2);
5660 PyObject *ret0Py=ret0?Py_True:Py_False;
5662 PyTuple_SetItem(ret,0,ret0Py);
5663 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5667 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5669 DataArrayDouble *ret(self->getData());
5675 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5677 return ParaMEDMEM::DenseMatrix::Add(self,other);
5680 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5682 return ParaMEDMEM::DenseMatrix::Substract(self,other);
5685 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5687 return ParaMEDMEM::DenseMatrix::Multiply(self,other);
5690 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5692 return ParaMEDMEM::DenseMatrix::Multiply(self,other);
5695 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5697 self->addEqual(other);
5698 Py_XINCREF(trueSelf);
5702 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5704 self->substractEqual(other);
5705 Py_XINCREF(trueSelf);
5709 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5711 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5718 class PartDefinition : public RefCountObject, public TimeLabel
5721 static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5722 static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5723 virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
5724 virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
5725 virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
5726 virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
5727 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
5728 virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
5731 virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
5733 return (*self)+other;
5736 virtual PyObject *isEqual(const PartDefinition *other) const throw(INTERP_KERNEL::Exception)
5739 bool ret0(self->isEqual(other,ret1));
5740 PyObject *ret=PyTuple_New(2);
5741 PyObject *ret0Py=ret0?Py_True:Py_False;
5743 PyTuple_SetItem(ret,0,ret0Py);
5744 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5748 virtual PyObject *deepCpy() const throw(INTERP_KERNEL::Exception)
5750 return convertPartDefinition(self->deepCpy(),SWIG_POINTER_OWN | 0);
5754 virtual ~PartDefinition();
5757 class DataArrayPartDefinition : public PartDefinition
5760 static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5763 DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
5765 return DataArrayPartDefinition::New(listOfIds);
5768 std::string __str__() const throw(INTERP_KERNEL::Exception)
5770 return self->getRepr();
5773 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5775 std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
5776 oss << self->getRepr();
5781 virtual ~DataArrayPartDefinition();
5784 class SlicePartDefinition : public PartDefinition
5787 static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5788 int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
5791 SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
5793 return SlicePartDefinition::New(start,stop,step);
5796 PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
5799 self->getSlice(a,b,c);
5800 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
5803 std::string __str__() const throw(INTERP_KERNEL::Exception)
5805 return self->getRepr();
5808 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5810 std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
5811 oss << self->getRepr();
5816 virtual ~SlicePartDefinition();
5822 __filename=os.environ.get('PYTHONSTARTUP')
5823 if __filename and os.path.isfile(__filename):
5824 execfile(__filename)