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 "MEDCouplingSkyLineArray.hxx"
48 #include "MEDCouplingTypemaps.i"
50 #include "InterpKernelAutoPtr.hxx"
51 #include "BoxSplittingOptions.hxx"
53 using namespace ParaMEDMEM;
54 using namespace INTERP_KERNEL;
58 %template(ivec) std::vector<int>;
59 %template(dvec) std::vector<double>;
60 %template(svec) std::vector<std::string>;
63 %typemap(out) ParaMEDMEM::MEDCouplingMesh*
65 $result=convertMesh($1,$owner);
68 %typemap(out) MEDCouplingMesh*
70 $result=convertMesh($1,$owner);
75 %typemap(out) ParaMEDMEM::MEDCouplingPointSet*
77 $result=convertMesh($1,$owner);
80 %typemap(out) MEDCouplingPointSet*
82 $result=convertMesh($1,$owner);
87 %typemap(out) MEDCouplingCartesianAMRPatchGen*
89 $result=convertCartesianAMRPatch($1,$owner);
94 %typemap(out) MEDCouplingCartesianAMRMeshGen*
96 $result=convertCartesianAMRMesh($1,$owner);
101 %typemap(out) MEDCouplingDataForGodFather*
103 $result=convertDataForGodFather($1,$owner);
108 %typemap(out) ParaMEDMEM::MEDCoupling1GTUMesh*
110 $result=convertMesh($1,$owner);
113 %typemap(out) MEDCoupling1GTUMesh*
115 $result=convertMesh($1,$owner);
120 %typemap(out) ParaMEDMEM::MEDCouplingStructuredMesh*
122 $result=convertMesh($1,$owner);
125 %typemap(out) MEDCouplingStructuredMesh*
127 $result=convertMesh($1,$owner);
132 %typemap(out) ParaMEDMEM::MEDCouplingFieldDiscretization*
134 $result=convertFieldDiscretization($1,$owner);
137 %typemap(out) MEDCouplingFieldDiscretization*
139 $result=convertFieldDiscretization($1,$owner);
144 %typemap(out) ParaMEDMEM::MEDCouplingMultiFields*
146 $result=convertMultiFields($1,$owner);
149 %typemap(out) MEDCouplingMultiFields*
151 $result=convertMultiFields($1,$owner);
156 %typemap(out) ParaMEDMEM::PartDefinition*
158 $result=convertPartDefinition($1,$owner);
161 %typemap(out) PartDefinition*
163 $result=convertPartDefinition($1,$owner);
168 %init %{ import_array(); %}
171 %feature("autodoc", "1");
172 %feature("docstring");
174 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
175 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
176 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
177 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
178 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
179 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
180 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
181 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
182 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
183 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
184 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
185 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
186 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
187 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
188 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
189 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
190 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
191 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
192 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
193 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
194 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
195 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
196 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
197 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
198 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
199 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
200 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
201 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
202 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
203 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
204 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
205 %newobject ParaMEDMEM::MEDCouplingFieldDouble::negate;
206 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
207 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
208 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPartRange;
209 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
210 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__neg__;
211 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__add__;
212 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__sub__;
213 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__mul__;
214 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__div__;
215 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__pow__;
216 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__radd__;
217 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rsub__;
218 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rmul__;
219 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rdiv__;
220 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
221 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
222 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
223 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
224 %newobject ParaMEDMEM::MEDCouplingFieldDouble::nodeToCellDiscretization;
225 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cellToNodeDiscretization;
226 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
227 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
228 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
229 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
230 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
231 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
232 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfFacesPerCell;
233 %newobject ParaMEDMEM::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
234 %newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
235 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
236 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
237 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
238 %newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
239 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
240 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
241 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
242 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
243 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
244 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
245 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
246 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
247 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
248 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
249 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
250 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
251 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
252 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
253 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
254 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
255 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
256 %newobject ParaMEDMEM::MEDCouplingPointSet::zipConnectivityTraducer;
257 %newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
258 %newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
259 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
260 %newobject ParaMEDMEM::MEDCouplingPointSet::deepCpyConnectivityOnly;
261 %newobject ParaMEDMEM::MEDCouplingPointSet::getBoundingBoxForBBTree;
262 %newobject ParaMEDMEM::MEDCouplingPointSet::computeFetchedNodeIds;
263 %newobject ParaMEDMEM::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
264 %newobject ParaMEDMEM::MEDCouplingPointSet::computeDiameterField;
265 %newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
266 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
267 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
268 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
269 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
270 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
271 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
272 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
273 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
274 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
275 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
276 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
277 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
278 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
279 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
280 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
281 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
282 %newobject ParaMEDMEM::MEDCouplingUMesh::conformize2D;
283 %newobject ParaMEDMEM::MEDCouplingUMesh::colinearize2D;
284 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
285 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
286 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
287 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
288 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
289 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
290 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
291 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
292 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
293 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
294 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
295 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
296 %newobject ParaMEDMEM::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
297 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
298 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
299 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
300 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
301 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
302 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
303 %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
304 %newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
305 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
306 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
307 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
308 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
309 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
310 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
311 %newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf2DMesh;
312 %newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf3DMesh;
313 %newobject ParaMEDMEM::MEDCouplingUMesh::generateGraph;
314 %newobject ParaMEDMEM::MEDCouplingUMesh::orderConsecutiveCells1D;
315 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
316 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
317 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
318 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
319 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
320 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
321 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::getNodalConnectivity;
322 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
323 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::New;
324 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
325 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::computeDualMesh;
326 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
327 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::sortHexa8EachOther;
328 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
329 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
330 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::New;
331 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
332 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
333 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
334 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
335 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
336 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
337 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::buildStructuredSubPart;
338 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTUnstructured;
339 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
340 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
341 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
342 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
343 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
344 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::ComputeCornersGhost;
345 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
346 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
347 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
348 %newobject ParaMEDMEM::MEDCouplingIMesh::New;
349 %newobject ParaMEDMEM::MEDCouplingIMesh::asSingleCell;
350 %newobject ParaMEDMEM::MEDCouplingIMesh::buildWithGhost;
351 %newobject ParaMEDMEM::MEDCouplingIMesh::convertToCartesian;
352 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
353 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
354 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
355 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
356 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
357 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
358 %newobject ParaMEDMEM::MEDCouplingCartesianAMRPatchGen::getMesh;
359 %newobject ParaMEDMEM::MEDCouplingCartesianAMRPatchGen::__getitem__;
360 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::deepCpy;
361 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
362 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
363 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
364 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
365 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getImageMesh;
366 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getGodFather;
367 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getFather;
368 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getPatch;
369 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
370 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
371 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
372 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
373 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::__getitem__;
374 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::New;
375 %newobject ParaMEDMEM::MEDCouplingDataForGodFather::getMyGodFather;
376 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::New;
377 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::deepCpy;
378 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
379 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::getFieldOn;
380 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::projectTo;
381 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
382 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
383 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
384 %newobject ParaMEDMEM::DenseMatrix::New;
385 %newobject ParaMEDMEM::DenseMatrix::deepCpy;
386 %newobject ParaMEDMEM::DenseMatrix::shallowCpy;
387 %newobject ParaMEDMEM::DenseMatrix::getData;
388 %newobject ParaMEDMEM::DenseMatrix::matVecMult;
389 %newobject ParaMEDMEM::DenseMatrix::MatVecMult;
390 %newobject ParaMEDMEM::DenseMatrix::__add__;
391 %newobject ParaMEDMEM::DenseMatrix::__sub__;
392 %newobject ParaMEDMEM::DenseMatrix::__mul__;
393 %newobject ParaMEDMEM::PartDefinition::New;
394 %newobject ParaMEDMEM::PartDefinition::toDAI;
395 %newobject ParaMEDMEM::PartDefinition::__add__;
396 %newobject ParaMEDMEM::PartDefinition::composeWith;
397 %newobject ParaMEDMEM::PartDefinition::tryToSimplify;
398 %newobject ParaMEDMEM::DataArrayPartDefinition::New;
399 %newobject ParaMEDMEM::SlicePartDefinition::New;
401 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
402 %feature("unref") MEDCouplingMesh "$this->decrRef();"
403 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
404 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
405 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
406 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
407 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
408 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
409 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
410 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
411 %feature("unref") MEDCouplingField "$this->decrRef();"
412 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
413 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
414 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
415 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
416 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
417 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
418 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
419 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
420 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
421 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
422 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
423 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
424 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
425 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
426 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
427 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
428 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
429 %feature("unref") DenseMatrix "$this->decrRef();"
430 %feature("unref") PartDefinition "$this->decrRef();"
431 %feature("unref") DataArrayPartDefinition "$this->decrRef();"
432 %feature("unref") SlicePartDefinition "$this->decrRef();"
434 %rename(assign) *::operator=;
435 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
436 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
437 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
438 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
442 %rename (InterpKernelException) INTERP_KERNEL::Exception;
444 %include "MEDCouplingRefCountObject.i"
445 %include "MEDCouplingMemArray.i"
447 namespace INTERP_KERNEL
450 * \class BoxSplittingOptions
451 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
453 class BoxSplittingOptions
456 BoxSplittingOptions();
457 void init() throw(INTERP_KERNEL::Exception);
458 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
459 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
460 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
461 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
462 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
463 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
464 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
465 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
466 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
467 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
468 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
469 std::string printOptions() const throw(INTERP_KERNEL::Exception);
472 std::string __str__() const throw(INTERP_KERNEL::Exception)
474 return self->printOptions();
496 CONST_ON_TIME_INTERVAL = 7
497 } TypeOfTimeDiscretization;
505 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
506 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
508 } MEDCouplingMeshType;
511 class DataArrayDouble;
512 class MEDCouplingUMesh;
513 class MEDCouplingFieldDouble;
515 %extend RefCountObject
517 std::string getHiddenCppPointer() const
519 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
524 %extend MEDCouplingGaussLocalization
526 std::string __str__() const throw(INTERP_KERNEL::Exception)
528 return self->getStringRepr();
531 std::string __repr__() const throw(INTERP_KERNEL::Exception)
533 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
534 oss << self->getStringRepr();
541 class MEDCouplingMesh : public RefCountObject, public TimeLabel
544 void setName(const std::string& name);
545 std::string getName() const;
546 void setDescription(const std::string& descr);
547 std::string getDescription() const;
548 void setTime(double val, int iteration, int order);
549 void setTimeUnit(const std::string& unit);
550 std::string getTimeUnit() const;
551 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
552 bool isStructured() const throw(INTERP_KERNEL::Exception);
553 virtual MEDCouplingMesh *deepCpy() const;
554 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
555 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
556 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
557 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
558 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
559 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
560 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
561 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
562 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
563 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
564 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
565 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
566 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
567 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
568 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
569 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
570 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
571 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
572 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
573 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
574 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
575 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
576 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
577 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
578 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
579 virtual std::string getVTKFileExtension() const;
580 std::string getVTKFileNameOf(const std::string& fileName) const;
582 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
583 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
584 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
585 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
586 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
587 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
588 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
589 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
590 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
591 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
592 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);
593 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
594 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
595 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
596 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
597 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
598 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
599 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
602 std::string __str__() const throw(INTERP_KERNEL::Exception)
604 return self->simpleRepr();
607 PyObject *getTime() throw(INTERP_KERNEL::Exception)
610 double tmp0=self->getTime(tmp1,tmp2);
611 PyObject *res = PyList_New(3);
612 PyList_SetItem(res,0,SWIG_From_double(tmp0));
613 PyList_SetItem(res,1,SWIG_From_int(tmp1));
614 PyList_SetItem(res,2,SWIG_From_int(tmp2));
618 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
622 DataArrayDoubleTuple *aa;
623 std::vector<double> bb;
625 int spaceDim=self->getSpaceDimension();
626 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
627 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
628 return self->getCellContainingPoint(pos,eps);
631 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
635 DataArrayDoubleTuple *aa;
636 std::vector<double> bb;
638 int spaceDim=self->getSpaceDimension();
639 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
640 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
641 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
642 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
643 PyObject *ret=PyTuple_New(2);
644 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
645 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
649 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
651 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
652 int spaceDim=self->getSpaceDimension();
654 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
655 if (!SWIG_IsOK(res1))
658 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
659 int nbOfPoints=size/spaceDim;
662 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
664 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
668 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
670 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
671 da2->checkAllocated();
672 int size=da2->getNumberOfTuples();
673 int nbOfCompo=da2->getNumberOfComponents();
674 if(nbOfCompo!=spaceDim)
676 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
678 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
680 PyObject *ret=PyTuple_New(2);
681 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
682 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
686 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
690 DataArrayDoubleTuple *aa;
691 std::vector<double> bb;
693 int spaceDim=self->getSpaceDimension();
694 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
695 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
696 std::vector<int> elts;
697 self->getCellsContainingPoint(pos,eps,elts);
698 DataArrayInt *ret=DataArrayInt::New();
699 ret->alloc((int)elts.size(),1);
700 std::copy(elts.begin(),elts.end(),ret->getPointer());
701 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
704 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
706 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
707 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
708 self->getReverseNodalConnectivity(d0,d1);
709 PyObject *ret=PyTuple_New(2);
710 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
711 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
715 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
718 int v0; std::vector<int> v1;
719 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
720 self->renumberCells(ids,check);
723 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
725 DataArrayInt *cellCor, *nodeCor;
726 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
727 PyObject *res = PyList_New(2);
728 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
729 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
733 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
735 DataArrayInt *cellCor=0,*nodeCor=0;
736 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
737 PyObject *res = PyList_New(2);
738 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
739 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
743 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
745 DataArrayInt *cellCor=0;
746 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
750 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
753 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
754 if (!SWIG_IsOK(res1))
757 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
758 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
762 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
764 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
765 da2->checkAllocated();
766 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
769 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
771 std::vector<int> conn;
772 self->getNodeIdsOfCell(cellId,conn);
773 return convertIntArrToPyList2(conn);
776 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
778 std::vector<double> coo;
779 self->getCoordinatesOfNode(nodeId,coo);
780 return convertDblArrToPyList2(coo);
783 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
787 DataArrayDoubleTuple *aa;
788 std::vector<double> bb;
790 int spaceDim=self->getSpaceDimension();
791 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
792 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
793 self->scale(pointPtr,factor);
796 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
798 int spaceDim=self->getSpaceDimension();
799 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
800 self->getBoundingBox(tmp);
801 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
805 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
808 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
809 PyObject *ret=PyTuple_New(2);
810 PyObject *ret0Py=ret0?Py_True:Py_False;
812 PyTuple_SetItem(ret,0,ret0Py);
813 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
817 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
819 int szArr,sw,iTypppArr;
820 std::vector<int> stdvecTyyppArr;
821 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
822 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
823 if(sw==3)//DataArrayInt
825 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
826 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
827 std::string name=argpt->getName();
829 ret->setName(name.c_str());
831 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
834 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
836 int szArr,sw,iTypppArr;
837 std::vector<int> stdvecTyyppArr;
839 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
840 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
841 if(sw==3)//DataArrayInt
843 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
844 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
845 std::string name=argpt->getName();
847 ret->setName(name.c_str());
850 PyObject *res = PyList_New(2);
851 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
852 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
853 PyList_SetItem(res,0,obj0);
854 PyList_SetItem(res,1,obj1);
858 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
862 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
863 PyObject *res = PyTuple_New(2);
864 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
867 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
869 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
870 PyTuple_SetItem(res,0,obj0);
871 PyTuple_SetItem(res,1,obj1);
875 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
877 std::vector<int> vals=self->getDistributionOfTypes();
879 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
880 PyObject *ret=PyList_New((int)vals.size()/3);
881 for(int j=0;j<(int)vals.size()/3;j++)
883 PyObject *ret1=PyList_New(3);
884 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
885 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
886 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
887 PyList_SetItem(ret,j,ret1);
892 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
894 std::vector<int> code;
895 std::vector<const DataArrayInt *> idsPerType;
896 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
897 convertPyToNewIntArr4(li,1,3,code);
898 return self->checkTypeConsistencyAndContig(code,idsPerType);
901 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
903 std::vector<int> code;
904 std::vector<DataArrayInt *> idsInPflPerType;
905 std::vector<DataArrayInt *> idsPerType;
906 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
907 PyObject *ret=PyTuple_New(3);
910 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
911 PyObject *ret0=PyList_New((int)code.size()/3);
912 for(int j=0;j<(int)code.size()/3;j++)
914 PyObject *ret00=PyList_New(3);
915 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
916 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
917 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
918 PyList_SetItem(ret0,j,ret00);
920 PyTuple_SetItem(ret,0,ret0);
922 PyObject *ret1=PyList_New(idsInPflPerType.size());
923 for(std::size_t j=0;j<idsInPflPerType.size();j++)
924 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
925 PyTuple_SetItem(ret,1,ret1);
926 int n=idsPerType.size();
927 PyObject *ret2=PyList_New(n);
929 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
930 PyTuple_SetItem(ret,2,ret2);
934 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
938 DataArrayDoubleTuple *aa;
939 std::vector<double> bb;
941 int spaceDim=self->getSpaceDimension();
942 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
943 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
944 self->translate(vectorPtr);
947 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
949 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
952 DataArrayDoubleTuple *aa;
953 std::vector<double> bb;
955 int spaceDim=self->getSpaceDimension();
956 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
957 self->rotate(centerPtr,0,alpha);
960 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
962 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
964 DataArrayDouble *a,*a2;
965 DataArrayDoubleTuple *aa,*aa2;
966 std::vector<double> bb,bb2;
968 int spaceDim=self->getSpaceDimension();
969 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
970 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
971 self->rotate(centerPtr,vectorPtr,alpha);
974 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
976 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
977 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
978 PyObject *res=PyList_New(result.size());
979 for(int i=0;iL!=result.end(); i++, iL++)
980 PyList_SetItem(res,i,PyInt_FromLong(*iL));
984 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
986 std::vector<double> a0;
988 std::vector<std::string> a2;
989 self->getTinySerializationInformation(a0,a1,a2);
990 PyObject *ret(PyTuple_New(3));
991 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
992 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
994 PyObject *ret2(PyList_New(sz));
996 for(int i=0;i<sz;i++)
997 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
999 PyTuple_SetItem(ret,2,ret2);
1003 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1005 DataArrayInt *a0Tmp(0);
1006 DataArrayDouble *a1Tmp(0);
1007 self->serialize(a0Tmp,a1Tmp);
1008 PyObject *ret(PyTuple_New(2));
1009 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1010 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1014 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1016 std::vector<std::string> littleStrings;
1017 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1020 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1021 {// put an empty dict in input to say to __new__ to call __init__...
1022 PyObject *ret(PyTuple_New(1));
1023 PyObject *ret0(PyDict_New());
1024 PyTuple_SetItem(ret,0,ret0);
1028 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1030 PyObject *ret0(ParaMEDMEM_MEDCouplingMesh_getTinySerializationInformation(self));
1031 PyObject *ret1(ParaMEDMEM_MEDCouplingMesh_serialize(self));
1032 PyObject *ret(PyTuple_New(2));
1033 PyTuple_SetItem(ret,0,ret0);
1034 PyTuple_SetItem(ret,1,ret1);
1038 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1040 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1041 if(!PyTuple_Check(inp))
1042 throw INTERP_KERNEL::Exception(MSG);
1043 int sz(PyTuple_Size(inp));
1045 throw INTERP_KERNEL::Exception(MSG);
1046 PyObject *elt0(PyTuple_GetItem(inp,0));
1047 PyObject *elt1(PyTuple_GetItem(inp,1));
1048 std::vector<double> a0;
1049 std::vector<int> a1;
1050 std::vector<std::string> a2;
1051 DataArrayInt *b0(0);
1052 DataArrayDouble *b1(0);
1054 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1055 throw INTERP_KERNEL::Exception(MSG);
1056 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1058 fillArrayWithPyListDbl3(a0py,tmp,a0);
1059 convertPyToNewIntArr3(a1py,a1);
1060 fillStringVector(a2py,a2);
1063 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1064 throw INTERP_KERNEL::Exception(MSG);
1065 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1067 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0));
1068 if(!SWIG_IsOK(status))
1069 throw INTERP_KERNEL::Exception(MSG);
1070 b0=reinterpret_cast<DataArrayInt *>(argp);
1071 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0);
1072 if(!SWIG_IsOK(status))
1073 throw INTERP_KERNEL::Exception(MSG);
1074 b1=reinterpret_cast<DataArrayDouble *>(argp);
1076 // useless here to call resizeForUnserialization because arrays are well resized.
1077 self->unserialization(a0,a1,b0,b1,a2);
1080 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1082 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
1083 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1084 return MEDCouplingMesh::MergeMeshes(tmp);
1090 //== MEDCouplingMesh End
1092 %include "NormalizedGeometricTypes"
1093 %include "MEDCouplingNatureOfFieldEnum"
1095 namespace ParaMEDMEM
1097 class MEDCouplingNatureOfField
1100 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1101 static std::string GetReprNoThrow(NatureOfField nat);
1102 static std::string GetAllPossibilitiesStr();
1106 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1107 // include "MEDCouplingTimeDiscretization.i"
1109 namespace ParaMEDMEM
1111 class MEDCouplingGaussLocalization
1114 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1115 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1116 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1117 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1118 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1119 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1120 int getDimension() const throw(INTERP_KERNEL::Exception);
1121 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1122 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1123 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1124 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1126 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1127 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1128 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1129 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1130 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1131 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1132 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1133 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1134 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1135 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1136 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1137 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1139 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1142 class MEDCouplingSkyLineArray
1145 MEDCouplingSkyLineArray();
1146 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray &myArray );
1147 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value );
1148 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value );
1150 void set( DataArrayInt* index, DataArrayInt* value );
1151 int getNumberOf() const;
1152 int getLength() const;
1153 DataArrayInt* getIndexArray() const;
1154 DataArrayInt* getValueArray() const;
1157 std::string __str__() const throw(INTERP_KERNEL::Exception)
1159 return self->simpleRepr();
1165 %include "MEDCouplingFieldDiscretization.i"
1167 //== MEDCouplingPointSet
1169 namespace ParaMEDMEM
1171 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
1174 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1175 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1176 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1177 void zipCoords() throw(INTERP_KERNEL::Exception);
1178 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1179 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1180 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1181 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1182 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1183 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1184 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1185 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1186 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1187 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1188 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1189 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1190 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1191 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1192 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1193 virtual DataArrayInt *findBoundaryNodes() const;
1194 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1195 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1196 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1197 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1198 virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1199 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1200 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1201 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1202 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1205 std::string __str__() const throw(INTERP_KERNEL::Exception)
1207 return self->simpleRepr();
1210 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1213 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1214 PyObject *res = PyList_New(2);
1215 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1216 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1220 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1222 DataArrayInt *comm, *commIndex;
1223 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1224 PyObject *res = PyList_New(2);
1225 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1226 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1230 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1232 DataArrayDouble *ret1=self->getCoords();
1235 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1238 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1240 int szArr,sw,iTypppArr;
1241 std::vector<int> stdvecTyyppArr;
1242 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1243 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1244 if(sw==3)//DataArrayInt
1246 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1247 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1248 std::string name=argpt->getName();
1250 ret->setName(name.c_str());
1252 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1255 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1257 int szArr,sw,iTypppArr;
1258 std::vector<int> stdvecTyyppArr;
1259 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1260 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1261 if(sw==3)//DataArrayInt
1263 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1264 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1265 std::string name=argpt->getName();
1267 ret->setName(name.c_str());
1269 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1272 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1274 int szArr,sw,iTypppArr;
1275 std::vector<int> stdvecTyyppArr;
1276 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1277 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1278 if(sw==3)//DataArrayInt
1280 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1281 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1282 std::string name=argpt->getName();
1284 ret->setName(name.c_str());
1286 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1289 virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1291 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1292 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1295 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1297 int szArr,sw,iTypppArr;
1298 std::vector<int> stdvecTyyppArr;
1299 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1300 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1301 if(sw==3)//DataArrayInt
1303 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1304 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1305 std::string name=argpt->getName();
1307 ret->setName(name.c_str());
1309 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1312 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1314 int szArr,sw,iTypppArr;
1315 std::vector<int> stdvecTyyppArr;
1316 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1317 self->renumberNodes(tmp,newNbOfNodes);
1320 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1322 int szArr,sw,iTypppArr;
1323 std::vector<int> stdvecTyyppArr;
1324 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1325 self->renumberNodes2(tmp,newNbOfNodes);
1328 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1330 int spaceDim=self->getSpaceDimension();
1332 DataArrayDouble *a,*a2;
1333 DataArrayDoubleTuple *aa,*aa2;
1334 std::vector<double> bb,bb2;
1336 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1337 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1338 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1339 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1340 std::vector<int> nodes;
1341 self->findNodesOnLine(p,v,eps,nodes);
1342 DataArrayInt *ret=DataArrayInt::New();
1343 ret->alloc((int)nodes.size(),1);
1344 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1345 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1347 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1349 int spaceDim=self->getSpaceDimension();
1351 DataArrayDouble *a,*a2;
1352 DataArrayDoubleTuple *aa,*aa2;
1353 std::vector<double> bb,bb2;
1355 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1356 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1357 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1358 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1359 std::vector<int> nodes;
1360 self->findNodesOnPlane(p,v,eps,nodes);
1361 DataArrayInt *ret=DataArrayInt::New();
1362 ret->alloc((int)nodes.size(),1);
1363 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1364 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1367 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1371 DataArrayDoubleTuple *aa;
1372 std::vector<double> bb;
1374 int spaceDim=self->getSpaceDimension();
1375 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1376 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1377 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1378 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1381 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1383 DataArrayInt *c=0,*cI=0;
1387 DataArrayDoubleTuple *aa;
1388 std::vector<double> bb;
1390 int spaceDim=self->getSpaceDimension();
1391 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1392 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1393 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1394 PyObject *ret=PyTuple_New(2);
1395 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1396 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1400 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1402 DataArrayInt *c=0,*cI=0;
1403 int spaceDim=self->getSpaceDimension();
1406 DataArrayDoubleTuple *aa;
1407 std::vector<double> bb;
1410 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1411 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1413 PyObject *ret=PyTuple_New(2);
1414 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1415 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1419 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1423 DataArrayDoubleTuple *aa;
1424 std::vector<double> bb;
1426 int spaceDim=self->getSpaceDimension();
1427 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1428 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1430 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1431 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1434 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1438 std::vector<int> multiVal;
1439 std::pair<int, std::pair<int,int> > slic;
1440 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1441 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1445 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1447 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1449 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1451 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1455 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1457 DataArrayInt *v0=0,*v1=0;
1458 self->findCommonCells(compType,startCellId,v0,v1);
1459 PyObject *res = PyList_New(2);
1460 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1461 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1466 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1469 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1470 if (!SWIG_IsOK(res1))
1473 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1474 self->renumberNodesInConn(tmp);
1478 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1480 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1481 da2->checkAllocated();
1482 self->renumberNodesInConn(da2->getConstPointer());
1486 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1489 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1490 PyObject *ret=PyTuple_New(2);
1491 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1492 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1496 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1498 DataArrayInt *ret=0;
1500 int szArr,sw,iTypppArr;
1501 std::vector<int> stdvecTyyppArr;
1502 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1503 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1507 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1511 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1512 PyObject *res = PyList_New(3);
1513 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1514 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1515 PyList_SetItem(res,2,SWIG_From_int(ret2));
1519 virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1523 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1524 PyObject *res = PyList_New(3);
1525 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1526 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1527 PyList_SetItem(res,2,SWIG_From_int(ret2));
1531 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1534 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1535 if (!SWIG_IsOK(res1))
1538 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1539 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1543 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1545 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1546 da2->checkAllocated();
1547 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1551 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1555 std::vector<int> multiVal;
1556 std::pair<int, std::pair<int,int> > slic;
1557 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1558 int nbc=self->getNumberOfCells();
1559 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1566 std::ostringstream oss;
1567 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1568 throw INTERP_KERNEL::Exception(oss.str().c_str());
1571 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1576 int tmp=nbc+singleVal;
1577 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1581 std::ostringstream oss;
1582 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1583 throw INTERP_KERNEL::Exception(oss.str().c_str());
1589 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1593 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1598 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1599 daIntTyypp->checkAllocated();
1600 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1603 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1607 static void Rotate2DAlg(PyObject *center, 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 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1613 for(int i=0;i<sz;i++)
1614 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1617 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1620 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1622 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1623 std::vector<double> val3;
1624 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1625 "Rotate2DAlg",2,true,nbNodes);
1627 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1628 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1631 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1634 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1635 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1636 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1637 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1638 for(int i=0;i<sz;i++)
1639 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1642 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1645 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1647 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1648 std::vector<double> val3;
1649 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1650 "Rotate3DAlg",3,true,nbNodes);
1652 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1653 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1654 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1659 //== MEDCouplingPointSet End
1661 class MEDCouplingUMeshCell
1664 INTERP_KERNEL::NormalizedCellType getType() const;
1667 std::string __str__() const throw(INTERP_KERNEL::Exception)
1669 return self->repr();
1672 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1675 const int *r=self->getAllConn(ret2);
1676 PyObject *ret=PyTuple_New(ret2);
1677 for(int i=0;i<ret2;i++)
1678 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1684 class MEDCouplingUMeshCellIterator
1691 MEDCouplingUMeshCell *ret=self->nextt();
1693 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1696 PyErr_SetString(PyExc_StopIteration,"No more data.");
1703 class MEDCouplingUMeshCellByTypeIterator
1706 ~MEDCouplingUMeshCellByTypeIterator();
1711 MEDCouplingUMeshCellEntry *ret=self->nextt();
1713 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1716 PyErr_SetString(PyExc_StopIteration,"No more data.");
1723 class MEDCouplingUMeshCellByTypeEntry
1726 ~MEDCouplingUMeshCellByTypeEntry();
1729 MEDCouplingUMeshCellByTypeIterator *__iter__()
1731 return self->iterator();
1736 class MEDCouplingUMeshCellEntry
1739 INTERP_KERNEL::NormalizedCellType getType() const;
1740 int getNumberOfElems() const;
1743 MEDCouplingUMeshCellIterator *__iter__()
1745 return self->iterator();
1750 //== MEDCouplingUMesh
1752 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1755 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1756 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1757 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1758 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1759 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1760 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1761 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1762 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1763 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1764 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1765 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1766 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1767 void computeTypes() throw(INTERP_KERNEL::Exception);
1768 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1769 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1771 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1772 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1773 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1774 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1775 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1776 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1777 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1778 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1779 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1780 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1781 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1782 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1783 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1784 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1785 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1786 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1787 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1788 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1789 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1790 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1791 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1792 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1793 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1794 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1795 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1796 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1797 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1798 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1799 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1800 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1801 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1802 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1803 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1804 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1805 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1806 ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1807 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1808 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1809 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1810 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1811 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1812 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1813 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1814 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1815 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1816 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);
1817 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1818 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1819 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1820 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1821 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1823 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1825 return MEDCouplingUMesh::New();
1828 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1830 return MEDCouplingUMesh::New(meshName,meshDim);
1834 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1836 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1839 std::string __str__() const throw(INTERP_KERNEL::Exception)
1841 return self->simpleRepr();
1844 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1846 std::ostringstream oss;
1847 self->reprQuickOverview(oss);
1851 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1853 return self->cellIterator();
1856 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1858 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1859 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1860 PyObject *res=PyList_New(result.size());
1861 for(int i=0;iL!=result.end(); i++, iL++)
1862 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1866 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1870 std::vector<int> multiVal;
1871 std::pair<int, std::pair<int,int> > slic;
1872 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1873 int nbc=self->getNumberOfCells();
1874 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1881 std::ostringstream oss;
1882 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1883 throw INTERP_KERNEL::Exception(oss.str().c_str());
1887 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1894 int tmp=nbc+singleVal;
1895 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1900 std::ostringstream oss;
1901 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1902 throw INTERP_KERNEL::Exception(oss.str().c_str());
1908 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1914 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1915 daIntTyypp->checkAllocated();
1916 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1920 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1924 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1928 std::vector<int> multiVal;
1929 std::pair<int, std::pair<int,int> > slic;
1930 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1931 int nbc=self->getNumberOfCells();
1932 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1939 std::ostringstream oss;
1940 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1941 throw INTERP_KERNEL::Exception(oss.str().c_str());
1945 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1952 int tmp=nbc+singleVal;
1953 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1958 std::ostringstream oss;
1959 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1960 throw INTERP_KERNEL::Exception(oss.str().c_str());
1966 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1971 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1977 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1978 daIntTyypp->checkAllocated();
1979 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1983 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1987 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1989 int szArr,sw,iTypppArr;
1990 std::vector<int> stdvecTyyppArr;
1991 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1994 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1995 throw INTERP_KERNEL::Exception(oss.str().c_str());
1997 self->insertNextCell(type,size,tmp);
2000 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2002 int szArr,sw,iTypppArr;
2003 std::vector<int> stdvecTyyppArr;
2004 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2005 self->insertNextCell(type,szArr,tmp);
2008 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2010 DataArrayInt *ret=self->getNodalConnectivity();
2015 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2017 DataArrayInt *ret=self->getNodalConnectivityIndex();
2023 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2025 int szArr,sw,iTypppArr;
2026 std::vector<int> stdvecTyyppArr;
2027 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2028 int nbOfDepthPeelingPerformed=0;
2029 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2030 PyObject *res=PyTuple_New(2);
2031 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2032 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2036 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2038 DataArrayInt *v0=0,*v1=0;
2039 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2040 PyObject *res = PyList_New(2);
2041 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2042 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2046 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2050 DataArrayDoubleTuple *aa;
2051 std::vector<double> bb;
2053 int nbOfCompo=self->getSpaceDimension();
2054 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2057 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2058 PyObject *ret=PyTuple_New(2);
2059 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2060 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2064 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2066 DataArrayInt *ret1=0;
2067 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2068 PyObject *ret=PyTuple_New(2);
2069 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2070 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2074 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2077 DataArrayInt *ret1(0);
2078 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2079 PyObject *ret=PyTuple_New(3);
2080 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2081 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2082 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2086 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2088 std::vector<int> cells;
2089 self->checkButterflyCells(cells,eps);
2090 DataArrayInt *ret=DataArrayInt::New();
2091 ret->alloc((int)cells.size(),1);
2092 std::copy(cells.begin(),cells.end(),ret->getPointer());
2093 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2096 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2098 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2100 PyObject *ret = PyList_New(sz);
2101 for(int i=0;i<sz;i++)
2102 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2106 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2108 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2109 int sz=retCpp.size();
2110 PyObject *ret=PyList_New(sz);
2111 for(int i=0;i<sz;i++)
2112 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2116 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2119 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2120 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2121 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2124 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2127 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2128 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2132 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2135 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2136 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2140 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2142 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2143 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2144 PyObject *ret=PyTuple_New(3);
2145 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2146 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2147 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2151 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2153 DataArrayInt *tmp0=0,*tmp1=0;
2154 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2155 PyObject *ret=PyTuple_New(2);
2156 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2157 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2161 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2165 std::vector<int> multiVal;
2166 std::pair<int, std::pair<int,int> > slic;
2167 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2168 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2172 return self->duplicateNodes(&singleVal,&singleVal+1);
2174 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2176 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2178 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2182 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2186 std::vector<int> multiVal;
2187 std::pair<int, std::pair<int,int> > slic;
2188 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2189 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2193 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2195 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2197 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2199 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2203 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2206 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2207 DataArrayInt *tmp0,*tmp1=0;
2208 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2209 PyObject *ret=PyTuple_New(2);
2210 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2211 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2215 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2217 DataArrayInt *ret0=0,*ret1=0;
2218 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2219 PyObject *ret=PyTuple_New(2);
2220 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2221 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2225 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2227 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2228 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2229 DataArrayInt *ret1=0,*ret2=0;
2230 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2231 PyObject *ret=PyTuple_New(3);
2232 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2233 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2234 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2238 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2240 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2241 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2242 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2243 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2246 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2249 std::vector<const MEDCouplingUMesh *> meshes;
2250 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2251 std::vector<DataArrayInt *> corr;
2252 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2254 PyObject *ret1=PyList_New(sz);
2255 for(int i=0;i<sz;i++)
2256 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2257 PyObject *ret=PyList_New(2);
2258 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2259 PyList_SetItem(ret,1,ret1);
2263 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2265 std::vector<MEDCouplingUMesh *> meshes;
2266 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2267 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2270 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2272 std::vector<MEDCouplingUMesh *> meshes;
2273 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2274 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2277 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2281 std::vector<int> multiVal;
2282 std::pair<int, std::pair<int,int> > slic;
2283 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2285 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2286 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2290 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2292 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2294 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2296 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2300 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2302 DataArrayInt *arrOut=0,*arrIndexOut=0;
2305 std::vector<int> multiVal;
2306 std::pair<int, std::pair<int,int> > slic;
2307 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2309 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2310 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2315 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2320 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2325 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2329 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2331 PyObject *ret=PyTuple_New(2);
2332 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2333 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2337 static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2339 DataArrayInt *arrOut=0,*arrIndexOut=0;
2340 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2341 PyObject *ret=PyTuple_New(2);
2342 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2343 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2347 static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2349 if(!PySlice_Check(slic))
2350 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2351 Py_ssize_t strt=2,stp=2,step=2;
2352 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2354 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2355 arrIndxIn->checkAllocated();
2356 if(arrIndxIn->getNumberOfComponents()!=1)
2357 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2358 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2359 DataArrayInt *arrOut=0,*arrIndexOut=0;
2360 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2361 PyObject *ret=PyTuple_New(2);
2362 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2363 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2367 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2368 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2369 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2371 DataArrayInt *arrOut=0,*arrIndexOut=0;
2374 std::vector<int> multiVal;
2375 std::pair<int, std::pair<int,int> > slic;
2376 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2378 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2379 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2384 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2389 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2394 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2398 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2400 PyObject *ret=PyTuple_New(2);
2401 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2402 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2406 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2407 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2411 std::vector<int> multiVal;
2412 std::pair<int, std::pair<int,int> > slic;
2413 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2415 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2416 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2421 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2426 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2431 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2435 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2439 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2443 DataArrayDoubleTuple *aa;
2444 std::vector<double> bb;
2446 int spaceDim=self->getSpaceDimension();
2447 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2448 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2450 std::vector<int> cells;
2451 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2452 DataArrayInt *ret=DataArrayInt::New();
2453 ret->alloc((int)cells.size(),1);
2454 std::copy(cells.begin(),cells.end(),ret->getPointer());
2455 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2458 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2462 DataArrayDoubleTuple *aa;
2463 std::vector<double> bb;
2465 int spaceDim=self->getSpaceDimension();
2466 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2467 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2468 self->orientCorrectly2DCells(v,polyOnly);
2471 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2473 std::vector<int> cells;
2474 self->arePolyhedronsNotCorrectlyOriented(cells);
2475 DataArrayInt *ret=DataArrayInt::New();
2476 ret->alloc((int)cells.size(),1);
2477 std::copy(cells.begin(),cells.end(),ret->getPointer());
2478 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2481 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2485 self->getFastAveragePlaneOfThis(vec,pos);
2487 std::copy(vec,vec+3,vals);
2488 std::copy(pos,pos+3,vals+3);
2489 return convertDblArrToPyListOfTuple(vals,3,2);
2492 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2494 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2495 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2496 return MEDCouplingUMesh::MergeUMeshes(tmp);
2499 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2502 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2503 PyObject *ret=PyTuple_New(2);
2504 PyObject *ret0Py=ret0?Py_True:Py_False;
2506 PyTuple_SetItem(ret,0,ret0Py);
2507 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2511 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2514 bool ret0=self->areCellsIncludedIn2(other,ret1);
2515 PyObject *ret=PyTuple_New(2);
2516 PyObject *ret0Py=ret0?Py_True:Py_False;
2518 PyTuple_SetItem(ret,0,ret0Py);
2519 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2523 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2525 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2526 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2527 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2528 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2529 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2530 PyObject *ret=PyTuple_New(5);
2531 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2532 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2533 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2534 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2535 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2539 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2541 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2542 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2543 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2544 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2545 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2546 PyObject *ret=PyTuple_New(5);
2547 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2548 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2549 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2550 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2551 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2555 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2557 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2558 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2559 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2560 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2561 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2562 PyObject *ret=PyTuple_New(5);
2563 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2564 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2565 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2566 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2567 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2571 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2573 DataArrayInt *neighbors=0,*neighborsIdx=0;
2574 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2575 PyObject *ret=PyTuple_New(2);
2576 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2577 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2581 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2583 DataArrayInt *neighbors=0,*neighborsIdx=0;
2584 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2585 PyObject *ret=PyTuple_New(2);
2586 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2587 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2591 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2593 DataArrayInt *neighbors=0,*neighborsIdx=0;
2594 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2595 PyObject *ret=PyTuple_New(2);
2596 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2597 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2601 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2603 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2604 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2605 DataArrayInt *d2,*d3,*d4,*dd5;
2606 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2607 PyObject *ret=PyTuple_New(7);
2608 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2609 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2610 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2611 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2612 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2613 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2614 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2618 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2621 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2622 da->checkAllocated();
2623 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2626 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2629 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2630 da->checkAllocated();
2631 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2634 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2637 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2638 da->checkAllocated();
2639 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2642 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2645 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2646 da->checkAllocated();
2647 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2648 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2649 PyObject *res = PyList_New(result.size());
2650 for (int i=0;iL!=result.end(); i++, iL++)
2651 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2655 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2658 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2659 da->checkAllocated();
2660 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2661 ret->setName(da->getName().c_str());
2665 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2667 DataArrayInt *cellNb1=0,*cellNb2=0;
2668 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2669 PyObject *ret=PyTuple_New(3);
2670 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2671 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2672 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2676 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2678 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2679 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2680 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2681 PyObject *ret(PyTuple_New(4));
2682 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2683 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2684 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2685 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2689 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2691 int spaceDim=self->getSpaceDimension();
2693 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2695 DataArrayDouble *a,*a2;
2696 DataArrayDoubleTuple *aa,*aa2;
2697 std::vector<double> bb,bb2;
2699 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2700 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2701 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2702 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2704 DataArrayInt *cellIds=0;
2705 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2706 PyObject *ret=PyTuple_New(2);
2707 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2708 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2712 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2714 int spaceDim=self->getSpaceDimension();
2716 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2718 DataArrayDouble *a,*a2;
2719 DataArrayDoubleTuple *aa,*aa2;
2720 std::vector<double> bb,bb2;
2722 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2723 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2724 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2725 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2727 DataArrayInt *cellIds=0;
2728 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2729 PyObject *ret=PyTuple_New(2);
2730 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2731 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2735 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2737 int spaceDim=self->getSpaceDimension();
2739 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2741 DataArrayDouble *a,*a2;
2742 DataArrayDoubleTuple *aa,*aa2;
2743 std::vector<double> bb,bb2;
2745 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2746 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2747 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2748 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2749 return self->getCellIdsCrossingPlane(orig,vect,eps);
2752 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2756 std::vector<int> pos2;
2757 DataArrayInt *pos3=0;
2758 DataArrayIntTuple *pos4=0;
2759 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2764 self->convertToPolyTypes(&pos1,&pos1+1);
2771 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2776 self->convertToPolyTypes(pos3->begin(),pos3->end());
2780 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2784 void convertAllToPoly();
2785 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2786 bool unPolyze() throw(INTERP_KERNEL::Exception);
2787 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2788 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2789 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2792 //== MEDCouplingUMesh End
2794 //== MEDCouplingExtrudedMesh
2796 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2799 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2800 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2802 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2804 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2807 MEDCouplingExtrudedMesh()
2809 return MEDCouplingExtrudedMesh::New();
2812 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2814 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingExtrudedMesh");
2817 std::string __str__() const throw(INTERP_KERNEL::Exception)
2819 return self->simpleRepr();
2822 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2824 std::ostringstream oss;
2825 self->reprQuickOverview(oss);
2829 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2831 MEDCouplingUMesh *ret=self->getMesh2D();
2834 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2836 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2838 MEDCouplingUMesh *ret=self->getMesh1D();
2841 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2843 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2845 DataArrayInt *ret=self->getMesh3DIds();
2848 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2853 //== MEDCouplingExtrudedMesh End
2855 class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2858 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2859 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2860 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2861 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2862 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2863 virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2866 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2868 int szArr,sw,iTypppArr;
2869 std::vector<int> stdvecTyyppArr;
2870 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2871 self->insertNextCell(tmp,tmp+szArr);
2874 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2876 DataArrayInt *ret=self->getNodalConnectivity();
2877 if(ret) ret->incrRef();
2881 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2883 std::vector< const MEDCoupling1GTUMesh *> parts;
2884 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2885 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2890 //== MEDCoupling1SGTUMesh
2892 class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2895 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2896 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2897 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2898 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2899 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2900 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2901 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2902 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
2903 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
2906 MEDCoupling1SGTUMesh()
2908 return MEDCoupling1SGTUMesh::New();
2911 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2913 return MEDCoupling1SGTUMesh::New(name,type);
2916 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2918 return MEDCoupling1SGTUMesh::New(m);
2921 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2923 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
2926 std::string __str__() const throw(INTERP_KERNEL::Exception)
2928 return self->simpleRepr();
2931 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2933 std::ostringstream oss;
2934 self->reprQuickOverview(oss);
2938 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
2940 DataArrayInt *cellPerm(0),*nodePerm(0);
2941 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
2942 PyObject *ret(PyTuple_New(3));
2943 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
2944 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2945 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2949 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2951 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2952 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2953 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2956 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2958 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2959 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2960 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2965 //== MEDCoupling1SGTUMesh End
2967 //== MEDCoupling1DGTUMesh
2969 class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2972 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2973 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2974 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2975 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2976 bool isPacked() const throw(INTERP_KERNEL::Exception);
2979 MEDCoupling1DGTUMesh()
2981 return MEDCoupling1DGTUMesh::New();
2983 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2985 return MEDCoupling1DGTUMesh::New(name,type);
2988 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2990 return MEDCoupling1DGTUMesh::New(m);
2993 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2995 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
2998 std::string __str__() const throw(INTERP_KERNEL::Exception)
3000 return self->simpleRepr();
3003 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3005 std::ostringstream oss;
3006 self->reprQuickOverview(oss);
3010 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3012 DataArrayInt *ret=self->getNodalConnectivityIndex();
3013 if(ret) ret->incrRef();
3017 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3019 DataArrayInt *ret1=0,*ret2=0;
3020 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3021 PyObject *ret0Py=ret0?Py_True:Py_False;
3023 PyObject *ret=PyTuple_New(3);
3024 PyTuple_SetItem(ret,0,ret0Py);
3025 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3026 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3030 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3033 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3034 PyObject *ret=PyTuple_New(2);
3035 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3036 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3037 PyTuple_SetItem(ret,1,ret1Py);
3041 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3043 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
3044 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3045 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3048 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3050 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
3051 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3052 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3055 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3057 std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
3058 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3059 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3064 //== MEDCoupling1DGTUMeshEnd
3066 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
3069 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3070 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3071 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3072 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3073 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3074 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3075 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3076 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3077 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3078 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3079 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3080 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3081 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3082 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3083 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3086 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3088 int tmpp1=-1,tmpp2=-1;
3089 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3090 std::vector< std::pair<int,int> > inp;
3094 for(int i=0;i<tmpp1;i++)
3095 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3100 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3101 inp.resize(tmpp1/2);
3102 for(int i=0;i<tmpp1/2;i++)
3103 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3106 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3107 return self->buildStructuredSubPart(inp);
3110 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3112 std::vector< std::pair<int,int> > inp;
3113 convertPyToVectorPairInt(part,inp);
3115 int szArr,sw,iTypppArr;
3116 std::vector<int> stdvecTyyppArr;
3117 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3118 std::vector<int> tmp5(tmp4,tmp4+szArr);
3120 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3123 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3125 std::vector< std::pair<int,int> > inp;
3126 convertPyToVectorPairInt(part,inp);
3127 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3130 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3132 std::vector< std::pair<int,int> > inp;
3133 convertPyToVectorPairInt(part,inp);
3134 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3137 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3139 std::vector< std::pair<int,int> > inp;
3140 convertPyToVectorPairInt(part,inp);
3141 std::vector<int> stWithGhost;
3142 std::vector< std::pair<int,int> > partWithGhost;
3143 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3144 PyObject *ret(PyTuple_New(2));
3145 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3146 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3150 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3152 std::vector< std::pair<int,int> > inp;
3153 convertPyToVectorPairInt(partCompactFormat,inp);
3154 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3157 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3159 std::vector< std::pair<int,int> > inp;
3160 convertPyToVectorPairInt(partCompactFormat,inp);
3161 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3164 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3166 std::vector< std::pair<int,int> > inp;
3167 convertPyToVectorPairInt(part,inp);
3168 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3171 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3173 int szArr,sw,iTypppArr;
3174 std::vector<int> stdvecTyyppArr;
3175 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3176 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3179 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3181 int szArr,sw,iTypppArr;
3182 std::vector<int> stdvecTyyppArr;
3183 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3184 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3187 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3189 std::vector< std::pair<int,int> > inp;
3190 convertPyToVectorPairInt(partCompactFormat,inp);
3191 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3194 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3196 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3197 PyObject *retPy=PyList_New(ret.size());
3198 for(std::size_t i=0;i<ret.size();i++)
3200 PyObject *tmp=PyTuple_New(2);
3201 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3202 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3203 PyList_SetItem(retPy,i,tmp);
3208 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3210 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3211 convertPyToVectorPairInt(r1,r1Cpp);
3212 convertPyToVectorPairInt(r2,r2Cpp);
3213 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3214 PyObject *retPy=PyList_New(ret.size());
3215 for(std::size_t i=0;i<ret.size();i++)
3217 PyObject *tmp=PyTuple_New(2);
3218 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3219 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3220 PyList_SetItem(retPy,i,tmp);
3225 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3227 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3228 convertPyToVectorPairInt(r1,r1Cpp);
3229 convertPyToVectorPairInt(r2,r2Cpp);
3230 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3233 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3235 int szArr,sw,iTypppArr;
3236 std::vector<int> stdvecTyyppArr;
3237 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3238 int szArr2,sw2,iTypppArr2;
3239 std::vector<int> stdvecTyyppArr2;
3240 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3241 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3242 std::vector< std::pair<int,int> > partCompactFormat;
3243 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3244 PyObject *ret=PyTuple_New(2);
3245 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3246 PyTuple_SetItem(ret,0,ret0Py);
3247 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3248 for(std::size_t i=0;i<partCompactFormat.size();i++)
3250 PyObject *tmp4=PyTuple_New(2);
3251 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3252 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3253 PyList_SetItem(ret1Py,i,tmp4);
3255 PyTuple_SetItem(ret,1,ret1Py);
3259 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3261 std::vector< std::pair<int,int> > param0,param1,ret;
3262 convertPyToVectorPairInt(bigInAbs,param0);
3263 convertPyToVectorPairInt(partOfBigInAbs,param1);
3264 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3265 PyObject *retPy(PyList_New(ret.size()));
3266 for(std::size_t i=0;i<ret.size();i++)
3268 PyObject *tmp(PyTuple_New(2));
3269 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3270 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3271 PyList_SetItem(retPy,i,tmp);
3276 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3278 std::vector< std::pair<int,int> > param0;
3279 convertPyToVectorPairInt(part,param0);
3280 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
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);
3292 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3294 std::vector< std::pair<int,int> > param0,param1;
3295 convertPyToVectorPairInt(startingFrom,param0);
3296 convertPyToVectorPairInt(goingTo,param1);
3297 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3300 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3302 std::vector< std::pair<int,int> > param0,param1,ret;
3303 convertPyToVectorPairInt(bigInAbs,param0);
3304 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3305 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3306 PyObject *retPy(PyList_New(ret.size()));
3307 for(std::size_t i=0;i<ret.size();i++)
3309 PyObject *tmp(PyTuple_New(2));
3310 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3311 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3312 PyList_SetItem(retPy,i,tmp);
3319 //== MEDCouplingCMesh
3321 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3324 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3325 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3326 MEDCouplingCMesh *clone(bool recDeepCpy) const;
3327 void setCoords(const DataArrayDouble *coordsX,
3328 const DataArrayDouble *coordsY=0,
3329 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3330 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3332 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3334 return MEDCouplingCMesh::New();
3336 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3338 return MEDCouplingCMesh::New(meshName);
3341 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3343 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3345 std::string __str__() const throw(INTERP_KERNEL::Exception)
3347 return self->simpleRepr();
3349 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3351 std::ostringstream oss;
3352 self->reprQuickOverview(oss);
3355 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3357 DataArrayDouble *ret=self->getCoordsAt(i);
3365 //== MEDCouplingCMesh End
3367 //== MEDCouplingCurveLinearMesh
3369 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3372 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3373 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3374 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
3375 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3377 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3379 return MEDCouplingCurveLinearMesh::New();
3381 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3383 return MEDCouplingCurveLinearMesh::New(meshName);
3385 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3387 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3389 std::string __str__() const throw(INTERP_KERNEL::Exception)
3391 return self->simpleRepr();
3393 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3395 std::ostringstream oss;
3396 self->reprQuickOverview(oss);
3399 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3401 DataArrayDouble *ret=self->getCoords();
3406 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3408 int szArr,sw,iTypppArr;
3409 std::vector<int> stdvecTyyppArr;
3410 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3411 self->setNodeGridStructure(tmp,tmp+szArr);
3416 //== MEDCouplingCurveLinearMesh End
3418 //== MEDCouplingIMesh
3420 class MEDCouplingIMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3423 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3425 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3426 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3427 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3428 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3429 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3430 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3431 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3432 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3433 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3434 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3435 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3440 return MEDCouplingIMesh::New();
3442 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3444 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3445 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3446 const int *nodeStrctPtr(0);
3447 const double *originPtr(0),*dxyzPtr(0);
3449 std::vector<int> bb0;
3450 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3453 std::vector<double> bb,bb2;
3455 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3456 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3458 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3461 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3463 return ParaMEDMEM_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3466 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3468 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3471 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3474 std::vector<int> bb0;
3475 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3476 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3479 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3481 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3484 DataArrayDoubleTuple *aa;
3485 std::vector<double> bb;
3487 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3488 self->setOrigin(originPtr,originPtr+nbTuples);
3491 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3493 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3496 DataArrayDoubleTuple *aa;
3497 std::vector<double> bb;
3499 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3500 self->setDXYZ(originPtr,originPtr+nbTuples);
3503 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3505 std::vector< std::pair<int,int> > inp;
3506 convertPyToVectorPairInt(fineLocInCoarse,inp);
3507 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3510 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)
3512 std::vector< std::pair<int,int> > inp;
3513 convertPyToVectorPairInt(fineLocInCoarse,inp);
3514 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3517 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3519 std::vector< std::pair<int,int> > inp;
3520 convertPyToVectorPairInt(fineLocInCoarse,inp);
3521 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3524 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)
3526 std::vector< std::pair<int,int> > inp;
3527 convertPyToVectorPairInt(fineLocInCoarse,inp);
3528 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3531 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)
3533 std::vector< std::pair<int,int> > inp;
3534 convertPyToVectorPairInt(fineLocInCoarse,inp);
3535 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3538 std::string __str__() const throw(INTERP_KERNEL::Exception)
3540 return self->simpleRepr();
3542 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3544 std::ostringstream oss;
3545 self->reprQuickOverview(oss);
3551 //== MEDCouplingIMesh End
3555 namespace ParaMEDMEM
3557 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3560 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3561 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3562 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3563 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3564 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3565 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3566 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3567 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3568 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3569 std::string getName() const throw(INTERP_KERNEL::Exception);
3570 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3571 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3572 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3573 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3574 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3575 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3576 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3577 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3578 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3579 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3580 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3581 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3582 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3583 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3584 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3585 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3587 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3589 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3592 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3595 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3597 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3600 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3603 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3605 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3606 return convertIntArrToPyList3(ret);
3609 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3612 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3613 PyObject *ret=PyTuple_New(2);
3614 PyObject *ret0Py=ret0?Py_True:Py_False;
3616 PyTuple_SetItem(ret,0,ret0Py);
3617 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3621 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3623 DataArrayInt *ret1=0;
3624 MEDCouplingMesh *ret0=0;
3626 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3627 if (!SWIG_IsOK(res1))
3630 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3631 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3635 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3637 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3638 da2->checkAllocated();
3639 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3641 PyObject *res = PyList_New(2);
3642 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3643 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3647 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3649 DataArrayInt *ret1=0;
3651 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3652 PyObject *res=PyTuple_New(2);
3653 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3655 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3658 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3659 PyTuple_SetItem(res,1,res1);
3664 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3667 int v0; std::vector<int> v1;
3668 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3669 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3672 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3673 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3676 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3677 if (!SWIG_IsOK(res1))
3680 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3681 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3685 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3687 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3688 da2->checkAllocated();
3689 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3693 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3695 std::vector<int> tmp;
3696 self->getCellIdsHavingGaussLocalization(locId,tmp);
3697 DataArrayInt *ret=DataArrayInt::New();
3698 ret->alloc((int)tmp.size(),1);
3699 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3700 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3703 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3705 std::vector<int> inp0;
3706 convertPyToNewIntArr4(code,1,3,inp0);
3707 std::vector<const DataArrayInt *> inp1;
3708 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3709 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3714 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3717 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3718 static MEDCouplingFieldTemplate *New(TypeOfField type);
3719 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3720 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3723 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3725 return MEDCouplingFieldTemplate::New(f);
3728 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3730 return MEDCouplingFieldTemplate::New(type);
3733 std::string __str__() const throw(INTERP_KERNEL::Exception)
3735 return self->simpleRepr();
3738 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3740 std::ostringstream oss;
3741 self->reprQuickOverview(oss);
3747 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3750 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3751 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3752 void setTimeUnit(const std::string& unit);
3753 std::string getTimeUnit() const;
3754 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3755 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3756 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3757 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3758 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3759 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3760 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3761 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3762 MEDCouplingFieldDouble *deepCpy() const;
3763 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3764 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3765 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3766 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3767 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3768 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3769 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3770 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3771 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3772 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3773 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3774 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3775 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3776 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3777 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3778 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3779 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3780 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3781 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3782 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3783 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3784 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3785 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3786 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3787 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3788 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3789 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3790 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3791 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3792 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3793 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3794 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3795 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3796 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3797 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3798 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3799 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3800 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3801 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3802 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3803 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3804 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3805 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3806 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3807 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3808 void fillFromAnalytic2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3809 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3810 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3811 void applyFunc2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3812 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3813 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3814 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3815 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3816 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3817 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3818 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3819 double getMinValue() const throw(INTERP_KERNEL::Exception);
3820 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3821 double norm2() const throw(INTERP_KERNEL::Exception);
3822 double normMax() const throw(INTERP_KERNEL::Exception);
3823 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3824 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3825 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3826 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3827 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3828 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3829 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3830 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3831 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3832 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3833 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3834 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3835 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3836 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3837 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3838 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3839 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3840 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3841 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3842 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3843 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3844 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3846 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3848 return MEDCouplingFieldDouble::New(type,td);
3851 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3853 return MEDCouplingFieldDouble::New(ft,td);
3856 std::string __str__() const throw(INTERP_KERNEL::Exception)
3858 return self->simpleRepr();
3861 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3863 std::ostringstream oss;
3864 self->reprQuickOverview(oss);
3868 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3870 DataArrayDouble *ret=self->getArray();
3876 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3878 std::vector<DataArrayDouble *> arrs=self->getArrays();
3879 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3883 PyObject *ret=PyTuple_New(sz);
3884 for(int i=0;i<sz;i++)
3887 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3889 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3894 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3896 std::vector<const DataArrayDouble *> tmp;
3897 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3899 std::vector<DataArrayDouble *> arrs(sz);
3900 for(int i=0;i<sz;i++)
3901 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3902 self->setArrays(arrs);
3905 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3907 DataArrayDouble *ret=self->getEndArray();
3913 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3917 DataArrayDoubleTuple *aa;
3918 std::vector<double> bb;
3920 const MEDCouplingMesh *mesh=self->getMesh();
3922 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3923 int spaceDim=mesh->getSpaceDimension();
3924 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3925 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3927 int sz=self->getNumberOfComponents();
3928 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3929 self->getValueOn(spaceLoc,res);
3930 return convertDblArrToPyList(res,sz);
3933 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3935 int sz=self->getNumberOfComponents();
3936 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3937 self->getValueOnPos(i,j,k,res);
3938 return convertDblArrToPyList(res,sz);
3941 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3943 const MEDCouplingMesh *mesh(self->getMesh());
3945 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3948 double v0; ParaMEDMEM::DataArrayDouble *v1(0); ParaMEDMEM::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3949 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3950 mesh->getSpaceDimension(),true,nbPts);
3951 return self->getValueOnMulti(inp,nbPts);
3954 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3958 DataArrayDoubleTuple *aa;
3959 std::vector<double> bb;
3961 const MEDCouplingMesh *mesh=self->getMesh();
3963 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3964 int spaceDim=mesh->getSpaceDimension();
3965 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3966 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3969 int sz=self->getNumberOfComponents();
3970 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3971 self->getValueOn(spaceLoc,time,res);
3972 return convertDblArrToPyList(res,sz);
3975 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3977 if(self->getArray()!=0)
3978 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3981 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3982 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3983 self->setArray(arr);
3987 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3990 double tmp0=self->getTime(tmp1,tmp2);
3991 PyObject *res = PyList_New(3);
3992 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3993 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3994 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3998 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4001 double tmp0=self->getStartTime(tmp1,tmp2);
4002 PyObject *res = PyList_New(3);
4003 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4004 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4005 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4009 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4012 double tmp0=self->getEndTime(tmp1,tmp2);
4013 PyObject *res = PyList_New(3);
4014 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4015 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4016 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4019 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4021 int sz=self->getNumberOfComponents();
4022 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4023 self->accumulate(tmp);
4024 return convertDblArrToPyList(tmp,sz);
4026 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4028 int sz=self->getNumberOfComponents();
4029 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4030 self->integral(isWAbs,tmp);
4031 return convertDblArrToPyList(tmp,sz);
4033 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4035 int sz=self->getNumberOfComponents();
4036 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4037 self->getWeightedAverageValue(tmp,isWAbs);
4038 return convertDblArrToPyList(tmp,sz);
4040 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4042 int sz=self->getNumberOfComponents();
4043 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4045 return convertDblArrToPyList(tmp,sz);
4047 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4049 int sz=self->getNumberOfComponents();
4050 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4052 return convertDblArrToPyList(tmp,sz);
4054 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4056 int szArr,sw,iTypppArr;
4057 std::vector<int> stdvecTyyppArr;
4058 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4059 self->renumberCells(tmp,check);
4062 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4064 int szArr,sw,iTypppArr;
4065 std::vector<int> stdvecTyyppArr;
4066 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4067 self->renumberCellsWithoutMesh(tmp,check);
4070 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4072 int szArr,sw,iTypppArr;
4073 std::vector<int> stdvecTyyppArr;
4074 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4075 self->renumberNodes(tmp,eps);
4078 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4080 int szArr,sw,iTypppArr;
4081 std::vector<int> stdvecTyyppArr;
4082 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4083 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4086 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4090 std::vector<int> multiVal;
4091 std::pair<int, std::pair<int,int> > slic;
4092 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4093 const MEDCouplingMesh *mesh=self->getMesh();
4095 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4096 int nbc=mesh->getNumberOfCells();
4097 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4104 std::ostringstream oss;
4105 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4106 throw INTERP_KERNEL::Exception(oss.str().c_str());
4109 return self->buildSubPart(&singleVal,&singleVal+1);
4114 int tmp=nbc+singleVal;
4115 return self->buildSubPart(&tmp,&tmp+1);
4119 std::ostringstream oss;
4120 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4121 throw INTERP_KERNEL::Exception(oss.str().c_str());
4127 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4131 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4136 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4137 daIntTyypp->checkAllocated();
4138 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4141 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4145 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4147 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";
4148 if(PyTuple_Check(li))
4150 Py_ssize_t sz=PyTuple_Size(li);
4152 throw INTERP_KERNEL::Exception(msg);
4153 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4156 std::vector<int> multiVal;
4157 std::pair<int, std::pair<int,int> > slic;
4158 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4159 if(!self->getArray())
4160 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4162 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4163 catch(INTERP_KERNEL::Exception& e)
4164 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4165 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4166 DataArrayDouble *ret0Arr=ret0->getArray();
4168 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4173 std::vector<int> v2(1,singleVal);
4174 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4175 ret0->setArray(aarr);
4180 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4181 ret0->setArray(aarr);
4186 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4187 std::vector<int> v2(nbOfComp);
4188 for(int i=0;i<nbOfComp;i++)
4189 v2[i]=slic.first+i*slic.second.second;
4190 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4191 ret0->setArray(aarr);
4195 throw INTERP_KERNEL::Exception(msg);
4200 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
4203 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4206 double r1=self->getMaxValue2(tmp);
4207 PyObject *ret=PyTuple_New(2);
4208 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4209 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4213 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4216 double r1=self->getMinValue2(tmp);
4217 PyObject *ret=PyTuple_New(2);
4218 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4219 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4223 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4225 std::vector<int> tmp;
4226 convertPyToNewIntArr3(li,tmp);
4227 return self->keepSelectedComponents(tmp);
4230 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4232 std::vector<int> tmp;
4233 convertPyToNewIntArr3(li,tmp);
4234 self->setSelectedComponents(f,tmp);
4237 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4240 DataArrayDouble *a,*a2;
4241 DataArrayDoubleTuple *aa,*aa2;
4242 std::vector<double> bb,bb2;
4245 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4246 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4247 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4248 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4250 return self->extractSlice3D(orig,vect,eps);
4253 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4255 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
4258 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4260 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
4263 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4265 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.";
4266 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4269 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4271 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4273 return (*self)-(*other);
4275 throw INTERP_KERNEL::Exception(msg);
4280 DataArrayDoubleTuple *aa;
4281 std::vector<double> bb;
4283 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4288 if(!self->getArray())
4289 throw INTERP_KERNEL::Exception(msg2);
4290 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4291 ret->applyLin(1.,-val);
4292 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4293 ret2->setArray(ret);
4298 if(!self->getArray())
4299 throw INTERP_KERNEL::Exception(msg2);
4300 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4301 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4302 ret2->setArray(ret);
4307 if(!self->getArray())
4308 throw INTERP_KERNEL::Exception(msg2);
4309 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4310 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4311 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4312 ret2->setArray(ret);
4317 if(!self->getArray())
4318 throw INTERP_KERNEL::Exception(msg2);
4319 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4320 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4321 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4322 ret2->setArray(ret);
4326 { throw INTERP_KERNEL::Exception(msg); }
4330 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4332 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4335 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4337 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
4340 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4342 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4345 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4347 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.";
4348 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4351 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4353 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4355 return (*self)/(*other);
4357 throw INTERP_KERNEL::Exception(msg);
4362 DataArrayDoubleTuple *aa;
4363 std::vector<double> bb;
4365 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4371 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4372 if(!self->getArray())
4373 throw INTERP_KERNEL::Exception(msg2);
4374 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4375 ret->applyLin(1./val,0);
4376 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4377 ret2->setArray(ret);
4382 if(!self->getArray())
4383 throw INTERP_KERNEL::Exception(msg2);
4384 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4385 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4386 ret2->setArray(ret);
4391 if(!self->getArray())
4392 throw INTERP_KERNEL::Exception(msg2);
4393 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4394 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4395 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4396 ret2->setArray(ret);
4401 if(!self->getArray())
4402 throw INTERP_KERNEL::Exception(msg2);
4403 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4404 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4405 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4406 ret2->setArray(ret);
4410 { throw INTERP_KERNEL::Exception(msg); }
4414 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4416 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4419 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4421 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.";
4422 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4425 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4427 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4429 return (*self)^(*other);
4431 throw INTERP_KERNEL::Exception(msg);
4436 DataArrayDoubleTuple *aa;
4437 std::vector<double> bb;
4439 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4444 if(!self->getArray())
4445 throw INTERP_KERNEL::Exception(msg2);
4446 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4448 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4449 ret2->setArray(ret);
4454 if(!self->getArray())
4455 throw INTERP_KERNEL::Exception(msg2);
4456 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4457 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4458 ret2->setArray(ret);
4463 if(!self->getArray())
4464 throw INTERP_KERNEL::Exception(msg2);
4465 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4466 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4467 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4468 ret2->setArray(ret);
4473 if(!self->getArray())
4474 throw INTERP_KERNEL::Exception(msg2);
4475 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4476 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4477 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4478 ret2->setArray(ret);
4482 { throw INTERP_KERNEL::Exception(msg); }
4486 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4488 return self->negate();
4491 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4493 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.";
4494 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4497 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4499 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4503 Py_XINCREF(trueSelf);
4507 throw INTERP_KERNEL::Exception(msg);
4512 DataArrayDoubleTuple *aa;
4513 std::vector<double> bb;
4515 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4520 if(!self->getArray())
4521 throw INTERP_KERNEL::Exception(msg2);
4522 self->getArray()->applyLin(1.,val);
4523 Py_XINCREF(trueSelf);
4528 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4531 Py_XINCREF(trueSelf);
4536 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4537 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4538 ret2->setArray(aaa);
4540 Py_XINCREF(trueSelf);
4545 if(!self->getArray())
4546 throw INTERP_KERNEL::Exception(msg2);
4547 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4548 self->getArray()->addEqual(aaa);
4549 Py_XINCREF(trueSelf);
4553 { throw INTERP_KERNEL::Exception(msg); }
4557 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4559 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.";
4560 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4563 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4565 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4569 Py_XINCREF(trueSelf);
4573 throw INTERP_KERNEL::Exception(msg);
4578 DataArrayDoubleTuple *aa;
4579 std::vector<double> bb;
4581 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4586 if(!self->getArray())
4587 throw INTERP_KERNEL::Exception(msg2);
4588 self->getArray()->applyLin(1.,-val);
4589 Py_XINCREF(trueSelf);
4594 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4597 Py_XINCREF(trueSelf);
4602 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4603 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4604 ret2->setArray(aaa);
4606 Py_XINCREF(trueSelf);
4611 if(!self->getArray())
4612 throw INTERP_KERNEL::Exception(msg2);
4613 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4614 self->getArray()->substractEqual(aaa);
4615 Py_XINCREF(trueSelf);
4619 { throw INTERP_KERNEL::Exception(msg); }
4623 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4625 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.";
4626 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4629 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4631 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4635 Py_XINCREF(trueSelf);
4639 throw INTERP_KERNEL::Exception(msg);
4644 DataArrayDoubleTuple *aa;
4645 std::vector<double> bb;
4647 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4652 if(!self->getArray())
4653 throw INTERP_KERNEL::Exception(msg2);
4654 self->getArray()->applyLin(val,0);
4655 Py_XINCREF(trueSelf);
4660 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4663 Py_XINCREF(trueSelf);
4668 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4669 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4670 ret2->setArray(aaa);
4672 Py_XINCREF(trueSelf);
4677 if(!self->getArray())
4678 throw INTERP_KERNEL::Exception(msg2);
4679 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4680 self->getArray()->multiplyEqual(aaa);
4681 Py_XINCREF(trueSelf);
4685 { throw INTERP_KERNEL::Exception(msg); }
4689 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4691 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.";
4692 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4695 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4697 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4701 Py_XINCREF(trueSelf);
4705 throw INTERP_KERNEL::Exception(msg);
4710 DataArrayDoubleTuple *aa;
4711 std::vector<double> bb;
4713 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4719 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4720 if(!self->getArray())
4721 throw INTERP_KERNEL::Exception(msg2);
4722 self->getArray()->applyLin(1./val,0);
4723 Py_XINCREF(trueSelf);
4728 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4731 Py_XINCREF(trueSelf);
4736 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4737 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4738 ret2->setArray(aaa);
4740 Py_XINCREF(trueSelf);
4745 if(!self->getArray())
4746 throw INTERP_KERNEL::Exception(msg2);
4747 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4748 self->getArray()->divideEqual(aaa);
4749 Py_XINCREF(trueSelf);
4753 { throw INTERP_KERNEL::Exception(msg); }
4757 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4759 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.";
4760 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4763 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4765 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4769 Py_XINCREF(trueSelf);
4773 throw INTERP_KERNEL::Exception(msg);
4778 DataArrayDoubleTuple *aa;
4779 std::vector<double> bb;
4781 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4786 if(!self->getArray())
4787 throw INTERP_KERNEL::Exception(msg2);
4788 self->getArray()->applyPow(val);
4789 Py_XINCREF(trueSelf);
4794 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4797 Py_XINCREF(trueSelf);
4802 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4803 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4804 ret2->setArray(aaa);
4806 Py_XINCREF(trueSelf);
4811 if(!self->getArray())
4812 throw INTERP_KERNEL::Exception(msg2);
4813 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4814 self->getArray()->powEqual(aaa);
4815 Py_XINCREF(trueSelf);
4819 { throw INTERP_KERNEL::Exception(msg); }
4823 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4825 std::vector<const MEDCouplingFieldDouble *> tmp;
4826 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4827 return MEDCouplingFieldDouble::MergeFields(tmp);
4830 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4832 std::vector<const MEDCouplingFieldDouble *> tmp;
4833 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4834 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4837 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4839 std::vector<double> a0;
4840 std::vector<int> a1;
4841 std::vector<std::string> a2;
4842 self->getTinySerializationDbleInformation(a0);
4843 self->getTinySerializationIntInformation(a1);
4844 self->getTinySerializationStrInformation(a2);
4846 PyObject *ret(PyTuple_New(3));
4847 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4848 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
4850 PyObject *ret2(PyList_New(sz));
4852 for(int i=0;i<sz;i++)
4853 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
4855 PyTuple_SetItem(ret,2,ret2);
4859 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
4861 DataArrayInt *ret0(0);
4862 std::vector<DataArrayDouble *> ret1;
4863 self->serialize(ret0,ret1);
4866 std::size_t sz(ret1.size());
4867 PyObject *ret(PyTuple_New(2));
4868 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4869 PyObject *ret1Py(PyList_New(sz));
4870 for(std::size_t i=0;i<sz;i++)
4874 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4876 PyTuple_SetItem(ret,1,ret1Py);
4880 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
4882 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
4883 if(!PyTuple_Check(args))
4884 throw INTERP_KERNEL::Exception(MSG);
4885 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
4886 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
4887 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
4889 PyObject *tmp0(PyTuple_New(1));
4890 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
4891 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
4893 Py_DECREF(selfMeth);
4894 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
4895 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
4896 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
4898 PyObject *a(PyInt_FromLong(0));
4899 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
4902 throw INTERP_KERNEL::Exception(MSG);
4903 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
4904 throw INTERP_KERNEL::Exception(MSG);
4905 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
4908 Py_DECREF(initMeth);
4913 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
4914 {// put an empty dict in input to say to __new__ to call __init__...
4915 self->checkCoherency();
4916 PyObject *ret(PyTuple_New(1));
4917 PyObject *ret0(PyDict_New());
4919 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
4920 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
4921 PyDict_SetItem(ret0,a,d);
4922 Py_DECREF(a); Py_DECREF(d);
4924 PyTuple_SetItem(ret,0,ret0);
4928 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
4930 self->checkCoherency();
4931 PyObject *ret0(ParaMEDMEM_MEDCouplingFieldDouble_getTinySerializationInformation(self));
4932 PyObject *ret1(ParaMEDMEM_MEDCouplingFieldDouble_serialize(self));
4933 const MEDCouplingMesh *mesh(self->getMesh());
4936 PyObject *ret(PyTuple_New(3));
4937 PyTuple_SetItem(ret,0,ret0);
4938 PyTuple_SetItem(ret,1,ret1);
4939 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
4943 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
4945 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
4946 if(!PyTuple_Check(inp))
4947 throw INTERP_KERNEL::Exception(MSG);
4948 int sz(PyTuple_Size(inp));
4950 throw INTERP_KERNEL::Exception(MSG);
4952 PyObject *elt2(PyTuple_GetItem(inp,2));
4954 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,0|0));
4955 if(!SWIG_IsOK(status))
4956 throw INTERP_KERNEL::Exception(MSG);
4957 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
4959 PyObject *elt0(PyTuple_GetItem(inp,0));
4960 PyObject *elt1(PyTuple_GetItem(inp,1));
4961 std::vector<double> a0;
4962 std::vector<int> a1;
4963 std::vector<std::string> a2;
4964 DataArrayInt *b0(0);
4965 std::vector<DataArrayDouble *>b1;
4967 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
4968 throw INTERP_KERNEL::Exception(MSG);
4969 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
4971 fillArrayWithPyListDbl3(a0py,tmp,a0);
4972 convertPyToNewIntArr3(a1py,a1);
4973 fillStringVector(a2py,a2);
4976 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
4977 throw INTERP_KERNEL::Exception(MSG);
4978 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
4980 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0));
4981 if(!SWIG_IsOK(status))
4982 throw INTERP_KERNEL::Exception(MSG);
4983 b0=reinterpret_cast<DataArrayInt *>(argp);
4984 convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayDouble *>(b1py,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",b1);
4986 self->checkForUnserialization(a1,b0,b1);
4987 // useless here to call resizeForUnserialization because arrays are well resized.
4988 self->finishUnserialization(a1,a0,a2);
4993 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4996 int getNumberOfFields() const;
4997 MEDCouplingMultiFields *deepCpy() const;
4998 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4999 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5000 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5001 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5002 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
5005 std::string __str__() const throw(INTERP_KERNEL::Exception)
5007 return self->simpleRepr();
5009 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5011 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
5012 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5014 std::vector<MEDCouplingFieldDouble *> fs(sz);
5015 for(int i=0;i<sz;i++)
5016 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5017 return MEDCouplingMultiFields::New(fs);
5019 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5021 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
5022 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5024 std::vector<MEDCouplingFieldDouble *> fs(sz);
5025 for(int i=0;i<sz;i++)
5026 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5027 return MEDCouplingMultiFields::New(fs);
5029 PyObject *getFields() const
5031 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5032 int sz=fields.size();
5033 PyObject *res = PyList_New(sz);
5034 for(int i=0;i<sz;i++)
5038 fields[i]->incrRef();
5039 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5043 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
5048 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5050 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5054 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5057 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
5059 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5061 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5063 PyObject *res = PyList_New(sz);
5064 for(int i=0;i<sz;i++)
5069 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5073 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
5078 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5080 std::vector<int> refs;
5081 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5083 PyObject *res = PyList_New(sz);
5084 for(int i=0;i<sz;i++)
5089 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5093 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
5097 PyObject *ret=PyTuple_New(2);
5098 PyTuple_SetItem(ret,0,res);
5099 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5102 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5104 std::vector<DataArrayDouble *> ms=self->getArrays();
5106 PyObject *res = PyList_New(sz);
5107 for(int i=0;i<sz;i++)
5112 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5116 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
5121 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5123 std::vector< std::vector<int> > refs;
5124 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5126 PyObject *res = PyList_New(sz);
5127 PyObject *res2 = PyList_New(sz);
5128 for(int i=0;i<sz;i++)
5133 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5137 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
5139 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5142 PyObject *ret=PyTuple_New(2);
5143 PyTuple_SetItem(ret,0,res);
5144 PyTuple_SetItem(ret,1,res2);
5150 class MEDCouplingDefinitionTime
5153 MEDCouplingDefinitionTime();
5154 void assign(const MEDCouplingDefinitionTime& other);
5155 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5156 double getTimeResolution() const;
5157 std::vector<double> getHotSpotsTime() const;
5160 std::string __str__() const throw(INTERP_KERNEL::Exception)
5162 std::ostringstream oss;
5163 self->appendRepr(oss);
5167 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5169 int meshId,arrId,arrIdInField,fieldId;
5170 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5171 PyObject *res=PyList_New(4);
5172 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5173 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5174 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5175 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5179 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5181 int meshId,arrId,arrIdInField,fieldId;
5182 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5183 PyObject *res=PyList_New(4);
5184 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5185 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5186 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5187 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5193 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5196 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5197 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5201 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5203 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
5204 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5206 std::vector<MEDCouplingFieldDouble *> fs(sz);
5207 for(int i=0;i<sz;i++)
5208 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5209 return MEDCouplingFieldOverTime::New(fs);
5211 std::string __str__() const throw(INTERP_KERNEL::Exception)
5213 return self->simpleRepr();
5215 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5217 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
5218 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5220 std::vector<MEDCouplingFieldDouble *> fs(sz);
5221 for(int i=0;i<sz;i++)
5222 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5223 return MEDCouplingFieldOverTime::New(fs);
5228 class MEDCouplingCartesianAMRMesh;
5230 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5233 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5234 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5235 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5238 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5240 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5248 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5251 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5252 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5253 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5256 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5258 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5259 return convertFromVectorPairInt(ret);
5262 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5264 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5265 return convertFromVectorPairInt(ret);
5268 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5270 std::vector< std::pair<int,int> > inp;
5271 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5272 self->addPatch(inp,factors);
5275 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5277 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5279 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5280 if(patchId==mesh->getNumberOfPatches())
5282 std::ostringstream oss;
5283 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5284 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5287 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5293 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5295 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5297 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5298 mesh->removePatch(patchId);
5301 int __len__() const throw(INTERP_KERNEL::Exception)
5303 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5305 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5306 return mesh->getNumberOfPatches();
5311 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5315 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5318 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5319 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5320 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5321 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5322 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5323 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5324 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5325 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5326 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5327 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5328 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5329 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5330 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5332 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5333 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5334 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5335 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5336 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5337 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5338 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5339 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5340 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5341 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5342 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5343 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5344 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5345 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5346 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5347 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5348 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5349 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5350 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5351 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5354 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5356 std::vector< std::pair<int,int> > inp;
5357 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5358 self->addPatch(inp,factors);
5361 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5363 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5365 PyObject *ret = PyList_New(sz);
5366 for(int i=0;i<sz;i++)
5368 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5371 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5376 // agy : don't know why typemap fails here ??? let it in the extend section
5377 PyObject *deepCpy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5379 return convertCartesianAMRMesh(self->deepCpy(father), SWIG_POINTER_OWN | 0 );
5382 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5384 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5385 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5391 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5393 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5394 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5400 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5402 std::vector<int> out1;
5403 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5404 PyObject *ret(PyTuple_New(2));
5405 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5406 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5410 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5412 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5414 PyObject *ret = PyList_New(sz);
5415 for(int i=0;i<sz;i++)
5416 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5420 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5422 std::vector<const DataArrayDouble *> inp;
5423 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",inp);
5424 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5427 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5429 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5435 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5437 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5443 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5445 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5451 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5453 const MEDCouplingIMesh *ret(self->getImageMesh());
5456 return const_cast<MEDCouplingIMesh *>(ret);
5459 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5461 if(patchId==self->getNumberOfPatches())
5463 std::ostringstream oss;
5464 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5465 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5468 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5474 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5476 std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
5477 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5478 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5481 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5483 std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
5484 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5485 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5488 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5490 self->removePatch(patchId);
5493 int __len__() const throw(INTERP_KERNEL::Exception)
5495 return self->getNumberOfPatches();
5500 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5504 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5507 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5510 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5512 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5513 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5514 const int *nodeStrctPtr(0);
5515 const double *originPtr(0),*dxyzPtr(0);
5517 std::vector<int> bb0;
5518 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5521 std::vector<double> bb,bb2;
5523 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5524 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5526 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5529 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5531 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5532 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5533 std::vector< std::vector<int> > inp2;
5534 convertPyToVectorOfVectorOfInt(factors,inp2);
5535 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5538 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5540 return ParaMEDMEM_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5543 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5545 return MEDCouplingCartesianAMRMesh::New(mesh);
5550 class MEDCouplingDataForGodFather : public RefCountObject
5553 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5554 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5555 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5556 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5557 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5558 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5559 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5560 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5561 virtual void alloc() throw(INTERP_KERNEL::Exception);
5562 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5565 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5567 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5575 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5578 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5579 MEDCouplingAMRAttribute *deepCpy() const throw(INTERP_KERNEL::Exception);
5580 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5581 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5582 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5583 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5584 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5585 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5586 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5589 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5591 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5592 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5593 MEDCouplingAMRAttribute *ret(0);
5596 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5597 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5599 catch(INTERP_KERNEL::Exception&)
5601 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5602 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5607 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5609 return ParaMEDMEM_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5612 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5614 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5615 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5621 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5623 std::vector< std::vector<std::string> > compNamesCpp;
5624 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5625 self->spillInfoOnComponents(compNamesCpp);
5628 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5630 std::vector<int> inp0;
5631 if(!fillIntVector(nfs,inp0))
5632 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5633 std::size_t sz(inp0.size());
5634 std::vector<NatureOfField> inp00(sz);
5635 for(std::size_t i=0;i<sz;i++)
5636 inp00[i]=(NatureOfField)inp0[i];
5637 self->spillNatures(inp00);
5640 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5642 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5643 int sz((int)ret.size());
5644 PyObject *retPy(PyList_New(sz));
5645 for(int i=0;i<sz;i++)
5646 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5652 class DenseMatrix : public RefCountObject, public TimeLabel
5655 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5656 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5657 DenseMatrix *deepCpy() const throw(INTERP_KERNEL::Exception);
5658 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5660 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5661 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5662 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5663 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5664 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5665 void transpose() throw(INTERP_KERNEL::Exception);
5667 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5668 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5669 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5672 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5674 return DenseMatrix::New(nbRows,nbCols);
5677 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5679 return DenseMatrix::New(array,nbRows,nbCols);
5682 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5685 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5686 PyObject *ret=PyTuple_New(2);
5687 PyObject *ret0Py=ret0?Py_True:Py_False;
5689 PyTuple_SetItem(ret,0,ret0Py);
5690 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5694 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5696 DataArrayDouble *ret(self->getData());
5702 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5704 return ParaMEDMEM::DenseMatrix::Add(self,other);
5707 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5709 return ParaMEDMEM::DenseMatrix::Substract(self,other);
5712 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5714 return ParaMEDMEM::DenseMatrix::Multiply(self,other);
5717 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5719 return ParaMEDMEM::DenseMatrix::Multiply(self,other);
5722 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5724 self->addEqual(other);
5725 Py_XINCREF(trueSelf);
5729 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5731 self->substractEqual(other);
5732 Py_XINCREF(trueSelf);
5736 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5738 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5745 class PartDefinition : public RefCountObject, public TimeLabel
5748 static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5749 static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5750 virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
5751 virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
5752 virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
5753 virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
5754 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
5755 virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
5758 virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
5760 return (*self)+other;
5763 virtual PyObject *isEqual(const PartDefinition *other) const throw(INTERP_KERNEL::Exception)
5766 bool ret0(self->isEqual(other,ret1));
5767 PyObject *ret=PyTuple_New(2);
5768 PyObject *ret0Py=ret0?Py_True:Py_False;
5770 PyTuple_SetItem(ret,0,ret0Py);
5771 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5775 virtual PyObject *deepCpy() const throw(INTERP_KERNEL::Exception)
5777 return convertPartDefinition(self->deepCpy(),SWIG_POINTER_OWN | 0);
5781 virtual ~PartDefinition();
5784 class DataArrayPartDefinition : public PartDefinition
5787 static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5790 DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
5792 return DataArrayPartDefinition::New(listOfIds);
5795 std::string __str__() const throw(INTERP_KERNEL::Exception)
5797 return self->getRepr();
5800 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5802 std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
5803 oss << self->getRepr();
5808 virtual ~DataArrayPartDefinition();
5811 class SlicePartDefinition : public PartDefinition
5814 static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5815 int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
5818 SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
5820 return SlicePartDefinition::New(start,stop,step);
5823 PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
5826 self->getSlice(a,b,c);
5827 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
5830 std::string __str__() const throw(INTERP_KERNEL::Exception)
5832 return self->getRepr();
5835 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5837 std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
5838 oss << self->getRepr();
5843 virtual ~SlicePartDefinition();
5849 __filename=os.environ.get('PYTHONSTARTUP')
5850 if __filename and os.path.isfile(__filename):
5851 execfile(__filename)