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::computeDiameterField;
264 %newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
265 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
266 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
267 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
268 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
269 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
270 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
271 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
272 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
273 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
274 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
275 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
276 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
277 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
278 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
279 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
280 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
281 %newobject ParaMEDMEM::MEDCouplingUMesh::conformize2D;
282 %newobject ParaMEDMEM::MEDCouplingUMesh::colinearize2D;
283 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
284 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
285 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
286 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
287 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
288 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
289 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
290 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
291 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
292 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
293 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
294 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
295 %newobject ParaMEDMEM::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
296 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
297 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
298 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
299 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
300 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
301 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
302 %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
303 %newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
304 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
305 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
306 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
307 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
308 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
309 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
310 %newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf2DMesh;
311 %newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf3DMesh;
312 %newobject ParaMEDMEM::MEDCouplingUMesh::orderConsecutiveCells1D;
313 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
314 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
315 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
316 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
317 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
318 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
319 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::getNodalConnectivity;
320 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
321 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::New;
322 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
323 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::computeDualMesh;
324 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
325 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::sortHexa8EachOther;
326 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
327 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
328 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::New;
329 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
330 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
331 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
332 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
333 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
334 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
335 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::buildStructuredSubPart;
336 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTUnstructured;
337 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
338 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
339 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
340 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
341 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
342 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::ComputeCornersGhost;
343 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
344 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
345 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
346 %newobject ParaMEDMEM::MEDCouplingIMesh::New;
347 %newobject ParaMEDMEM::MEDCouplingIMesh::asSingleCell;
348 %newobject ParaMEDMEM::MEDCouplingIMesh::buildWithGhost;
349 %newobject ParaMEDMEM::MEDCouplingIMesh::convertToCartesian;
350 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
351 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
352 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
353 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
354 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
355 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
356 %newobject ParaMEDMEM::MEDCouplingCartesianAMRPatchGen::getMesh;
357 %newobject ParaMEDMEM::MEDCouplingCartesianAMRPatchGen::__getitem__;
358 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::deepCpy;
359 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
360 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
361 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
362 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
363 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getImageMesh;
364 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getGodFather;
365 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getFather;
366 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getPatch;
367 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
368 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
369 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
370 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
371 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::__getitem__;
372 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::New;
373 %newobject ParaMEDMEM::MEDCouplingDataForGodFather::getMyGodFather;
374 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::New;
375 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::deepCpy;
376 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
377 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::getFieldOn;
378 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::projectTo;
379 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
380 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
381 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
382 %newobject ParaMEDMEM::DenseMatrix::New;
383 %newobject ParaMEDMEM::DenseMatrix::deepCpy;
384 %newobject ParaMEDMEM::DenseMatrix::shallowCpy;
385 %newobject ParaMEDMEM::DenseMatrix::getData;
386 %newobject ParaMEDMEM::DenseMatrix::matVecMult;
387 %newobject ParaMEDMEM::DenseMatrix::MatVecMult;
388 %newobject ParaMEDMEM::DenseMatrix::__add__;
389 %newobject ParaMEDMEM::DenseMatrix::__sub__;
390 %newobject ParaMEDMEM::DenseMatrix::__mul__;
391 %newobject ParaMEDMEM::PartDefinition::New;
392 %newobject ParaMEDMEM::PartDefinition::toDAI;
393 %newobject ParaMEDMEM::PartDefinition::__add__;
394 %newobject ParaMEDMEM::PartDefinition::composeWith;
395 %newobject ParaMEDMEM::PartDefinition::tryToSimplify;
396 %newobject ParaMEDMEM::DataArrayPartDefinition::New;
397 %newobject ParaMEDMEM::SlicePartDefinition::New;
399 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
400 %feature("unref") MEDCouplingMesh "$this->decrRef();"
401 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
402 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
403 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
404 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
405 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
406 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
407 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
408 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
409 %feature("unref") MEDCouplingField "$this->decrRef();"
410 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
411 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
412 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
413 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
414 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
415 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
416 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
417 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
418 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
419 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
420 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
421 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
422 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
423 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
424 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
425 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
426 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
427 %feature("unref") DenseMatrix "$this->decrRef();"
428 %feature("unref") PartDefinition "$this->decrRef();"
429 %feature("unref") DataArrayPartDefinition "$this->decrRef();"
430 %feature("unref") SlicePartDefinition "$this->decrRef();"
432 %rename(assign) *::operator=;
433 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
434 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
435 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
436 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
440 %rename (InterpKernelException) INTERP_KERNEL::Exception;
442 %include "MEDCouplingRefCountObject.i"
443 %include "MEDCouplingMemArray.i"
445 namespace INTERP_KERNEL
448 * \class BoxSplittingOptions
449 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
451 class BoxSplittingOptions
454 BoxSplittingOptions();
455 void init() throw(INTERP_KERNEL::Exception);
456 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
457 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
458 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
459 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
460 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
461 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
462 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
463 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
464 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
465 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
466 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
467 std::string printOptions() const throw(INTERP_KERNEL::Exception);
470 std::string __str__() const throw(INTERP_KERNEL::Exception)
472 return self->printOptions();
494 CONST_ON_TIME_INTERVAL = 7
495 } TypeOfTimeDiscretization;
503 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
504 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
506 } MEDCouplingMeshType;
509 class DataArrayDouble;
510 class MEDCouplingUMesh;
511 class MEDCouplingFieldDouble;
513 %extend RefCountObject
515 std::string getHiddenCppPointer() const
517 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
522 %extend MEDCouplingGaussLocalization
524 std::string __str__() const throw(INTERP_KERNEL::Exception)
526 return self->getStringRepr();
529 std::string __repr__() const throw(INTERP_KERNEL::Exception)
531 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
532 oss << self->getStringRepr();
539 class MEDCouplingMesh : public RefCountObject, public TimeLabel
542 void setName(const std::string& name);
543 std::string getName() const;
544 void setDescription(const std::string& descr);
545 std::string getDescription() const;
546 void setTime(double val, int iteration, int order);
547 void setTimeUnit(const std::string& unit);
548 std::string getTimeUnit() const;
549 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
550 bool isStructured() const throw(INTERP_KERNEL::Exception);
551 virtual MEDCouplingMesh *deepCpy() const;
552 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
553 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
554 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
555 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
556 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
557 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
558 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
559 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
560 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
561 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
562 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
563 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
564 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
565 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
566 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
567 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
568 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
569 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
570 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
571 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
572 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
573 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
574 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
575 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
576 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
577 virtual std::string getVTKFileExtension() const;
578 std::string getVTKFileNameOf(const std::string& fileName) const;
580 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
581 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
582 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
583 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
584 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
585 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
586 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
587 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
588 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
589 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
590 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);
591 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
592 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
593 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
594 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
595 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
596 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
597 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
600 std::string __str__() const throw(INTERP_KERNEL::Exception)
602 return self->simpleRepr();
605 PyObject *getTime() throw(INTERP_KERNEL::Exception)
608 double tmp0=self->getTime(tmp1,tmp2);
609 PyObject *res = PyList_New(3);
610 PyList_SetItem(res,0,SWIG_From_double(tmp0));
611 PyList_SetItem(res,1,SWIG_From_int(tmp1));
612 PyList_SetItem(res,2,SWIG_From_int(tmp2));
616 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
620 DataArrayDoubleTuple *aa;
621 std::vector<double> bb;
623 int spaceDim=self->getSpaceDimension();
624 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
625 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
626 return self->getCellContainingPoint(pos,eps);
629 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
633 DataArrayDoubleTuple *aa;
634 std::vector<double> bb;
636 int spaceDim=self->getSpaceDimension();
637 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
638 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
639 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
640 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
641 PyObject *ret=PyTuple_New(2);
642 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
643 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
647 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
649 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
650 int spaceDim=self->getSpaceDimension();
652 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
653 if (!SWIG_IsOK(res1))
656 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
657 int nbOfPoints=size/spaceDim;
660 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
662 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
666 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
668 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
669 da2->checkAllocated();
670 int size=da2->getNumberOfTuples();
671 int nbOfCompo=da2->getNumberOfComponents();
672 if(nbOfCompo!=spaceDim)
674 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
676 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
678 PyObject *ret=PyTuple_New(2);
679 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
680 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
684 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
688 DataArrayDoubleTuple *aa;
689 std::vector<double> bb;
691 int spaceDim=self->getSpaceDimension();
692 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
693 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
694 std::vector<int> elts;
695 self->getCellsContainingPoint(pos,eps,elts);
696 DataArrayInt *ret=DataArrayInt::New();
697 ret->alloc((int)elts.size(),1);
698 std::copy(elts.begin(),elts.end(),ret->getPointer());
699 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
702 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
704 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
705 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
706 self->getReverseNodalConnectivity(d0,d1);
707 PyObject *ret=PyTuple_New(2);
708 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
709 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
713 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
716 int v0; std::vector<int> v1;
717 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
718 self->renumberCells(ids,check);
721 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
723 DataArrayInt *cellCor, *nodeCor;
724 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
725 PyObject *res = PyList_New(2);
726 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
727 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
731 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
733 DataArrayInt *cellCor=0,*nodeCor=0;
734 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
735 PyObject *res = PyList_New(2);
736 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
737 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
741 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
743 DataArrayInt *cellCor=0;
744 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
748 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
751 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
752 if (!SWIG_IsOK(res1))
755 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
756 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
760 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
762 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
763 da2->checkAllocated();
764 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
767 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
769 std::vector<int> conn;
770 self->getNodeIdsOfCell(cellId,conn);
771 return convertIntArrToPyList2(conn);
774 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
776 std::vector<double> coo;
777 self->getCoordinatesOfNode(nodeId,coo);
778 return convertDblArrToPyList2(coo);
781 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
785 DataArrayDoubleTuple *aa;
786 std::vector<double> bb;
788 int spaceDim=self->getSpaceDimension();
789 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
790 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
791 self->scale(pointPtr,factor);
794 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
796 int spaceDim=self->getSpaceDimension();
797 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
798 self->getBoundingBox(tmp);
799 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
803 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
806 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
807 PyObject *ret=PyTuple_New(2);
808 PyObject *ret0Py=ret0?Py_True:Py_False;
810 PyTuple_SetItem(ret,0,ret0Py);
811 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
815 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
817 int szArr,sw,iTypppArr;
818 std::vector<int> stdvecTyyppArr;
819 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
820 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
821 if(sw==3)//DataArrayInt
823 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
824 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
825 std::string name=argpt->getName();
827 ret->setName(name.c_str());
829 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
832 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
834 int szArr,sw,iTypppArr;
835 std::vector<int> stdvecTyyppArr;
837 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
838 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
839 if(sw==3)//DataArrayInt
841 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
842 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
843 std::string name=argpt->getName();
845 ret->setName(name.c_str());
848 PyObject *res = PyList_New(2);
849 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
850 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
851 PyList_SetItem(res,0,obj0);
852 PyList_SetItem(res,1,obj1);
856 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
860 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
861 PyObject *res = PyTuple_New(2);
862 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
865 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
867 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
868 PyTuple_SetItem(res,0,obj0);
869 PyTuple_SetItem(res,1,obj1);
873 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
875 std::vector<int> vals=self->getDistributionOfTypes();
877 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
878 PyObject *ret=PyList_New((int)vals.size()/3);
879 for(int j=0;j<(int)vals.size()/3;j++)
881 PyObject *ret1=PyList_New(3);
882 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
883 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
884 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
885 PyList_SetItem(ret,j,ret1);
890 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
892 std::vector<int> code;
893 std::vector<const DataArrayInt *> idsPerType;
894 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
895 convertPyToNewIntArr4(li,1,3,code);
896 return self->checkTypeConsistencyAndContig(code,idsPerType);
899 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
901 std::vector<int> code;
902 std::vector<DataArrayInt *> idsInPflPerType;
903 std::vector<DataArrayInt *> idsPerType;
904 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
905 PyObject *ret=PyTuple_New(3);
908 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
909 PyObject *ret0=PyList_New((int)code.size()/3);
910 for(int j=0;j<(int)code.size()/3;j++)
912 PyObject *ret00=PyList_New(3);
913 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
914 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
915 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
916 PyList_SetItem(ret0,j,ret00);
918 PyTuple_SetItem(ret,0,ret0);
920 PyObject *ret1=PyList_New(idsInPflPerType.size());
921 for(std::size_t j=0;j<idsInPflPerType.size();j++)
922 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
923 PyTuple_SetItem(ret,1,ret1);
924 int n=idsPerType.size();
925 PyObject *ret2=PyList_New(n);
927 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
928 PyTuple_SetItem(ret,2,ret2);
932 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
936 DataArrayDoubleTuple *aa;
937 std::vector<double> bb;
939 int spaceDim=self->getSpaceDimension();
940 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
941 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
942 self->translate(vectorPtr);
945 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
947 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
950 DataArrayDoubleTuple *aa;
951 std::vector<double> bb;
953 int spaceDim=self->getSpaceDimension();
954 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
955 self->rotate(centerPtr,0,alpha);
958 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
960 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
962 DataArrayDouble *a,*a2;
963 DataArrayDoubleTuple *aa,*aa2;
964 std::vector<double> bb,bb2;
966 int spaceDim=self->getSpaceDimension();
967 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
968 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
969 self->rotate(centerPtr,vectorPtr,alpha);
972 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
974 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
975 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
976 PyObject *res=PyList_New(result.size());
977 for(int i=0;iL!=result.end(); i++, iL++)
978 PyList_SetItem(res,i,PyInt_FromLong(*iL));
982 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
984 std::vector<double> a0;
986 std::vector<std::string> a2;
987 self->getTinySerializationInformation(a0,a1,a2);
988 PyObject *ret(PyTuple_New(3));
989 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
990 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
992 PyObject *ret2(PyList_New(sz));
994 for(int i=0;i<sz;i++)
995 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
997 PyTuple_SetItem(ret,2,ret2);
1001 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1003 DataArrayInt *a0Tmp(0);
1004 DataArrayDouble *a1Tmp(0);
1005 self->serialize(a0Tmp,a1Tmp);
1006 PyObject *ret(PyTuple_New(2));
1007 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1008 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1012 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1014 std::vector<std::string> littleStrings;
1015 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1018 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1019 {// put an empty dict in input to say to __new__ to call __init__...
1020 PyObject *ret(PyTuple_New(1));
1021 PyObject *ret0(PyDict_New());
1022 PyTuple_SetItem(ret,0,ret0);
1026 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1028 PyObject *ret0(ParaMEDMEM_MEDCouplingMesh_getTinySerializationInformation(self));
1029 PyObject *ret1(ParaMEDMEM_MEDCouplingMesh_serialize(self));
1030 PyObject *ret(PyTuple_New(2));
1031 PyTuple_SetItem(ret,0,ret0);
1032 PyTuple_SetItem(ret,1,ret1);
1036 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1038 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1039 if(!PyTuple_Check(inp))
1040 throw INTERP_KERNEL::Exception(MSG);
1041 int sz(PyTuple_Size(inp));
1043 throw INTERP_KERNEL::Exception(MSG);
1044 PyObject *elt0(PyTuple_GetItem(inp,0));
1045 PyObject *elt1(PyTuple_GetItem(inp,1));
1046 std::vector<double> a0;
1047 std::vector<int> a1;
1048 std::vector<std::string> a2;
1049 DataArrayInt *b0(0);
1050 DataArrayDouble *b1(0);
1052 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1053 throw INTERP_KERNEL::Exception(MSG);
1054 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1056 fillArrayWithPyListDbl3(a0py,tmp,a0);
1057 convertPyToNewIntArr3(a1py,a1);
1058 fillStringVector(a2py,a2);
1061 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1062 throw INTERP_KERNEL::Exception(MSG);
1063 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1065 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0));
1066 if(!SWIG_IsOK(status))
1067 throw INTERP_KERNEL::Exception(MSG);
1068 b0=reinterpret_cast<DataArrayInt *>(argp);
1069 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0);
1070 if(!SWIG_IsOK(status))
1071 throw INTERP_KERNEL::Exception(MSG);
1072 b1=reinterpret_cast<DataArrayDouble *>(argp);
1074 // useless here to call resizeForUnserialization because arrays are well resized.
1075 self->unserialization(a0,a1,b0,b1,a2);
1078 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1080 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
1081 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1082 return MEDCouplingMesh::MergeMeshes(tmp);
1088 //== MEDCouplingMesh End
1090 %include "NormalizedGeometricTypes"
1091 %include "MEDCouplingNatureOfFieldEnum"
1093 namespace ParaMEDMEM
1095 class MEDCouplingNatureOfField
1098 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1099 static std::string GetReprNoThrow(NatureOfField nat);
1100 static std::string GetAllPossibilitiesStr();
1104 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1105 // include "MEDCouplingTimeDiscretization.i"
1107 namespace ParaMEDMEM
1109 class MEDCouplingGaussLocalization
1112 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1113 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1114 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1115 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1116 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1117 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1118 int getDimension() const throw(INTERP_KERNEL::Exception);
1119 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1120 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1121 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1122 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1124 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1125 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1126 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1127 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1128 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1129 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1130 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1131 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1132 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1133 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1134 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1135 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1137 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1141 %include "MEDCouplingFieldDiscretization.i"
1143 //== MEDCouplingPointSet
1145 namespace ParaMEDMEM
1147 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
1150 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1151 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1152 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1153 void zipCoords() throw(INTERP_KERNEL::Exception);
1154 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1155 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1156 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1157 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1158 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1159 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1160 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1161 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1162 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1163 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1164 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1165 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1166 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1167 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1168 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1169 virtual DataArrayInt *findBoundaryNodes() const;
1170 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1171 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1172 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1173 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1174 virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1175 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1176 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1177 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1178 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1181 std::string __str__() const throw(INTERP_KERNEL::Exception)
1183 return self->simpleRepr();
1186 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1189 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1190 PyObject *res = PyList_New(2);
1191 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1192 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1196 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1198 DataArrayInt *comm, *commIndex;
1199 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1200 PyObject *res = PyList_New(2);
1201 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1202 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1206 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1208 DataArrayDouble *ret1=self->getCoords();
1211 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1214 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1216 int szArr,sw,iTypppArr;
1217 std::vector<int> stdvecTyyppArr;
1218 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1219 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1220 if(sw==3)//DataArrayInt
1222 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1223 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1224 std::string name=argpt->getName();
1226 ret->setName(name.c_str());
1228 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1231 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1233 int szArr,sw,iTypppArr;
1234 std::vector<int> stdvecTyyppArr;
1235 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1236 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1237 if(sw==3)//DataArrayInt
1239 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1240 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1241 std::string name=argpt->getName();
1243 ret->setName(name.c_str());
1245 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1248 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1250 int szArr,sw,iTypppArr;
1251 std::vector<int> stdvecTyyppArr;
1252 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1253 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1254 if(sw==3)//DataArrayInt
1256 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1257 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1258 std::string name=argpt->getName();
1260 ret->setName(name.c_str());
1262 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1265 virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1267 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1268 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1271 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1273 int szArr,sw,iTypppArr;
1274 std::vector<int> stdvecTyyppArr;
1275 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1276 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1277 if(sw==3)//DataArrayInt
1279 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1280 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1281 std::string name=argpt->getName();
1283 ret->setName(name.c_str());
1285 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1288 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1290 int szArr,sw,iTypppArr;
1291 std::vector<int> stdvecTyyppArr;
1292 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1293 self->renumberNodes(tmp,newNbOfNodes);
1296 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1298 int szArr,sw,iTypppArr;
1299 std::vector<int> stdvecTyyppArr;
1300 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1301 self->renumberNodes2(tmp,newNbOfNodes);
1304 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1306 int spaceDim=self->getSpaceDimension();
1308 DataArrayDouble *a,*a2;
1309 DataArrayDoubleTuple *aa,*aa2;
1310 std::vector<double> bb,bb2;
1312 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1313 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1314 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1315 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1316 std::vector<int> nodes;
1317 self->findNodesOnLine(p,v,eps,nodes);
1318 DataArrayInt *ret=DataArrayInt::New();
1319 ret->alloc((int)nodes.size(),1);
1320 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1321 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1323 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1325 int spaceDim=self->getSpaceDimension();
1327 DataArrayDouble *a,*a2;
1328 DataArrayDoubleTuple *aa,*aa2;
1329 std::vector<double> bb,bb2;
1331 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1332 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1333 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1334 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1335 std::vector<int> nodes;
1336 self->findNodesOnPlane(p,v,eps,nodes);
1337 DataArrayInt *ret=DataArrayInt::New();
1338 ret->alloc((int)nodes.size(),1);
1339 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1340 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1343 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1347 DataArrayDoubleTuple *aa;
1348 std::vector<double> bb;
1350 int spaceDim=self->getSpaceDimension();
1351 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1352 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1353 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1354 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1357 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1359 DataArrayInt *c=0,*cI=0;
1363 DataArrayDoubleTuple *aa;
1364 std::vector<double> bb;
1366 int spaceDim=self->getSpaceDimension();
1367 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1368 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1369 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1370 PyObject *ret=PyTuple_New(2);
1371 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1372 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1376 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1378 DataArrayInt *c=0,*cI=0;
1379 int spaceDim=self->getSpaceDimension();
1382 DataArrayDoubleTuple *aa;
1383 std::vector<double> bb;
1386 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1387 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1389 PyObject *ret=PyTuple_New(2);
1390 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1391 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1395 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1399 DataArrayDoubleTuple *aa;
1400 std::vector<double> bb;
1402 int spaceDim=self->getSpaceDimension();
1403 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1404 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1406 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1407 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1410 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1414 std::vector<int> multiVal;
1415 std::pair<int, std::pair<int,int> > slic;
1416 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1417 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1421 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1423 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1425 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1427 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1431 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1433 DataArrayInt *v0=0,*v1=0;
1434 self->findCommonCells(compType,startCellId,v0,v1);
1435 PyObject *res = PyList_New(2);
1436 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1437 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1442 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1445 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1446 if (!SWIG_IsOK(res1))
1449 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1450 self->renumberNodesInConn(tmp);
1454 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1456 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1457 da2->checkAllocated();
1458 self->renumberNodesInConn(da2->getConstPointer());
1462 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1465 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1466 PyObject *ret=PyTuple_New(2);
1467 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1468 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1472 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1474 DataArrayInt *ret=0;
1476 int szArr,sw,iTypppArr;
1477 std::vector<int> stdvecTyyppArr;
1478 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1479 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1483 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1487 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1488 PyObject *res = PyList_New(3);
1489 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1490 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1491 PyList_SetItem(res,2,SWIG_From_int(ret2));
1495 virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1499 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1500 PyObject *res = PyList_New(3);
1501 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1502 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1503 PyList_SetItem(res,2,SWIG_From_int(ret2));
1507 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1510 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1511 if (!SWIG_IsOK(res1))
1514 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1515 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1519 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1521 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1522 da2->checkAllocated();
1523 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1527 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1531 std::vector<int> multiVal;
1532 std::pair<int, std::pair<int,int> > slic;
1533 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1534 int nbc=self->getNumberOfCells();
1535 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1542 std::ostringstream oss;
1543 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1544 throw INTERP_KERNEL::Exception(oss.str().c_str());
1547 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1552 int tmp=nbc+singleVal;
1553 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1557 std::ostringstream oss;
1558 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1559 throw INTERP_KERNEL::Exception(oss.str().c_str());
1565 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1569 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1574 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1575 daIntTyypp->checkAllocated();
1576 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1579 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1583 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1586 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1587 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1588 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1589 for(int i=0;i<sz;i++)
1590 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1593 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1596 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1598 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1599 std::vector<double> val3;
1600 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1601 "Rotate2DAlg",2,true,nbNodes);
1603 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1604 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1607 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1610 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1611 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1612 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1613 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1614 for(int i=0;i<sz;i++)
1615 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1618 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1621 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1623 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1624 std::vector<double> val3;
1625 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1626 "Rotate3DAlg",3,true,nbNodes);
1628 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1629 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1630 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1635 //== MEDCouplingPointSet End
1637 class MEDCouplingUMeshCell
1640 INTERP_KERNEL::NormalizedCellType getType() const;
1643 std::string __str__() const throw(INTERP_KERNEL::Exception)
1645 return self->repr();
1648 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1651 const int *r=self->getAllConn(ret2);
1652 PyObject *ret=PyTuple_New(ret2);
1653 for(int i=0;i<ret2;i++)
1654 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1660 class MEDCouplingUMeshCellIterator
1667 MEDCouplingUMeshCell *ret=self->nextt();
1669 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1672 PyErr_SetString(PyExc_StopIteration,"No more data.");
1679 class MEDCouplingUMeshCellByTypeIterator
1682 ~MEDCouplingUMeshCellByTypeIterator();
1687 MEDCouplingUMeshCellEntry *ret=self->nextt();
1689 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1692 PyErr_SetString(PyExc_StopIteration,"No more data.");
1699 class MEDCouplingUMeshCellByTypeEntry
1702 ~MEDCouplingUMeshCellByTypeEntry();
1705 MEDCouplingUMeshCellByTypeIterator *__iter__()
1707 return self->iterator();
1712 class MEDCouplingUMeshCellEntry
1715 INTERP_KERNEL::NormalizedCellType getType() const;
1716 int getNumberOfElems() const;
1719 MEDCouplingUMeshCellIterator *__iter__()
1721 return self->iterator();
1726 //== MEDCouplingUMesh
1728 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1731 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1732 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1733 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1734 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1735 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1736 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1737 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1738 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1739 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1740 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1741 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1742 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1743 void computeTypes() throw(INTERP_KERNEL::Exception);
1744 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1745 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1747 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1748 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1749 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1750 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1751 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1752 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1753 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1754 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1755 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1756 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1757 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1758 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1759 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1760 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1761 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1762 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1763 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1764 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1765 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1766 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1767 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1768 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1769 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1770 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1771 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1772 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1773 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1774 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1775 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1776 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1777 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1778 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1779 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1780 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1781 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1782 ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1783 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1784 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1785 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1786 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1787 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1788 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1789 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1790 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1791 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);
1792 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1793 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1794 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1795 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1796 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1798 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1800 return MEDCouplingUMesh::New();
1803 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1805 return MEDCouplingUMesh::New(meshName,meshDim);
1809 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1811 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1814 std::string __str__() const throw(INTERP_KERNEL::Exception)
1816 return self->simpleRepr();
1819 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1821 std::ostringstream oss;
1822 self->reprQuickOverview(oss);
1826 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1828 return self->cellIterator();
1831 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1833 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1834 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1835 PyObject *res=PyList_New(result.size());
1836 for(int i=0;iL!=result.end(); i++, iL++)
1837 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1841 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1845 std::vector<int> multiVal;
1846 std::pair<int, std::pair<int,int> > slic;
1847 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1848 int nbc=self->getNumberOfCells();
1849 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1856 std::ostringstream oss;
1857 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1858 throw INTERP_KERNEL::Exception(oss.str().c_str());
1862 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1869 int tmp=nbc+singleVal;
1870 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1875 std::ostringstream oss;
1876 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1877 throw INTERP_KERNEL::Exception(oss.str().c_str());
1883 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1889 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1890 daIntTyypp->checkAllocated();
1891 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1895 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1899 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1903 std::vector<int> multiVal;
1904 std::pair<int, std::pair<int,int> > slic;
1905 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1906 int nbc=self->getNumberOfCells();
1907 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1914 std::ostringstream oss;
1915 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1916 throw INTERP_KERNEL::Exception(oss.str().c_str());
1920 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1927 int tmp=nbc+singleVal;
1928 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1933 std::ostringstream oss;
1934 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1935 throw INTERP_KERNEL::Exception(oss.str().c_str());
1941 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1946 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1952 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1953 daIntTyypp->checkAllocated();
1954 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1958 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1962 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1964 int szArr,sw,iTypppArr;
1965 std::vector<int> stdvecTyyppArr;
1966 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1969 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1970 throw INTERP_KERNEL::Exception(oss.str().c_str());
1972 self->insertNextCell(type,size,tmp);
1975 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1977 int szArr,sw,iTypppArr;
1978 std::vector<int> stdvecTyyppArr;
1979 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1980 self->insertNextCell(type,szArr,tmp);
1983 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1985 DataArrayInt *ret=self->getNodalConnectivity();
1990 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1992 DataArrayInt *ret=self->getNodalConnectivityIndex();
1998 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2000 int szArr,sw,iTypppArr;
2001 std::vector<int> stdvecTyyppArr;
2002 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2003 int nbOfDepthPeelingPerformed=0;
2004 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2005 PyObject *res=PyTuple_New(2);
2006 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2007 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2011 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2013 DataArrayInt *v0=0,*v1=0;
2014 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2015 PyObject *res = PyList_New(2);
2016 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2017 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2021 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2025 DataArrayDoubleTuple *aa;
2026 std::vector<double> bb;
2028 int nbOfCompo=self->getSpaceDimension();
2029 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2032 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2033 PyObject *ret=PyTuple_New(2);
2034 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2035 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2039 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2041 DataArrayInt *ret1=0;
2042 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2043 PyObject *ret=PyTuple_New(2);
2044 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2045 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2049 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2052 DataArrayInt *ret1(0);
2053 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2054 PyObject *ret=PyTuple_New(3);
2055 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2056 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2057 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2061 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2063 std::vector<int> cells;
2064 self->checkButterflyCells(cells,eps);
2065 DataArrayInt *ret=DataArrayInt::New();
2066 ret->alloc((int)cells.size(),1);
2067 std::copy(cells.begin(),cells.end(),ret->getPointer());
2068 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2071 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2073 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2075 PyObject *ret = PyList_New(sz);
2076 for(int i=0;i<sz;i++)
2077 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2081 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2083 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2084 int sz=retCpp.size();
2085 PyObject *ret=PyList_New(sz);
2086 for(int i=0;i<sz;i++)
2087 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2091 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2094 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2095 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2096 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2099 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2102 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2103 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2107 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2110 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2111 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2115 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2117 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2118 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2119 PyObject *ret=PyTuple_New(3);
2120 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2121 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2122 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2126 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2128 DataArrayInt *tmp0=0,*tmp1=0;
2129 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2130 PyObject *ret=PyTuple_New(2);
2131 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2132 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2136 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2140 std::vector<int> multiVal;
2141 std::pair<int, std::pair<int,int> > slic;
2142 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2143 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2147 return self->duplicateNodes(&singleVal,&singleVal+1);
2149 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2151 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2153 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2157 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2161 std::vector<int> multiVal;
2162 std::pair<int, std::pair<int,int> > slic;
2163 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2164 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2168 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2170 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2172 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2174 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2178 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2181 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2182 DataArrayInt *tmp0,*tmp1=0;
2183 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2184 PyObject *ret=PyTuple_New(2);
2185 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2186 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2190 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2192 DataArrayInt *ret0=0,*ret1=0;
2193 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2194 PyObject *ret=PyTuple_New(2);
2195 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2196 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2200 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2202 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2203 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2204 DataArrayInt *ret1=0,*ret2=0;
2205 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2206 PyObject *ret=PyTuple_New(3);
2207 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2208 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2209 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2213 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2215 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2216 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2217 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2218 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2221 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2224 std::vector<const MEDCouplingUMesh *> meshes;
2225 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2226 std::vector<DataArrayInt *> corr;
2227 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2229 PyObject *ret1=PyList_New(sz);
2230 for(int i=0;i<sz;i++)
2231 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2232 PyObject *ret=PyList_New(2);
2233 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2234 PyList_SetItem(ret,1,ret1);
2238 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2240 std::vector<MEDCouplingUMesh *> meshes;
2241 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2242 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2245 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2247 std::vector<MEDCouplingUMesh *> meshes;
2248 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2249 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2252 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2256 std::vector<int> multiVal;
2257 std::pair<int, std::pair<int,int> > slic;
2258 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2260 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2261 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2265 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2267 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2269 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2271 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2275 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2277 DataArrayInt *arrOut=0,*arrIndexOut=0;
2280 std::vector<int> multiVal;
2281 std::pair<int, std::pair<int,int> > slic;
2282 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2284 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2285 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2290 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2295 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2300 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2304 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2306 PyObject *ret=PyTuple_New(2);
2307 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2308 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2312 static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2314 DataArrayInt *arrOut=0,*arrIndexOut=0;
2315 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2316 PyObject *ret=PyTuple_New(2);
2317 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2318 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2322 static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2324 if(!PySlice_Check(slic))
2325 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2326 Py_ssize_t strt=2,stp=2,step=2;
2327 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2329 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2330 arrIndxIn->checkAllocated();
2331 if(arrIndxIn->getNumberOfComponents()!=1)
2332 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2333 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2334 DataArrayInt *arrOut=0,*arrIndexOut=0;
2335 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2336 PyObject *ret=PyTuple_New(2);
2337 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2338 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2342 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2343 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2344 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2346 DataArrayInt *arrOut=0,*arrIndexOut=0;
2349 std::vector<int> multiVal;
2350 std::pair<int, std::pair<int,int> > slic;
2351 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2353 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2354 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2359 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2364 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2369 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2373 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2375 PyObject *ret=PyTuple_New(2);
2376 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2377 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2381 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2382 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2386 std::vector<int> multiVal;
2387 std::pair<int, std::pair<int,int> > slic;
2388 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2390 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2391 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2396 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2401 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2406 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2410 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2414 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2418 DataArrayDoubleTuple *aa;
2419 std::vector<double> bb;
2421 int spaceDim=self->getSpaceDimension();
2422 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2423 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2425 std::vector<int> cells;
2426 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2427 DataArrayInt *ret=DataArrayInt::New();
2428 ret->alloc((int)cells.size(),1);
2429 std::copy(cells.begin(),cells.end(),ret->getPointer());
2430 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2433 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2437 DataArrayDoubleTuple *aa;
2438 std::vector<double> bb;
2440 int spaceDim=self->getSpaceDimension();
2441 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2442 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2443 self->orientCorrectly2DCells(v,polyOnly);
2446 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2448 std::vector<int> cells;
2449 self->arePolyhedronsNotCorrectlyOriented(cells);
2450 DataArrayInt *ret=DataArrayInt::New();
2451 ret->alloc((int)cells.size(),1);
2452 std::copy(cells.begin(),cells.end(),ret->getPointer());
2453 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2456 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2460 self->getFastAveragePlaneOfThis(vec,pos);
2462 std::copy(vec,vec+3,vals);
2463 std::copy(pos,pos+3,vals+3);
2464 return convertDblArrToPyListOfTuple(vals,3,2);
2467 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2469 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2470 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2471 return MEDCouplingUMesh::MergeUMeshes(tmp);
2474 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2477 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2478 PyObject *ret=PyTuple_New(2);
2479 PyObject *ret0Py=ret0?Py_True:Py_False;
2481 PyTuple_SetItem(ret,0,ret0Py);
2482 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2486 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2489 bool ret0=self->areCellsIncludedIn2(other,ret1);
2490 PyObject *ret=PyTuple_New(2);
2491 PyObject *ret0Py=ret0?Py_True:Py_False;
2493 PyTuple_SetItem(ret,0,ret0Py);
2494 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2498 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2500 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2501 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2502 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2503 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2504 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2505 PyObject *ret=PyTuple_New(5);
2506 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2507 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2508 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2509 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2510 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2514 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2516 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2517 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2518 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2519 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2520 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2521 PyObject *ret=PyTuple_New(5);
2522 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2523 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2524 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2525 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2526 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2530 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2532 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2533 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2534 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2535 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2536 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2537 PyObject *ret=PyTuple_New(5);
2538 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2539 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2540 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2541 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2542 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2546 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2548 DataArrayInt *neighbors=0,*neighborsIdx=0;
2549 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2550 PyObject *ret=PyTuple_New(2);
2551 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2552 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2556 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2558 DataArrayInt *neighbors=0,*neighborsIdx=0;
2559 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2560 PyObject *ret=PyTuple_New(2);
2561 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2562 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2566 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2568 DataArrayInt *neighbors=0,*neighborsIdx=0;
2569 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2570 PyObject *ret=PyTuple_New(2);
2571 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2572 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2576 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2578 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2579 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2580 DataArrayInt *d2,*d3,*d4,*dd5;
2581 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2582 PyObject *ret=PyTuple_New(7);
2583 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2584 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2585 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2586 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2587 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2588 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2589 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2593 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2596 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2597 da->checkAllocated();
2598 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2601 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2604 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2605 da->checkAllocated();
2606 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2609 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2612 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2613 da->checkAllocated();
2614 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2617 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2620 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2621 da->checkAllocated();
2622 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2623 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2624 PyObject *res = PyList_New(result.size());
2625 for (int i=0;iL!=result.end(); i++, iL++)
2626 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2630 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2633 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2634 da->checkAllocated();
2635 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2636 ret->setName(da->getName().c_str());
2640 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2642 DataArrayInt *cellNb1=0,*cellNb2=0;
2643 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2644 PyObject *ret=PyTuple_New(3);
2645 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2646 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2647 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2651 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2653 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2654 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2655 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2656 PyObject *ret(PyTuple_New(4));
2657 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2658 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2659 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2660 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2664 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2666 int spaceDim=self->getSpaceDimension();
2668 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2670 DataArrayDouble *a,*a2;
2671 DataArrayDoubleTuple *aa,*aa2;
2672 std::vector<double> bb,bb2;
2674 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2675 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2676 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2677 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2679 DataArrayInt *cellIds=0;
2680 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2681 PyObject *ret=PyTuple_New(2);
2682 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2683 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2687 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2689 int spaceDim=self->getSpaceDimension();
2691 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2693 DataArrayDouble *a,*a2;
2694 DataArrayDoubleTuple *aa,*aa2;
2695 std::vector<double> bb,bb2;
2697 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2698 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2699 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2700 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2702 DataArrayInt *cellIds=0;
2703 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2704 PyObject *ret=PyTuple_New(2);
2705 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2706 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2710 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2712 int spaceDim=self->getSpaceDimension();
2714 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2716 DataArrayDouble *a,*a2;
2717 DataArrayDoubleTuple *aa,*aa2;
2718 std::vector<double> bb,bb2;
2720 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2721 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2722 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2723 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2724 return self->getCellIdsCrossingPlane(orig,vect,eps);
2727 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2731 std::vector<int> pos2;
2732 DataArrayInt *pos3=0;
2733 DataArrayIntTuple *pos4=0;
2734 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2739 self->convertToPolyTypes(&pos1,&pos1+1);
2746 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2751 self->convertToPolyTypes(pos3->begin(),pos3->end());
2755 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2759 void convertAllToPoly();
2760 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2761 bool unPolyze() throw(INTERP_KERNEL::Exception);
2762 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2763 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2764 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2767 //== MEDCouplingUMesh End
2769 //== MEDCouplingExtrudedMesh
2771 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2774 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2775 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2777 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2779 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2782 MEDCouplingExtrudedMesh()
2784 return MEDCouplingExtrudedMesh::New();
2787 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2789 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingExtrudedMesh");
2792 std::string __str__() const throw(INTERP_KERNEL::Exception)
2794 return self->simpleRepr();
2797 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2799 std::ostringstream oss;
2800 self->reprQuickOverview(oss);
2804 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2806 MEDCouplingUMesh *ret=self->getMesh2D();
2809 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2811 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2813 MEDCouplingUMesh *ret=self->getMesh1D();
2816 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2818 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2820 DataArrayInt *ret=self->getMesh3DIds();
2823 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2828 //== MEDCouplingExtrudedMesh End
2830 class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2833 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2834 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2835 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2836 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2837 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2838 virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2841 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2843 int szArr,sw,iTypppArr;
2844 std::vector<int> stdvecTyyppArr;
2845 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2846 self->insertNextCell(tmp,tmp+szArr);
2849 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2851 DataArrayInt *ret=self->getNodalConnectivity();
2852 if(ret) ret->incrRef();
2856 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2858 std::vector< const MEDCoupling1GTUMesh *> parts;
2859 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2860 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2865 //== MEDCoupling1SGTUMesh
2867 class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2870 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2871 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2872 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2873 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2874 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2875 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2876 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2877 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
2878 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
2881 MEDCoupling1SGTUMesh()
2883 return MEDCoupling1SGTUMesh::New();
2886 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2888 return MEDCoupling1SGTUMesh::New(name,type);
2891 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2893 return MEDCoupling1SGTUMesh::New(m);
2896 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2898 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
2901 std::string __str__() const throw(INTERP_KERNEL::Exception)
2903 return self->simpleRepr();
2906 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2908 std::ostringstream oss;
2909 self->reprQuickOverview(oss);
2913 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
2915 DataArrayInt *cellPerm(0),*nodePerm(0);
2916 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
2917 PyObject *ret(PyTuple_New(3));
2918 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
2919 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2920 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2924 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2926 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2927 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2928 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2931 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2933 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2934 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2935 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2940 //== MEDCoupling1SGTUMesh End
2942 //== MEDCoupling1DGTUMesh
2944 class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2947 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2948 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2949 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2950 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2951 bool isPacked() const throw(INTERP_KERNEL::Exception);
2954 MEDCoupling1DGTUMesh()
2956 return MEDCoupling1DGTUMesh::New();
2958 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2960 return MEDCoupling1DGTUMesh::New(name,type);
2963 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2965 return MEDCoupling1DGTUMesh::New(m);
2968 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2970 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
2973 std::string __str__() const throw(INTERP_KERNEL::Exception)
2975 return self->simpleRepr();
2978 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2980 std::ostringstream oss;
2981 self->reprQuickOverview(oss);
2985 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2987 DataArrayInt *ret=self->getNodalConnectivityIndex();
2988 if(ret) ret->incrRef();
2992 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2994 DataArrayInt *ret1=0,*ret2=0;
2995 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2996 PyObject *ret0Py=ret0?Py_True:Py_False;
2998 PyObject *ret=PyTuple_New(3);
2999 PyTuple_SetItem(ret,0,ret0Py);
3000 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3001 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3005 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3008 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3009 PyObject *ret=PyTuple_New(2);
3010 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3011 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3012 PyTuple_SetItem(ret,1,ret1Py);
3016 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3018 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
3019 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3020 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3023 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3025 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
3026 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3027 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3030 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3032 std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
3033 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3034 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3039 //== MEDCoupling1DGTUMeshEnd
3041 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
3044 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3045 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3046 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3047 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3048 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3049 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3050 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3051 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3052 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3053 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3054 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3055 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3056 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3057 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3058 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3061 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3063 int tmpp1=-1,tmpp2=-1;
3064 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3065 std::vector< std::pair<int,int> > inp;
3069 for(int i=0;i<tmpp1;i++)
3070 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3075 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3076 inp.resize(tmpp1/2);
3077 for(int i=0;i<tmpp1/2;i++)
3078 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3081 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3082 return self->buildStructuredSubPart(inp);
3085 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3087 std::vector< std::pair<int,int> > inp;
3088 convertPyToVectorPairInt(part,inp);
3090 int szArr,sw,iTypppArr;
3091 std::vector<int> stdvecTyyppArr;
3092 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3093 std::vector<int> tmp5(tmp4,tmp4+szArr);
3095 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3098 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3100 std::vector< std::pair<int,int> > inp;
3101 convertPyToVectorPairInt(part,inp);
3102 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3105 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3107 std::vector< std::pair<int,int> > inp;
3108 convertPyToVectorPairInt(part,inp);
3109 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3112 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3114 std::vector< std::pair<int,int> > inp;
3115 convertPyToVectorPairInt(part,inp);
3116 std::vector<int> stWithGhost;
3117 std::vector< std::pair<int,int> > partWithGhost;
3118 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3119 PyObject *ret(PyTuple_New(2));
3120 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3121 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3125 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3127 std::vector< std::pair<int,int> > inp;
3128 convertPyToVectorPairInt(partCompactFormat,inp);
3129 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3132 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3134 std::vector< std::pair<int,int> > inp;
3135 convertPyToVectorPairInt(partCompactFormat,inp);
3136 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3139 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3141 std::vector< std::pair<int,int> > inp;
3142 convertPyToVectorPairInt(part,inp);
3143 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3146 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3148 int szArr,sw,iTypppArr;
3149 std::vector<int> stdvecTyyppArr;
3150 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3151 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3154 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3156 int szArr,sw,iTypppArr;
3157 std::vector<int> stdvecTyyppArr;
3158 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3159 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3162 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3164 std::vector< std::pair<int,int> > inp;
3165 convertPyToVectorPairInt(partCompactFormat,inp);
3166 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3169 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3171 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3172 PyObject *retPy=PyList_New(ret.size());
3173 for(std::size_t i=0;i<ret.size();i++)
3175 PyObject *tmp=PyTuple_New(2);
3176 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3177 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3178 PyList_SetItem(retPy,i,tmp);
3183 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3185 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3186 convertPyToVectorPairInt(r1,r1Cpp);
3187 convertPyToVectorPairInt(r2,r2Cpp);
3188 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3189 PyObject *retPy=PyList_New(ret.size());
3190 for(std::size_t i=0;i<ret.size();i++)
3192 PyObject *tmp=PyTuple_New(2);
3193 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3194 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3195 PyList_SetItem(retPy,i,tmp);
3200 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3202 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3203 convertPyToVectorPairInt(r1,r1Cpp);
3204 convertPyToVectorPairInt(r2,r2Cpp);
3205 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3208 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3210 int szArr,sw,iTypppArr;
3211 std::vector<int> stdvecTyyppArr;
3212 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3213 int szArr2,sw2,iTypppArr2;
3214 std::vector<int> stdvecTyyppArr2;
3215 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3216 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3217 std::vector< std::pair<int,int> > partCompactFormat;
3218 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3219 PyObject *ret=PyTuple_New(2);
3220 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3221 PyTuple_SetItem(ret,0,ret0Py);
3222 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3223 for(std::size_t i=0;i<partCompactFormat.size();i++)
3225 PyObject *tmp4=PyTuple_New(2);
3226 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3227 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3228 PyList_SetItem(ret1Py,i,tmp4);
3230 PyTuple_SetItem(ret,1,ret1Py);
3234 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3236 std::vector< std::pair<int,int> > param0,param1,ret;
3237 convertPyToVectorPairInt(bigInAbs,param0);
3238 convertPyToVectorPairInt(partOfBigInAbs,param1);
3239 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3240 PyObject *retPy(PyList_New(ret.size()));
3241 for(std::size_t i=0;i<ret.size();i++)
3243 PyObject *tmp(PyTuple_New(2));
3244 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3245 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3246 PyList_SetItem(retPy,i,tmp);
3251 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3253 std::vector< std::pair<int,int> > param0;
3254 convertPyToVectorPairInt(part,param0);
3255 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3256 PyObject *retPy(PyList_New(ret.size()));
3257 for(std::size_t i=0;i<ret.size();i++)
3259 PyObject *tmp(PyTuple_New(2));
3260 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3261 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3262 PyList_SetItem(retPy,i,tmp);
3267 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3269 std::vector< std::pair<int,int> > param0,param1;
3270 convertPyToVectorPairInt(startingFrom,param0);
3271 convertPyToVectorPairInt(goingTo,param1);
3272 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3275 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3277 std::vector< std::pair<int,int> > param0,param1,ret;
3278 convertPyToVectorPairInt(bigInAbs,param0);
3279 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3280 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3281 PyObject *retPy(PyList_New(ret.size()));
3282 for(std::size_t i=0;i<ret.size();i++)
3284 PyObject *tmp(PyTuple_New(2));
3285 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3286 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3287 PyList_SetItem(retPy,i,tmp);
3294 //== MEDCouplingCMesh
3296 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3299 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3300 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3301 MEDCouplingCMesh *clone(bool recDeepCpy) const;
3302 void setCoords(const DataArrayDouble *coordsX,
3303 const DataArrayDouble *coordsY=0,
3304 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3305 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3307 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3309 return MEDCouplingCMesh::New();
3311 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3313 return MEDCouplingCMesh::New(meshName);
3316 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3318 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3320 std::string __str__() const throw(INTERP_KERNEL::Exception)
3322 return self->simpleRepr();
3324 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3326 std::ostringstream oss;
3327 self->reprQuickOverview(oss);
3330 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3332 DataArrayDouble *ret=self->getCoordsAt(i);
3340 //== MEDCouplingCMesh End
3342 //== MEDCouplingCurveLinearMesh
3344 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3347 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3348 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3349 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
3350 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3352 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3354 return MEDCouplingCurveLinearMesh::New();
3356 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3358 return MEDCouplingCurveLinearMesh::New(meshName);
3360 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3362 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3364 std::string __str__() const throw(INTERP_KERNEL::Exception)
3366 return self->simpleRepr();
3368 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3370 std::ostringstream oss;
3371 self->reprQuickOverview(oss);
3374 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3376 DataArrayDouble *ret=self->getCoords();
3381 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3383 int szArr,sw,iTypppArr;
3384 std::vector<int> stdvecTyyppArr;
3385 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3386 self->setNodeGridStructure(tmp,tmp+szArr);
3391 //== MEDCouplingCurveLinearMesh End
3393 //== MEDCouplingIMesh
3395 class MEDCouplingIMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3398 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3400 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3401 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3402 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3403 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3404 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3405 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3406 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3407 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3408 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3409 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3410 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3415 return MEDCouplingIMesh::New();
3417 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3419 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3420 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3421 const int *nodeStrctPtr(0);
3422 const double *originPtr(0),*dxyzPtr(0);
3424 std::vector<int> bb0;
3425 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3428 std::vector<double> bb,bb2;
3430 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3431 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3433 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3436 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3438 return ParaMEDMEM_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3441 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3443 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3446 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3449 std::vector<int> bb0;
3450 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3451 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3454 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3456 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3459 DataArrayDoubleTuple *aa;
3460 std::vector<double> bb;
3462 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3463 self->setOrigin(originPtr,originPtr+nbTuples);
3466 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3468 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3471 DataArrayDoubleTuple *aa;
3472 std::vector<double> bb;
3474 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3475 self->setDXYZ(originPtr,originPtr+nbTuples);
3478 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3480 std::vector< std::pair<int,int> > inp;
3481 convertPyToVectorPairInt(fineLocInCoarse,inp);
3482 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3485 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)
3487 std::vector< std::pair<int,int> > inp;
3488 convertPyToVectorPairInt(fineLocInCoarse,inp);
3489 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3492 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3494 std::vector< std::pair<int,int> > inp;
3495 convertPyToVectorPairInt(fineLocInCoarse,inp);
3496 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3499 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)
3501 std::vector< std::pair<int,int> > inp;
3502 convertPyToVectorPairInt(fineLocInCoarse,inp);
3503 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3506 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)
3508 std::vector< std::pair<int,int> > inp;
3509 convertPyToVectorPairInt(fineLocInCoarse,inp);
3510 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3513 std::string __str__() const throw(INTERP_KERNEL::Exception)
3515 return self->simpleRepr();
3517 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3519 std::ostringstream oss;
3520 self->reprQuickOverview(oss);
3526 //== MEDCouplingIMesh End
3530 namespace ParaMEDMEM
3532 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3535 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3536 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3537 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3538 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3539 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3540 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3541 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3542 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3543 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3544 std::string getName() const throw(INTERP_KERNEL::Exception);
3545 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3546 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3547 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3548 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3549 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3550 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3551 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3552 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3553 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3554 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3555 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3556 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3557 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3558 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3559 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3560 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3562 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3564 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3567 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3570 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3572 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3575 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3578 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3580 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3581 return convertIntArrToPyList3(ret);
3584 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3587 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3588 PyObject *ret=PyTuple_New(2);
3589 PyObject *ret0Py=ret0?Py_True:Py_False;
3591 PyTuple_SetItem(ret,0,ret0Py);
3592 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3596 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3598 DataArrayInt *ret1=0;
3599 MEDCouplingMesh *ret0=0;
3601 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3602 if (!SWIG_IsOK(res1))
3605 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3606 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3610 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3612 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3613 da2->checkAllocated();
3614 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3616 PyObject *res = PyList_New(2);
3617 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3618 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3622 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3624 DataArrayInt *ret1=0;
3626 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3627 PyObject *res=PyTuple_New(2);
3628 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3630 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3633 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3634 PyTuple_SetItem(res,1,res1);
3639 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3642 int v0; std::vector<int> v1;
3643 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3644 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3647 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3648 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3651 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3652 if (!SWIG_IsOK(res1))
3655 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3656 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3660 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3662 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3663 da2->checkAllocated();
3664 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3668 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3670 std::vector<int> tmp;
3671 self->getCellIdsHavingGaussLocalization(locId,tmp);
3672 DataArrayInt *ret=DataArrayInt::New();
3673 ret->alloc((int)tmp.size(),1);
3674 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3675 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3678 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3680 std::vector<int> inp0;
3681 convertPyToNewIntArr4(code,1,3,inp0);
3682 std::vector<const DataArrayInt *> inp1;
3683 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3684 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3689 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3692 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3693 static MEDCouplingFieldTemplate *New(TypeOfField type);
3694 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3695 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3698 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3700 return MEDCouplingFieldTemplate::New(f);
3703 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3705 return MEDCouplingFieldTemplate::New(type);
3708 std::string __str__() const throw(INTERP_KERNEL::Exception)
3710 return self->simpleRepr();
3713 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3715 std::ostringstream oss;
3716 self->reprQuickOverview(oss);
3722 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3725 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3726 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3727 void setTimeUnit(const std::string& unit);
3728 std::string getTimeUnit() const;
3729 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3730 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3731 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3732 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3733 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3734 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3735 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3736 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3737 MEDCouplingFieldDouble *deepCpy() const;
3738 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3739 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3740 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3741 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3742 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3743 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3744 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3745 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3746 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3747 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3748 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3749 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3750 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3751 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3752 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3753 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3754 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3755 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3756 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3757 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3758 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3759 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3760 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3761 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3762 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3763 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3764 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3765 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3766 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3767 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3768 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3769 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3770 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3771 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3772 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3773 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3774 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3775 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3776 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3777 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3778 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3779 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3780 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3781 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3782 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3783 void fillFromAnalytic2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3784 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3785 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3786 void applyFunc2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3787 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3788 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3789 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3790 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3791 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3792 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3793 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3794 double getMinValue() const throw(INTERP_KERNEL::Exception);
3795 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3796 double norm2() const throw(INTERP_KERNEL::Exception);
3797 double normMax() const throw(INTERP_KERNEL::Exception);
3798 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3799 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3800 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3801 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3802 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3803 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3804 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3805 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3806 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3807 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3808 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3809 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3810 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3811 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3812 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3813 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3814 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3815 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3816 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3817 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3818 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3819 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3821 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3823 return MEDCouplingFieldDouble::New(type,td);
3826 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3828 return MEDCouplingFieldDouble::New(ft,td);
3831 std::string __str__() const throw(INTERP_KERNEL::Exception)
3833 return self->simpleRepr();
3836 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3838 std::ostringstream oss;
3839 self->reprQuickOverview(oss);
3843 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3845 DataArrayDouble *ret=self->getArray();
3851 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3853 std::vector<DataArrayDouble *> arrs=self->getArrays();
3854 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3858 PyObject *ret=PyTuple_New(sz);
3859 for(int i=0;i<sz;i++)
3862 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3864 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3869 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3871 std::vector<const DataArrayDouble *> tmp;
3872 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3874 std::vector<DataArrayDouble *> arrs(sz);
3875 for(int i=0;i<sz;i++)
3876 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3877 self->setArrays(arrs);
3880 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3882 DataArrayDouble *ret=self->getEndArray();
3888 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3892 DataArrayDoubleTuple *aa;
3893 std::vector<double> bb;
3895 const MEDCouplingMesh *mesh=self->getMesh();
3897 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3898 int spaceDim=mesh->getSpaceDimension();
3899 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3900 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3902 int sz=self->getNumberOfComponents();
3903 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3904 self->getValueOn(spaceLoc,res);
3905 return convertDblArrToPyList(res,sz);
3908 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3910 int sz=self->getNumberOfComponents();
3911 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3912 self->getValueOnPos(i,j,k,res);
3913 return convertDblArrToPyList(res,sz);
3916 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3918 const MEDCouplingMesh *mesh(self->getMesh());
3920 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3923 double v0; ParaMEDMEM::DataArrayDouble *v1(0); ParaMEDMEM::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3924 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3925 mesh->getSpaceDimension(),true,nbPts);
3926 return self->getValueOnMulti(inp,nbPts);
3929 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3933 DataArrayDoubleTuple *aa;
3934 std::vector<double> bb;
3936 const MEDCouplingMesh *mesh=self->getMesh();
3938 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3939 int spaceDim=mesh->getSpaceDimension();
3940 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3941 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3944 int sz=self->getNumberOfComponents();
3945 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3946 self->getValueOn(spaceLoc,time,res);
3947 return convertDblArrToPyList(res,sz);
3950 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3952 if(self->getArray()!=0)
3953 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3956 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3957 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3958 self->setArray(arr);
3962 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3965 double tmp0=self->getTime(tmp1,tmp2);
3966 PyObject *res = PyList_New(3);
3967 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3968 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3969 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3973 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3976 double tmp0=self->getStartTime(tmp1,tmp2);
3977 PyObject *res = PyList_New(3);
3978 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3979 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3980 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3984 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3987 double tmp0=self->getEndTime(tmp1,tmp2);
3988 PyObject *res = PyList_New(3);
3989 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3990 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3991 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3994 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3996 int sz=self->getNumberOfComponents();
3997 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3998 self->accumulate(tmp);
3999 return convertDblArrToPyList(tmp,sz);
4001 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4003 int sz=self->getNumberOfComponents();
4004 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4005 self->integral(isWAbs,tmp);
4006 return convertDblArrToPyList(tmp,sz);
4008 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4010 int sz=self->getNumberOfComponents();
4011 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4012 self->getWeightedAverageValue(tmp,isWAbs);
4013 return convertDblArrToPyList(tmp,sz);
4015 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4017 int sz=self->getNumberOfComponents();
4018 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4020 return convertDblArrToPyList(tmp,sz);
4022 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4024 int sz=self->getNumberOfComponents();
4025 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4027 return convertDblArrToPyList(tmp,sz);
4029 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4031 int szArr,sw,iTypppArr;
4032 std::vector<int> stdvecTyyppArr;
4033 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4034 self->renumberCells(tmp,check);
4037 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4039 int szArr,sw,iTypppArr;
4040 std::vector<int> stdvecTyyppArr;
4041 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4042 self->renumberCellsWithoutMesh(tmp,check);
4045 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4047 int szArr,sw,iTypppArr;
4048 std::vector<int> stdvecTyyppArr;
4049 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4050 self->renumberNodes(tmp,eps);
4053 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4055 int szArr,sw,iTypppArr;
4056 std::vector<int> stdvecTyyppArr;
4057 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4058 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4061 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4065 std::vector<int> multiVal;
4066 std::pair<int, std::pair<int,int> > slic;
4067 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4068 const MEDCouplingMesh *mesh=self->getMesh();
4070 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4071 int nbc=mesh->getNumberOfCells();
4072 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4079 std::ostringstream oss;
4080 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4081 throw INTERP_KERNEL::Exception(oss.str().c_str());
4084 return self->buildSubPart(&singleVal,&singleVal+1);
4089 int tmp=nbc+singleVal;
4090 return self->buildSubPart(&tmp,&tmp+1);
4094 std::ostringstream oss;
4095 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4096 throw INTERP_KERNEL::Exception(oss.str().c_str());
4102 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4106 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4111 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4112 daIntTyypp->checkAllocated();
4113 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4116 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4120 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4122 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";
4123 if(PyTuple_Check(li))
4125 Py_ssize_t sz=PyTuple_Size(li);
4127 throw INTERP_KERNEL::Exception(msg);
4128 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4131 std::vector<int> multiVal;
4132 std::pair<int, std::pair<int,int> > slic;
4133 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4134 if(!self->getArray())
4135 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4137 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4138 catch(INTERP_KERNEL::Exception& e)
4139 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4140 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4141 DataArrayDouble *ret0Arr=ret0->getArray();
4143 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4148 std::vector<int> v2(1,singleVal);
4149 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4150 ret0->setArray(aarr);
4155 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4156 ret0->setArray(aarr);
4161 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4162 std::vector<int> v2(nbOfComp);
4163 for(int i=0;i<nbOfComp;i++)
4164 v2[i]=slic.first+i*slic.second.second;
4165 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4166 ret0->setArray(aarr);
4170 throw INTERP_KERNEL::Exception(msg);
4175 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
4178 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4181 double r1=self->getMaxValue2(tmp);
4182 PyObject *ret=PyTuple_New(2);
4183 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4184 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4188 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4191 double r1=self->getMinValue2(tmp);
4192 PyObject *ret=PyTuple_New(2);
4193 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4194 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4198 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4200 std::vector<int> tmp;
4201 convertPyToNewIntArr3(li,tmp);
4202 return self->keepSelectedComponents(tmp);
4205 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4207 std::vector<int> tmp;
4208 convertPyToNewIntArr3(li,tmp);
4209 self->setSelectedComponents(f,tmp);
4212 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4215 DataArrayDouble *a,*a2;
4216 DataArrayDoubleTuple *aa,*aa2;
4217 std::vector<double> bb,bb2;
4220 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4221 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4222 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4223 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4225 return self->extractSlice3D(orig,vect,eps);
4228 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4230 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
4233 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4235 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
4238 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4240 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.";
4241 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4244 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4246 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4248 return (*self)-(*other);
4250 throw INTERP_KERNEL::Exception(msg);
4255 DataArrayDoubleTuple *aa;
4256 std::vector<double> bb;
4258 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4263 if(!self->getArray())
4264 throw INTERP_KERNEL::Exception(msg2);
4265 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4266 ret->applyLin(1.,-val);
4267 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4268 ret2->setArray(ret);
4273 if(!self->getArray())
4274 throw INTERP_KERNEL::Exception(msg2);
4275 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4276 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4277 ret2->setArray(ret);
4282 if(!self->getArray())
4283 throw INTERP_KERNEL::Exception(msg2);
4284 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4285 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4286 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4287 ret2->setArray(ret);
4292 if(!self->getArray())
4293 throw INTERP_KERNEL::Exception(msg2);
4294 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4295 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4296 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4297 ret2->setArray(ret);
4301 { throw INTERP_KERNEL::Exception(msg); }
4305 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4307 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4310 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4312 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
4315 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4317 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4320 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4322 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.";
4323 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4326 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4328 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4330 return (*self)/(*other);
4332 throw INTERP_KERNEL::Exception(msg);
4337 DataArrayDoubleTuple *aa;
4338 std::vector<double> bb;
4340 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4346 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4347 if(!self->getArray())
4348 throw INTERP_KERNEL::Exception(msg2);
4349 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4350 ret->applyLin(1./val,0);
4351 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4352 ret2->setArray(ret);
4357 if(!self->getArray())
4358 throw INTERP_KERNEL::Exception(msg2);
4359 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4360 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4361 ret2->setArray(ret);
4366 if(!self->getArray())
4367 throw INTERP_KERNEL::Exception(msg2);
4368 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4369 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4370 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4371 ret2->setArray(ret);
4376 if(!self->getArray())
4377 throw INTERP_KERNEL::Exception(msg2);
4378 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4379 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4380 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4381 ret2->setArray(ret);
4385 { throw INTERP_KERNEL::Exception(msg); }
4389 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4391 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4394 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4396 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.";
4397 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4400 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4402 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4404 return (*self)^(*other);
4406 throw INTERP_KERNEL::Exception(msg);
4411 DataArrayDoubleTuple *aa;
4412 std::vector<double> bb;
4414 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4419 if(!self->getArray())
4420 throw INTERP_KERNEL::Exception(msg2);
4421 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4423 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4424 ret2->setArray(ret);
4429 if(!self->getArray())
4430 throw INTERP_KERNEL::Exception(msg2);
4431 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4432 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4433 ret2->setArray(ret);
4438 if(!self->getArray())
4439 throw INTERP_KERNEL::Exception(msg2);
4440 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4441 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4442 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4443 ret2->setArray(ret);
4448 if(!self->getArray())
4449 throw INTERP_KERNEL::Exception(msg2);
4450 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4451 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4452 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4453 ret2->setArray(ret);
4457 { throw INTERP_KERNEL::Exception(msg); }
4461 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4463 return self->negate();
4466 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4468 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.";
4469 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4472 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4474 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4478 Py_XINCREF(trueSelf);
4482 throw INTERP_KERNEL::Exception(msg);
4487 DataArrayDoubleTuple *aa;
4488 std::vector<double> bb;
4490 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4495 if(!self->getArray())
4496 throw INTERP_KERNEL::Exception(msg2);
4497 self->getArray()->applyLin(1.,val);
4498 Py_XINCREF(trueSelf);
4503 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4506 Py_XINCREF(trueSelf);
4511 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4512 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4513 ret2->setArray(aaa);
4515 Py_XINCREF(trueSelf);
4520 if(!self->getArray())
4521 throw INTERP_KERNEL::Exception(msg2);
4522 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4523 self->getArray()->addEqual(aaa);
4524 Py_XINCREF(trueSelf);
4528 { throw INTERP_KERNEL::Exception(msg); }
4532 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4534 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.";
4535 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4538 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4540 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4544 Py_XINCREF(trueSelf);
4548 throw INTERP_KERNEL::Exception(msg);
4553 DataArrayDoubleTuple *aa;
4554 std::vector<double> bb;
4556 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4561 if(!self->getArray())
4562 throw INTERP_KERNEL::Exception(msg2);
4563 self->getArray()->applyLin(1.,-val);
4564 Py_XINCREF(trueSelf);
4569 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4572 Py_XINCREF(trueSelf);
4577 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4578 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4579 ret2->setArray(aaa);
4581 Py_XINCREF(trueSelf);
4586 if(!self->getArray())
4587 throw INTERP_KERNEL::Exception(msg2);
4588 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4589 self->getArray()->substractEqual(aaa);
4590 Py_XINCREF(trueSelf);
4594 { throw INTERP_KERNEL::Exception(msg); }
4598 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4600 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.";
4601 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4604 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4606 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4610 Py_XINCREF(trueSelf);
4614 throw INTERP_KERNEL::Exception(msg);
4619 DataArrayDoubleTuple *aa;
4620 std::vector<double> bb;
4622 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4627 if(!self->getArray())
4628 throw INTERP_KERNEL::Exception(msg2);
4629 self->getArray()->applyLin(val,0);
4630 Py_XINCREF(trueSelf);
4635 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4638 Py_XINCREF(trueSelf);
4643 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4644 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4645 ret2->setArray(aaa);
4647 Py_XINCREF(trueSelf);
4652 if(!self->getArray())
4653 throw INTERP_KERNEL::Exception(msg2);
4654 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4655 self->getArray()->multiplyEqual(aaa);
4656 Py_XINCREF(trueSelf);
4660 { throw INTERP_KERNEL::Exception(msg); }
4664 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4666 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.";
4667 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4670 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4672 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4676 Py_XINCREF(trueSelf);
4680 throw INTERP_KERNEL::Exception(msg);
4685 DataArrayDoubleTuple *aa;
4686 std::vector<double> bb;
4688 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4694 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4695 if(!self->getArray())
4696 throw INTERP_KERNEL::Exception(msg2);
4697 self->getArray()->applyLin(1./val,0);
4698 Py_XINCREF(trueSelf);
4703 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4706 Py_XINCREF(trueSelf);
4711 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4712 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4713 ret2->setArray(aaa);
4715 Py_XINCREF(trueSelf);
4720 if(!self->getArray())
4721 throw INTERP_KERNEL::Exception(msg2);
4722 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4723 self->getArray()->divideEqual(aaa);
4724 Py_XINCREF(trueSelf);
4728 { throw INTERP_KERNEL::Exception(msg); }
4732 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4734 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.";
4735 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4738 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4740 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4744 Py_XINCREF(trueSelf);
4748 throw INTERP_KERNEL::Exception(msg);
4753 DataArrayDoubleTuple *aa;
4754 std::vector<double> bb;
4756 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4761 if(!self->getArray())
4762 throw INTERP_KERNEL::Exception(msg2);
4763 self->getArray()->applyPow(val);
4764 Py_XINCREF(trueSelf);
4769 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4772 Py_XINCREF(trueSelf);
4777 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4778 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4779 ret2->setArray(aaa);
4781 Py_XINCREF(trueSelf);
4786 if(!self->getArray())
4787 throw INTERP_KERNEL::Exception(msg2);
4788 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4789 self->getArray()->powEqual(aaa);
4790 Py_XINCREF(trueSelf);
4794 { throw INTERP_KERNEL::Exception(msg); }
4798 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4800 std::vector<const MEDCouplingFieldDouble *> tmp;
4801 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4802 return MEDCouplingFieldDouble::MergeFields(tmp);
4805 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4807 std::vector<const MEDCouplingFieldDouble *> tmp;
4808 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4809 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4812 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4814 std::vector<double> a0;
4815 std::vector<int> a1;
4816 std::vector<std::string> a2;
4817 self->getTinySerializationDbleInformation(a0);
4818 self->getTinySerializationIntInformation(a1);
4819 self->getTinySerializationStrInformation(a2);
4821 PyObject *ret(PyTuple_New(3));
4822 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4823 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
4825 PyObject *ret2(PyList_New(sz));
4827 for(int i=0;i<sz;i++)
4828 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
4830 PyTuple_SetItem(ret,2,ret2);
4834 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
4836 DataArrayInt *ret0(0);
4837 std::vector<DataArrayDouble *> ret1;
4838 self->serialize(ret0,ret1);
4841 std::size_t sz(ret1.size());
4842 PyObject *ret(PyTuple_New(2));
4843 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4844 PyObject *ret1Py(PyList_New(sz));
4845 for(std::size_t i=0;i<sz;i++)
4849 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4851 PyTuple_SetItem(ret,1,ret1Py);
4855 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
4857 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
4858 if(!PyTuple_Check(args))
4859 throw INTERP_KERNEL::Exception(MSG);
4860 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
4861 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
4862 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
4864 PyObject *tmp0(PyTuple_New(1));
4865 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
4866 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
4868 Py_DECREF(selfMeth);
4869 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
4870 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
4871 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
4873 PyObject *a(PyInt_FromLong(0));
4874 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
4877 throw INTERP_KERNEL::Exception(MSG);
4878 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
4879 throw INTERP_KERNEL::Exception(MSG);
4880 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
4883 Py_DECREF(initMeth);
4888 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
4889 {// put an empty dict in input to say to __new__ to call __init__...
4890 self->checkCoherency();
4891 PyObject *ret(PyTuple_New(1));
4892 PyObject *ret0(PyDict_New());
4894 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
4895 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
4896 PyDict_SetItem(ret0,a,d);
4897 Py_DECREF(a); Py_DECREF(d);
4899 PyTuple_SetItem(ret,0,ret0);
4903 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
4905 self->checkCoherency();
4906 PyObject *ret0(ParaMEDMEM_MEDCouplingFieldDouble_getTinySerializationInformation(self));
4907 PyObject *ret1(ParaMEDMEM_MEDCouplingFieldDouble_serialize(self));
4908 const MEDCouplingMesh *mesh(self->getMesh());
4911 PyObject *ret(PyTuple_New(3));
4912 PyTuple_SetItem(ret,0,ret0);
4913 PyTuple_SetItem(ret,1,ret1);
4914 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
4918 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
4920 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
4921 if(!PyTuple_Check(inp))
4922 throw INTERP_KERNEL::Exception(MSG);
4923 int sz(PyTuple_Size(inp));
4925 throw INTERP_KERNEL::Exception(MSG);
4927 PyObject *elt2(PyTuple_GetItem(inp,2));
4929 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,0|0));
4930 if(!SWIG_IsOK(status))
4931 throw INTERP_KERNEL::Exception(MSG);
4932 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
4934 PyObject *elt0(PyTuple_GetItem(inp,0));
4935 PyObject *elt1(PyTuple_GetItem(inp,1));
4936 std::vector<double> a0;
4937 std::vector<int> a1;
4938 std::vector<std::string> a2;
4939 DataArrayInt *b0(0);
4940 std::vector<DataArrayDouble *>b1;
4942 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
4943 throw INTERP_KERNEL::Exception(MSG);
4944 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
4946 fillArrayWithPyListDbl3(a0py,tmp,a0);
4947 convertPyToNewIntArr3(a1py,a1);
4948 fillStringVector(a2py,a2);
4951 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
4952 throw INTERP_KERNEL::Exception(MSG);
4953 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
4955 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0));
4956 if(!SWIG_IsOK(status))
4957 throw INTERP_KERNEL::Exception(MSG);
4958 b0=reinterpret_cast<DataArrayInt *>(argp);
4959 convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayDouble *>(b1py,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",b1);
4961 self->checkForUnserialization(a1,b0,b1);
4962 // useless here to call resizeForUnserialization because arrays are well resized.
4963 self->finishUnserialization(a1,a0,a2);
4968 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4971 int getNumberOfFields() const;
4972 MEDCouplingMultiFields *deepCpy() const;
4973 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4974 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4975 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4976 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4977 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4980 std::string __str__() const throw(INTERP_KERNEL::Exception)
4982 return self->simpleRepr();
4984 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4986 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4987 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4989 std::vector<MEDCouplingFieldDouble *> fs(sz);
4990 for(int i=0;i<sz;i++)
4991 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4992 return MEDCouplingMultiFields::New(fs);
4994 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4996 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4997 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4999 std::vector<MEDCouplingFieldDouble *> fs(sz);
5000 for(int i=0;i<sz;i++)
5001 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5002 return MEDCouplingMultiFields::New(fs);
5004 PyObject *getFields() const
5006 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5007 int sz=fields.size();
5008 PyObject *res = PyList_New(sz);
5009 for(int i=0;i<sz;i++)
5013 fields[i]->incrRef();
5014 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5018 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
5023 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5025 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5029 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5032 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
5034 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5036 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5038 PyObject *res = PyList_New(sz);
5039 for(int i=0;i<sz;i++)
5044 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5048 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
5053 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5055 std::vector<int> refs;
5056 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5058 PyObject *res = PyList_New(sz);
5059 for(int i=0;i<sz;i++)
5064 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5068 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
5072 PyObject *ret=PyTuple_New(2);
5073 PyTuple_SetItem(ret,0,res);
5074 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5077 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5079 std::vector<DataArrayDouble *> ms=self->getArrays();
5081 PyObject *res = PyList_New(sz);
5082 for(int i=0;i<sz;i++)
5087 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5091 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
5096 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5098 std::vector< std::vector<int> > refs;
5099 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5101 PyObject *res = PyList_New(sz);
5102 PyObject *res2 = PyList_New(sz);
5103 for(int i=0;i<sz;i++)
5108 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5112 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
5114 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5117 PyObject *ret=PyTuple_New(2);
5118 PyTuple_SetItem(ret,0,res);
5119 PyTuple_SetItem(ret,1,res2);
5125 class MEDCouplingDefinitionTime
5128 MEDCouplingDefinitionTime();
5129 void assign(const MEDCouplingDefinitionTime& other);
5130 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5131 double getTimeResolution() const;
5132 std::vector<double> getHotSpotsTime() const;
5135 std::string __str__() const throw(INTERP_KERNEL::Exception)
5137 std::ostringstream oss;
5138 self->appendRepr(oss);
5142 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5144 int meshId,arrId,arrIdInField,fieldId;
5145 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5146 PyObject *res=PyList_New(4);
5147 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5148 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5149 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5150 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5154 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5156 int meshId,arrId,arrIdInField,fieldId;
5157 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5158 PyObject *res=PyList_New(4);
5159 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5160 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5161 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5162 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5168 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5171 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5172 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5176 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5178 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
5179 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5181 std::vector<MEDCouplingFieldDouble *> fs(sz);
5182 for(int i=0;i<sz;i++)
5183 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5184 return MEDCouplingFieldOverTime::New(fs);
5186 std::string __str__() const throw(INTERP_KERNEL::Exception)
5188 return self->simpleRepr();
5190 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5192 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
5193 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5195 std::vector<MEDCouplingFieldDouble *> fs(sz);
5196 for(int i=0;i<sz;i++)
5197 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5198 return MEDCouplingFieldOverTime::New(fs);
5203 class MEDCouplingCartesianAMRMesh;
5205 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5208 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5209 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5210 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5213 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5215 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5223 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5226 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5227 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5228 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5231 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5233 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5234 return convertFromVectorPairInt(ret);
5237 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5239 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5240 return convertFromVectorPairInt(ret);
5243 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5245 std::vector< std::pair<int,int> > inp;
5246 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5247 self->addPatch(inp,factors);
5250 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5252 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5254 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5255 if(patchId==mesh->getNumberOfPatches())
5257 std::ostringstream oss;
5258 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5259 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5262 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5268 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5270 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5272 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5273 mesh->removePatch(patchId);
5276 int __len__() const throw(INTERP_KERNEL::Exception)
5278 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5280 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5281 return mesh->getNumberOfPatches();
5286 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5290 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5293 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5294 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5295 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5296 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5297 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5298 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5299 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5300 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5301 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5302 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5303 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5304 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5305 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5307 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5308 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5309 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5310 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5311 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5312 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5313 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5314 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5315 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5316 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5317 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5318 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5319 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5320 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5321 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5322 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5323 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5324 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5325 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5326 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5329 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5331 std::vector< std::pair<int,int> > inp;
5332 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5333 self->addPatch(inp,factors);
5336 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5338 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5340 PyObject *ret = PyList_New(sz);
5341 for(int i=0;i<sz;i++)
5343 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5346 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5351 // agy : don't know why typemap fails here ??? let it in the extend section
5352 PyObject *deepCpy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5354 return convertCartesianAMRMesh(self->deepCpy(father), SWIG_POINTER_OWN | 0 );
5357 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5359 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5360 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5366 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5368 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5369 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5375 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5377 std::vector<int> out1;
5378 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5379 PyObject *ret(PyTuple_New(2));
5380 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5381 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5385 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5387 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5389 PyObject *ret = PyList_New(sz);
5390 for(int i=0;i<sz;i++)
5391 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5395 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5397 std::vector<const DataArrayDouble *> inp;
5398 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",inp);
5399 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5402 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5404 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5410 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5412 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5418 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5420 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5426 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5428 const MEDCouplingIMesh *ret(self->getImageMesh());
5431 return const_cast<MEDCouplingIMesh *>(ret);
5434 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5436 if(patchId==self->getNumberOfPatches())
5438 std::ostringstream oss;
5439 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5440 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5443 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5449 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5451 std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
5452 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5453 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5456 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5458 std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
5459 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5460 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5463 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5465 self->removePatch(patchId);
5468 int __len__() const throw(INTERP_KERNEL::Exception)
5470 return self->getNumberOfPatches();
5475 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5479 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5482 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5485 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5487 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5488 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5489 const int *nodeStrctPtr(0);
5490 const double *originPtr(0),*dxyzPtr(0);
5492 std::vector<int> bb0;
5493 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5496 std::vector<double> bb,bb2;
5498 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5499 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5501 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5504 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5506 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5507 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5508 std::vector< std::vector<int> > inp2;
5509 convertPyToVectorOfVectorOfInt(factors,inp2);
5510 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5513 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5515 return ParaMEDMEM_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5518 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5520 return MEDCouplingCartesianAMRMesh::New(mesh);
5525 class MEDCouplingDataForGodFather : public RefCountObject
5528 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5529 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5530 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5531 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5532 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5533 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5534 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5535 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5536 virtual void alloc() throw(INTERP_KERNEL::Exception);
5537 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5540 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5542 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5550 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5553 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5554 MEDCouplingAMRAttribute *deepCpy() const throw(INTERP_KERNEL::Exception);
5555 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5556 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5557 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5558 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5559 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5560 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5561 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5564 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5566 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5567 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5568 MEDCouplingAMRAttribute *ret(0);
5571 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5572 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5574 catch(INTERP_KERNEL::Exception&)
5576 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5577 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5582 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5584 return ParaMEDMEM_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5587 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5589 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5590 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5596 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5598 std::vector< std::vector<std::string> > compNamesCpp;
5599 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5600 self->spillInfoOnComponents(compNamesCpp);
5603 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5605 std::vector<int> inp0;
5606 if(!fillIntVector(nfs,inp0))
5607 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5608 std::size_t sz(inp0.size());
5609 std::vector<NatureOfField> inp00(sz);
5610 for(std::size_t i=0;i<sz;i++)
5611 inp00[i]=(NatureOfField)inp0[i];
5612 self->spillNatures(inp00);
5615 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5617 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5618 int sz((int)ret.size());
5619 PyObject *retPy(PyList_New(sz));
5620 for(int i=0;i<sz;i++)
5621 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5627 class DenseMatrix : public RefCountObject, public TimeLabel
5630 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5631 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5632 DenseMatrix *deepCpy() const throw(INTERP_KERNEL::Exception);
5633 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5635 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5636 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5637 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5638 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5639 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5640 void transpose() throw(INTERP_KERNEL::Exception);
5642 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5643 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5644 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5647 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5649 return DenseMatrix::New(nbRows,nbCols);
5652 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5654 return DenseMatrix::New(array,nbRows,nbCols);
5657 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5660 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5661 PyObject *ret=PyTuple_New(2);
5662 PyObject *ret0Py=ret0?Py_True:Py_False;
5664 PyTuple_SetItem(ret,0,ret0Py);
5665 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5669 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5671 DataArrayDouble *ret(self->getData());
5677 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5679 return ParaMEDMEM::DenseMatrix::Add(self,other);
5682 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5684 return ParaMEDMEM::DenseMatrix::Substract(self,other);
5687 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5689 return ParaMEDMEM::DenseMatrix::Multiply(self,other);
5692 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5694 return ParaMEDMEM::DenseMatrix::Multiply(self,other);
5697 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5699 self->addEqual(other);
5700 Py_XINCREF(trueSelf);
5704 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5706 self->substractEqual(other);
5707 Py_XINCREF(trueSelf);
5711 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5713 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5720 class PartDefinition : public RefCountObject, public TimeLabel
5723 static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5724 static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5725 virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
5726 virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
5727 virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
5728 virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
5729 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
5730 virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
5733 virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
5735 return (*self)+other;
5738 virtual PyObject *isEqual(const PartDefinition *other) const throw(INTERP_KERNEL::Exception)
5741 bool ret0(self->isEqual(other,ret1));
5742 PyObject *ret=PyTuple_New(2);
5743 PyObject *ret0Py=ret0?Py_True:Py_False;
5745 PyTuple_SetItem(ret,0,ret0Py);
5746 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5750 virtual PyObject *deepCpy() const throw(INTERP_KERNEL::Exception)
5752 return convertPartDefinition(self->deepCpy(),SWIG_POINTER_OWN | 0);
5756 virtual ~PartDefinition();
5759 class DataArrayPartDefinition : public PartDefinition
5762 static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5765 DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
5767 return DataArrayPartDefinition::New(listOfIds);
5770 std::string __str__() const throw(INTERP_KERNEL::Exception)
5772 return self->getRepr();
5775 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5777 std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
5778 oss << self->getRepr();
5783 virtual ~DataArrayPartDefinition();
5786 class SlicePartDefinition : public PartDefinition
5789 static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5790 int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
5793 SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
5795 return SlicePartDefinition::New(start,stop,step);
5798 PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
5801 self->getSlice(a,b,c);
5802 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
5805 std::string __str__() const throw(INTERP_KERNEL::Exception)
5807 return self->getRepr();
5810 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5812 std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
5813 oss << self->getRepr();
5818 virtual ~SlicePartDefinition();
5824 __filename=os.environ.get('PYTHONSTARTUP')
5825 if __filename and os.path.isfile(__filename):
5826 execfile(__filename)