1 // Copyright (C) 2007-2016 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)
23 #ifdef WITH_DOCSTRINGS
24 %include MEDCoupling_doc.i
31 #include "MEDCouplingMemArray.hxx"
32 #include "MEDCouplingUMesh.hxx"
33 #include "MEDCouplingMappedExtrudedMesh.hxx"
34 #include "MEDCouplingCMesh.hxx"
35 #include "MEDCouplingIMesh.hxx"
36 #include "MEDCouplingCurveLinearMesh.hxx"
37 #include "MEDCoupling1GTUMesh.hxx"
38 #include "MEDCouplingField.hxx"
39 #include "MEDCouplingFieldDouble.hxx"
40 #include "MEDCouplingFieldInt.hxx"
41 #include "MEDCouplingFieldTemplate.hxx"
42 #include "MEDCouplingGaussLocalization.hxx"
44 #include "MEDCouplingMultiFields.hxx"
45 #include "MEDCouplingFieldOverTime.hxx"
46 #include "MEDCouplingDefinitionTime.hxx"
47 #include "MEDCouplingFieldDiscretization.hxx"
48 #include "MEDCouplingCartesianAMRMesh.hxx"
49 #include "MEDCouplingAMRAttribute.hxx"
50 #include "MEDCouplingMatrix.hxx"
51 #include "MEDCouplingPartDefinition.hxx"
52 #include "MEDCouplingSkyLineArray.hxx"
53 #include "MEDCouplingTypemaps.i"
55 #include "InterpKernelAutoPtr.hxx"
56 #include "BoxSplittingOptions.hxx"
58 using namespace MEDCoupling;
59 using namespace INTERP_KERNEL;
63 %template(ivec) std::vector<int>;
64 %template(dvec) std::vector<double>;
65 %template(svec) std::vector<std::string>;
68 %typemap(out) MEDCoupling::MEDCouplingMesh*
70 $result=convertMesh($1,$owner);
73 %typemap(out) MEDCouplingMesh*
75 $result=convertMesh($1,$owner);
80 %typemap(out) MEDCoupling::MEDCouplingPointSet*
82 $result=convertMesh($1,$owner);
85 %typemap(out) MEDCouplingPointSet*
87 $result=convertMesh($1,$owner);
92 %typemap(out) MEDCouplingCartesianAMRPatchGen*
94 $result=convertCartesianAMRPatch($1,$owner);
99 %typemap(out) MEDCouplingCartesianAMRMeshGen*
101 $result=convertCartesianAMRMesh($1,$owner);
106 %typemap(out) MEDCouplingDataForGodFather*
108 $result=convertDataForGodFather($1,$owner);
113 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
115 $result=convertMesh($1,$owner);
118 %typemap(out) MEDCoupling1GTUMesh*
120 $result=convertMesh($1,$owner);
125 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
127 $result=convertMesh($1,$owner);
130 %typemap(out) MEDCouplingStructuredMesh*
132 $result=convertMesh($1,$owner);
137 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
139 $result=convertFieldDiscretization($1,$owner);
142 %typemap(out) MEDCouplingFieldDiscretization*
144 $result=convertFieldDiscretization($1,$owner);
149 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
151 $result=convertMultiFields($1,$owner);
154 %typemap(out) MEDCouplingMultiFields*
156 $result=convertMultiFields($1,$owner);
161 %typemap(out) MEDCoupling::PartDefinition*
163 $result=convertPartDefinition($1,$owner);
166 %typemap(out) PartDefinition*
168 $result=convertPartDefinition($1,$owner);
173 %init %{ import_array(); %}
176 %feature("autodoc", "1");
177 %feature("docstring");
179 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
180 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
181 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
182 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
183 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
184 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
185 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
186 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
187 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
188 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
189 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
190 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
191 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
192 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
193 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
194 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
195 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
196 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
197 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
198 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
199 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
200 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
201 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
202 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
203 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
204 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
205 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
206 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
207 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
208 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
209 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
210 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
211 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
212 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
213 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
214 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
215 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
216 %newobject MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear;
217 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
218 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
235 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
236 %newobject MEDCoupling::MEDCouplingFieldInt::New;
237 %newobject MEDCoupling::MEDCouplingFieldInt::convertToDblField;
238 %newobject MEDCoupling::MEDCouplingFieldInt::getArray;
239 %newobject MEDCoupling::MEDCouplingFieldInt::deepCopy;
240 %newobject MEDCoupling::MEDCouplingFieldInt::clone;
241 %newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh;
242 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
243 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
244 %newobject MEDCoupling::MEDCouplingMesh::clone;
245 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
246 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
247 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
248 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
249 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
250 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
251 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
252 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
253 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
254 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
255 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
256 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
257 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
258 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
259 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
260 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
261 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
262 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
263 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
264 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
265 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
266 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
267 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
268 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
269 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
270 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
271 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
272 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
273 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
274 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
275 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
276 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
277 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
278 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
279 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
280 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
281 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
282 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
283 %newobject MEDCoupling::MEDCouplingUMesh::New;
284 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
285 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
286 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
287 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
288 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
289 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
290 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
291 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
292 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
293 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
294 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
295 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
296 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
297 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
298 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
299 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
300 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
301 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
302 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
303 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
304 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
305 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
306 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
307 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
308 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
309 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
310 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
311 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
312 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
313 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
314 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
315 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
316 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
317 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
318 %newobject MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords;
319 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
320 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
321 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
322 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
323 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
324 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
325 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
326 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
327 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
328 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
329 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
330 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
331 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
332 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
333 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
334 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
335 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
336 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
337 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
338 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
339 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
340 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
341 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
342 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
343 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
344 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
345 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
346 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
347 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
348 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
349 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
350 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
351 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
352 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
353 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
354 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
355 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
356 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
357 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
358 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
359 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
360 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
361 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
362 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
363 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
364 %newobject MEDCoupling::MEDCouplingCMesh::New;
365 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
366 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
367 %newobject MEDCoupling::MEDCouplingIMesh::New;
368 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
369 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
370 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
371 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
372 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
373 %newobject MEDCoupling::MEDCouplingMultiFields::New;
374 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
375 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
376 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
377 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
378 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
379 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
380 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
381 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
382 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
383 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
384 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
385 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
386 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
387 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
388 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
389 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
390 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
391 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
392 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
393 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
394 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
395 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
396 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
397 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
398 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
399 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
400 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
401 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
402 %newobject MEDCoupling::DenseMatrix::New;
403 %newobject MEDCoupling::DenseMatrix::deepCopy;
404 %newobject MEDCoupling::DenseMatrix::shallowCpy;
405 %newobject MEDCoupling::DenseMatrix::getData;
406 %newobject MEDCoupling::DenseMatrix::matVecMult;
407 %newobject MEDCoupling::DenseMatrix::MatVecMult;
408 %newobject MEDCoupling::DenseMatrix::__add__;
409 %newobject MEDCoupling::DenseMatrix::__sub__;
410 %newobject MEDCoupling::DenseMatrix::__mul__;
411 %newobject MEDCoupling::PartDefinition::New;
412 %newobject MEDCoupling::PartDefinition::toDAI;
413 %newobject MEDCoupling::PartDefinition::__add__;
414 %newobject MEDCoupling::PartDefinition::composeWith;
415 %newobject MEDCoupling::PartDefinition::tryToSimplify;
416 %newobject MEDCoupling::DataArrayPartDefinition::New;
417 %newobject MEDCoupling::SlicePartDefinition::New;
418 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
419 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
421 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
422 %feature("unref") MEDCouplingMesh "$this->decrRef();"
423 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
424 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
425 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
426 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
427 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
428 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
429 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
430 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
431 %feature("unref") MEDCouplingField "$this->decrRef();"
432 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
433 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
434 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
435 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
436 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
437 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
438 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
439 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
440 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
441 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
442 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
443 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
444 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
445 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
446 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
447 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
448 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
449 %feature("unref") DenseMatrix "$this->decrRef();"
450 %feature("unref") PartDefinition "$this->decrRef();"
451 %feature("unref") DataArrayPartDefinition "$this->decrRef();"
452 %feature("unref") SlicePartDefinition "$this->decrRef();"
453 %feature("unref") MEDCouplingSkyLineArray "$this->decrRef();"
455 %rename(assign) *::operator=;
456 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
457 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
458 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
459 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
463 %rename (InterpKernelException) INTERP_KERNEL::Exception;
465 %include "MEDCouplingRefCountObject.i"
466 %include "MEDCouplingMemArray.i"
468 namespace INTERP_KERNEL
471 * \class BoxSplittingOptions
472 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
474 class BoxSplittingOptions
477 BoxSplittingOptions();
478 void init() throw(INTERP_KERNEL::Exception);
479 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
480 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
481 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
482 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
483 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
484 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
485 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
486 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
487 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
488 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
489 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
490 std::string printOptions() const throw(INTERP_KERNEL::Exception);
493 std::string __str__() const throw(INTERP_KERNEL::Exception)
495 return self->printOptions();
501 namespace MEDCoupling
517 CONST_ON_TIME_INTERVAL = 7
518 } TypeOfTimeDiscretization;
526 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
527 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
529 } MEDCouplingMeshType;
532 class DataArrayDouble;
533 class MEDCouplingUMesh;
534 class MEDCouplingCMesh;
535 class MEDCouplingFieldDouble;
537 %extend RefCountObject
539 std::string getHiddenCppPointer() const
541 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
546 %extend MEDCouplingGaussLocalization
548 std::string __str__() const throw(INTERP_KERNEL::Exception)
550 return self->getStringRepr();
553 std::string __repr__() const throw(INTERP_KERNEL::Exception)
555 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
556 oss << self->getStringRepr();
563 class MEDCouplingMesh : public RefCountObject, public TimeLabel
566 void setName(const std::string& name);
567 std::string getName() const;
568 void setDescription(const std::string& descr);
569 std::string getDescription() const;
570 void setTime(double val, int iteration, int order);
571 void setTimeUnit(const std::string& unit);
572 std::string getTimeUnit() const;
573 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
574 bool isStructured() const throw(INTERP_KERNEL::Exception);
575 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
576 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
577 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
578 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
579 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
580 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
581 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
582 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
583 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
584 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
585 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
586 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
587 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
588 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
589 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
590 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
591 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
592 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
593 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
594 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
595 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
596 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
597 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
598 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
599 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
600 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
601 virtual std::string getVTKFileExtension() const;
602 std::string getVTKFileNameOf(const std::string& fileName) const;
604 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
605 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
606 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
607 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
608 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
609 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
610 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
611 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
612 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
613 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
614 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);
615 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
616 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
617 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
618 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
619 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
620 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
621 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
624 std::string __str__() const throw(INTERP_KERNEL::Exception)
626 return self->simpleRepr();
629 PyObject *getTime() throw(INTERP_KERNEL::Exception)
632 double tmp0=self->getTime(tmp1,tmp2);
633 PyObject *res = PyList_New(3);
634 PyList_SetItem(res,0,SWIG_From_double(tmp0));
635 PyList_SetItem(res,1,SWIG_From_int(tmp1));
636 PyList_SetItem(res,2,SWIG_From_int(tmp2));
640 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
642 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
643 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
649 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
653 DataArrayDoubleTuple *aa;
654 std::vector<double> bb;
656 int spaceDim=self->getSpaceDimension();
657 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
658 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
659 return self->getCellContainingPoint(pos,eps);
662 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
666 DataArrayDoubleTuple *aa;
667 std::vector<double> bb;
669 int spaceDim=self->getSpaceDimension();
670 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
671 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
672 MCAuto<DataArrayInt> elts,eltsIndex;
673 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
674 PyObject *ret=PyTuple_New(2);
675 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
676 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
680 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
682 MCAuto<DataArrayInt> elts,eltsIndex;
683 int spaceDim=self->getSpaceDimension();
685 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
686 if (!SWIG_IsOK(res1))
689 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
690 int nbOfPoints=size/spaceDim;
693 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
695 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
699 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
701 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
702 da2->checkAllocated();
703 int size=da2->getNumberOfTuples();
704 int nbOfCompo=da2->getNumberOfComponents();
705 if(nbOfCompo!=spaceDim)
707 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
709 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
711 PyObject *ret=PyTuple_New(2);
712 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
713 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
717 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
721 DataArrayDoubleTuple *aa;
722 std::vector<double> bb;
724 int spaceDim=self->getSpaceDimension();
725 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
726 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
727 std::vector<int> elts;
728 self->getCellsContainingPoint(pos,eps,elts);
729 DataArrayInt *ret=DataArrayInt::New();
730 ret->alloc((int)elts.size(),1);
731 std::copy(elts.begin(),elts.end(),ret->getPointer());
732 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
735 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
737 MCAuto<DataArrayInt> d0=DataArrayInt::New();
738 MCAuto<DataArrayInt> d1=DataArrayInt::New();
739 self->getReverseNodalConnectivity(d0,d1);
740 PyObject *ret=PyTuple_New(2);
741 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
742 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
746 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
749 int v0; std::vector<int> v1;
750 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
751 self->renumberCells(ids,check);
754 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
756 DataArrayInt *cellCor, *nodeCor;
757 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
758 PyObject *res = PyList_New(2);
759 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
760 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
764 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
766 DataArrayInt *cellCor=0,*nodeCor=0;
767 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
768 PyObject *res = PyList_New(2);
769 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
770 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
774 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
776 DataArrayInt *cellCor=0;
777 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
781 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
784 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
785 if (!SWIG_IsOK(res1))
788 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
789 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
793 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
795 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
796 da2->checkAllocated();
797 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
800 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
802 std::vector<int> conn;
803 self->getNodeIdsOfCell(cellId,conn);
804 return convertIntArrToPyList2(conn);
807 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
809 std::vector<double> coo;
810 self->getCoordinatesOfNode(nodeId,coo);
811 return convertDblArrToPyList2(coo);
814 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
818 DataArrayDoubleTuple *aa;
819 std::vector<double> bb;
821 int spaceDim=self->getSpaceDimension();
822 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
823 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
824 self->scale(pointPtr,factor);
827 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
829 int spaceDim=self->getSpaceDimension();
830 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
831 self->getBoundingBox(tmp);
832 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
836 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
839 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
840 PyObject *ret=PyTuple_New(2);
841 PyObject *ret0Py=ret0?Py_True:Py_False;
843 PyTuple_SetItem(ret,0,ret0Py);
844 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
848 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
850 int szArr,sw,iTypppArr;
851 std::vector<int> stdvecTyyppArr;
852 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
853 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
854 if(sw==3)//DataArrayInt
856 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
857 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
858 std::string name=argpt->getName();
860 ret->setName(name.c_str());
862 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
865 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
867 int szArr,sw,iTypppArr;
868 std::vector<int> stdvecTyyppArr;
870 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
871 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
872 if(sw==3)//DataArrayInt
874 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
875 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
876 std::string name=argpt->getName();
878 ret->setName(name.c_str());
881 PyObject *res = PyList_New(2);
882 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
883 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
884 PyList_SetItem(res,0,obj0);
885 PyList_SetItem(res,1,obj1);
889 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
893 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
894 PyObject *res = PyTuple_New(2);
895 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
898 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
900 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
901 PyTuple_SetItem(res,0,obj0);
902 PyTuple_SetItem(res,1,obj1);
906 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
908 std::vector<int> vals=self->getDistributionOfTypes();
910 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
911 PyObject *ret=PyList_New((int)vals.size()/3);
912 for(int j=0;j<(int)vals.size()/3;j++)
914 PyObject *ret1=PyList_New(3);
915 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
916 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
917 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
918 PyList_SetItem(ret,j,ret1);
923 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
925 std::vector<int> code;
926 std::vector<const DataArrayInt *> idsPerType;
927 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
928 convertPyToNewIntArr4(li,1,3,code);
929 return self->checkTypeConsistencyAndContig(code,idsPerType);
932 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
934 std::vector<int> code;
935 std::vector<DataArrayInt *> idsInPflPerType;
936 std::vector<DataArrayInt *> idsPerType;
937 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
938 PyObject *ret=PyTuple_New(3);
941 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
942 PyObject *ret0=PyList_New((int)code.size()/3);
943 for(int j=0;j<(int)code.size()/3;j++)
945 PyObject *ret00=PyList_New(3);
946 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
947 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
948 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
949 PyList_SetItem(ret0,j,ret00);
951 PyTuple_SetItem(ret,0,ret0);
953 PyObject *ret1=PyList_New(idsInPflPerType.size());
954 for(std::size_t j=0;j<idsInPflPerType.size();j++)
955 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
956 PyTuple_SetItem(ret,1,ret1);
957 int n=idsPerType.size();
958 PyObject *ret2=PyList_New(n);
960 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
961 PyTuple_SetItem(ret,2,ret2);
965 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
969 DataArrayDoubleTuple *aa;
970 std::vector<double> bb;
972 int spaceDim=self->getSpaceDimension();
973 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
974 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
975 self->translate(vectorPtr);
978 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
980 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
983 DataArrayDoubleTuple *aa;
984 std::vector<double> bb;
986 int spaceDim=self->getSpaceDimension();
987 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
988 self->rotate(centerPtr,0,alpha);
991 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
993 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
995 DataArrayDouble *a,*a2;
996 DataArrayDoubleTuple *aa,*aa2;
997 std::vector<double> bb,bb2;
999 int spaceDim=self->getSpaceDimension();
1000 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1001 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
1002 self->rotate(centerPtr,vectorPtr,alpha);
1005 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1007 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1008 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1009 PyObject *res=PyList_New(result.size());
1010 for(int i=0;iL!=result.end(); i++, iL++)
1011 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1015 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
1017 std::vector<double> a0;
1018 std::vector<int> a1;
1019 std::vector<std::string> a2;
1020 self->getTinySerializationInformation(a0,a1,a2);
1021 PyObject *ret(PyTuple_New(3));
1022 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1023 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1025 PyObject *ret2(PyList_New(sz));
1027 for(int i=0;i<sz;i++)
1028 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1030 PyTuple_SetItem(ret,2,ret2);
1034 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1036 DataArrayInt *a0Tmp(0);
1037 DataArrayDouble *a1Tmp(0);
1038 self->serialize(a0Tmp,a1Tmp);
1039 PyObject *ret(PyTuple_New(2));
1040 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1041 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1045 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1047 std::vector<std::string> littleStrings;
1048 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1051 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1052 {// put an empty dict in input to say to __new__ to call __init__...
1053 PyObject *ret(PyTuple_New(1));
1054 PyObject *ret0(PyDict_New());
1055 PyTuple_SetItem(ret,0,ret0);
1059 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1061 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1062 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1063 PyObject *ret(PyTuple_New(2));
1064 PyTuple_SetItem(ret,0,ret0);
1065 PyTuple_SetItem(ret,1,ret1);
1069 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1071 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1072 if(!PyTuple_Check(inp))
1073 throw INTERP_KERNEL::Exception(MSG);
1074 int sz(PyTuple_Size(inp));
1076 throw INTERP_KERNEL::Exception(MSG);
1077 PyObject *elt0(PyTuple_GetItem(inp,0));
1078 PyObject *elt1(PyTuple_GetItem(inp,1));
1079 std::vector<double> a0;
1080 std::vector<int> a1;
1081 std::vector<std::string> a2;
1082 DataArrayInt *b0(0);
1083 DataArrayDouble *b1(0);
1085 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1086 throw INTERP_KERNEL::Exception(MSG);
1087 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1089 fillArrayWithPyListDbl3(a0py,tmp,a0);
1090 convertPyToNewIntArr3(a1py,a1);
1091 fillStringVector(a2py,a2);
1094 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1095 throw INTERP_KERNEL::Exception(MSG);
1096 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1098 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1099 if(!SWIG_IsOK(status))
1100 throw INTERP_KERNEL::Exception(MSG);
1101 b0=reinterpret_cast<DataArrayInt *>(argp);
1102 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1103 if(!SWIG_IsOK(status))
1104 throw INTERP_KERNEL::Exception(MSG);
1105 b1=reinterpret_cast<DataArrayDouble *>(argp);
1107 // useless here to call resizeForUnserialization because arrays are well resized.
1108 self->unserialization(a0,a1,b0,b1,a2);
1111 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1113 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1114 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1115 return MEDCouplingMesh::MergeMeshes(tmp);
1121 //== MEDCouplingMesh End
1123 %include "NormalizedGeometricTypes"
1124 %include "MEDCouplingNatureOfFieldEnum"
1126 namespace MEDCoupling
1128 class MEDCouplingNatureOfField
1131 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1132 static std::string GetReprNoThrow(NatureOfField nat);
1133 static std::string GetAllPossibilitiesStr();
1137 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1138 // include "MEDCouplingTimeDiscretization.i"
1140 namespace MEDCoupling
1142 class MEDCouplingGaussLocalization
1145 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1146 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1147 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1148 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1149 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1150 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1151 int getDimension() const throw(INTERP_KERNEL::Exception);
1152 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1153 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1154 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1155 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1157 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1158 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1159 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1160 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1161 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1162 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1163 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1164 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1165 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1166 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1167 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1168 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1170 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1174 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const throw(INTERP_KERNEL::Exception)
1176 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1180 MEDCouplingUMesh *buildRefCell() const throw(INTERP_KERNEL::Exception)
1182 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1188 class MEDCouplingSkyLineArray
1191 void set( DataArrayInt* index, DataArrayInt* value );
1192 int getNumberOf() const;
1193 int getLength() const;
1194 DataArrayInt* getIndexArray() const;
1195 DataArrayInt* getValuesArray() const;
1198 MEDCouplingSkyLineArray() throw(INTERP_KERNEL::Exception)
1200 return MEDCouplingSkyLineArray::New();
1203 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value) throw(INTERP_KERNEL::Exception)
1205 return MEDCouplingSkyLineArray::New(index, value);
1208 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value ) throw(INTERP_KERNEL::Exception)
1210 return MEDCouplingSkyLineArray::New(index, value);
1213 std::string __str__() const throw(INTERP_KERNEL::Exception)
1215 return self->simpleRepr();
1222 %include "MEDCouplingFieldDiscretization.i"
1224 //== MEDCouplingPointSet
1226 namespace MEDCoupling
1228 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1231 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1232 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1233 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1234 void zipCoords() throw(INTERP_KERNEL::Exception);
1235 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1236 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1237 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1238 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1239 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1240 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1241 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1242 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1243 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1244 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1245 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1246 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1247 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1248 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1249 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1250 virtual DataArrayInt *findBoundaryNodes() const;
1251 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1252 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1253 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1254 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1255 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1256 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1257 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1258 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1259 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1262 std::string __str__() const throw(INTERP_KERNEL::Exception)
1264 return self->simpleRepr();
1267 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1270 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1271 PyObject *res = PyList_New(2);
1272 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1273 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1277 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1279 DataArrayInt *comm, *commIndex;
1280 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1281 PyObject *res = PyList_New(2);
1282 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1283 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1287 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1289 DataArrayDouble *ret1=self->getCoords();
1292 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1295 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) 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->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1301 if(sw==3)//DataArrayInt
1303 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1304 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1305 std::string name=argpt->getName();
1307 ret->setName(name.c_str());
1309 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1312 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const 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 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1318 if(sw==3)//DataArrayInt
1320 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1321 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1322 std::string name=argpt->getName();
1324 ret->setName(name.c_str());
1326 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1329 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1331 int szArr,sw,iTypppArr;
1332 std::vector<int> stdvecTyyppArr;
1333 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1334 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1335 if(sw==3)//DataArrayInt
1337 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1338 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1339 std::string name=argpt->getName();
1341 ret->setName(name.c_str());
1343 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1346 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1348 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1349 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1352 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1354 int szArr,sw,iTypppArr;
1355 std::vector<int> stdvecTyyppArr;
1356 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1357 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1358 if(sw==3)//DataArrayInt
1360 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1361 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1362 std::string name=argpt->getName();
1364 ret->setName(name.c_str());
1366 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1369 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1371 int szArr,sw,iTypppArr;
1372 std::vector<int> stdvecTyyppArr;
1373 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1374 self->renumberNodes(tmp,newNbOfNodes);
1377 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1379 int szArr,sw,iTypppArr;
1380 std::vector<int> stdvecTyyppArr;
1381 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1382 self->renumberNodesCenter(tmp,newNbOfNodes);
1385 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1387 int spaceDim=self->getSpaceDimension();
1389 DataArrayDouble *a,*a2;
1390 DataArrayDoubleTuple *aa,*aa2;
1391 std::vector<double> bb,bb2;
1393 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1394 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1395 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1396 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1397 std::vector<int> nodes;
1398 self->findNodesOnLine(p,v,eps,nodes);
1399 DataArrayInt *ret=DataArrayInt::New();
1400 ret->alloc((int)nodes.size(),1);
1401 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1402 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1404 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1406 int spaceDim=self->getSpaceDimension();
1408 DataArrayDouble *a,*a2;
1409 DataArrayDoubleTuple *aa,*aa2;
1410 std::vector<double> bb,bb2;
1412 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1413 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1414 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1415 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1416 std::vector<int> nodes;
1417 self->findNodesOnPlane(p,v,eps,nodes);
1418 DataArrayInt *ret=DataArrayInt::New();
1419 ret->alloc((int)nodes.size(),1);
1420 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1421 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1424 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1428 DataArrayDoubleTuple *aa;
1429 std::vector<double> bb;
1431 int spaceDim=self->getSpaceDimension();
1432 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1433 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1434 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1435 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1438 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1440 DataArrayInt *c=0,*cI=0;
1444 DataArrayDoubleTuple *aa;
1445 std::vector<double> bb;
1447 int spaceDim=self->getSpaceDimension();
1448 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1449 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1450 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1451 PyObject *ret=PyTuple_New(2);
1452 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1453 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1457 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1459 DataArrayInt *c=0,*cI=0;
1460 int spaceDim=self->getSpaceDimension();
1463 DataArrayDoubleTuple *aa;
1464 std::vector<double> bb;
1467 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1468 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1470 PyObject *ret=PyTuple_New(2);
1471 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1472 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1476 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1480 DataArrayDoubleTuple *aa;
1481 std::vector<double> bb;
1483 int spaceDim=self->getSpaceDimension();
1484 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1485 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1487 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1488 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1491 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1495 std::vector<int> multiVal;
1496 std::pair<int, std::pair<int,int> > slic;
1497 MEDCoupling::DataArrayInt *daIntTyypp=0;
1498 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1502 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1504 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1506 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1508 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1512 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1514 DataArrayInt *v0=0,*v1=0;
1515 self->findCommonCells(compType,startCellId,v0,v1);
1516 PyObject *res = PyList_New(2);
1517 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1518 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1523 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1526 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1527 if (!SWIG_IsOK(res1))
1530 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1531 self->renumberNodesInConn(tmp);
1535 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1537 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1538 da2->checkAllocated();
1539 self->renumberNodesInConn(da2->getConstPointer());
1543 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1546 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1547 PyObject *ret=PyTuple_New(2);
1548 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1549 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1553 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1555 DataArrayInt *ret=0;
1557 int szArr,sw,iTypppArr;
1558 std::vector<int> stdvecTyyppArr;
1559 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1560 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1564 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1568 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1569 PyObject *res = PyList_New(3);
1570 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1571 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1572 PyList_SetItem(res,2,SWIG_From_int(ret2));
1576 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1580 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1581 PyObject *res = PyList_New(3);
1582 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1583 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1584 PyList_SetItem(res,2,SWIG_From_int(ret2));
1588 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1591 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1592 if (!SWIG_IsOK(res1))
1595 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1596 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1600 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1602 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1603 da2->checkAllocated();
1604 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1608 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1612 std::vector<int> multiVal;
1613 std::pair<int, std::pair<int,int> > slic;
1614 MEDCoupling::DataArrayInt *daIntTyypp=0;
1615 int nbc=self->getNumberOfCells();
1616 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1623 std::ostringstream oss;
1624 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1625 throw INTERP_KERNEL::Exception(oss.str().c_str());
1628 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1633 int tmp=nbc+singleVal;
1634 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1638 std::ostringstream oss;
1639 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1640 throw INTERP_KERNEL::Exception(oss.str().c_str());
1646 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1650 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1655 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1656 daIntTyypp->checkAllocated();
1657 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1660 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1664 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1667 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1668 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1669 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1670 for(int i=0;i<sz;i++)
1671 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1674 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1677 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1679 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1680 std::vector<double> val3;
1681 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1682 "Rotate2DAlg",2,true,nbNodes);
1684 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1685 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1688 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1691 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1692 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1693 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1694 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1695 for(int i=0;i<sz;i++)
1696 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1699 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1702 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1704 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1705 std::vector<double> val3;
1706 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1707 "Rotate3DAlg",3,true,nbNodes);
1709 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1710 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1711 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1716 //== MEDCouplingPointSet End
1718 class MEDCouplingUMeshCell
1721 INTERP_KERNEL::NormalizedCellType getType() const;
1724 std::string __str__() const throw(INTERP_KERNEL::Exception)
1726 return self->repr();
1729 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1732 const int *r=self->getAllConn(ret2);
1733 PyObject *ret=PyTuple_New(ret2);
1734 for(int i=0;i<ret2;i++)
1735 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1741 class MEDCouplingUMeshCellIterator
1748 MEDCouplingUMeshCell *ret=self->nextt();
1750 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1753 PyErr_SetString(PyExc_StopIteration,"No more data.");
1760 class MEDCouplingUMeshCellByTypeIterator
1763 ~MEDCouplingUMeshCellByTypeIterator();
1768 MEDCouplingUMeshCellEntry *ret=self->nextt();
1770 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1773 PyErr_SetString(PyExc_StopIteration,"No more data.");
1780 class MEDCouplingUMeshCellByTypeEntry
1783 ~MEDCouplingUMeshCellByTypeEntry();
1786 MEDCouplingUMeshCellByTypeIterator *__iter__()
1788 return self->iterator();
1793 class MEDCouplingUMeshCellEntry
1796 INTERP_KERNEL::NormalizedCellType getType() const;
1797 int getNumberOfElems() const;
1800 MEDCouplingUMeshCellIterator *__iter__()
1802 return self->iterator();
1807 //== MEDCouplingUMesh
1809 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1812 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1813 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1814 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1815 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1816 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1817 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1818 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1819 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1820 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1821 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1822 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1823 void computeTypes() throw(INTERP_KERNEL::Exception);
1824 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1825 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1827 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1828 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1829 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1830 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1831 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1832 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1833 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1834 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1835 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1836 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1837 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1838 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1839 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1840 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1841 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1842 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1843 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1844 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1845 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1846 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1847 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1848 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1849 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1850 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1851 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1852 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1853 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1854 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1855 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1856 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1857 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1858 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1859 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1860 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1861 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1862 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1863 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1864 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1865 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1866 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1867 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1868 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1869 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1870 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1871 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1872 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);
1873 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1874 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1875 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1876 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1877 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1879 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1881 return MEDCouplingUMesh::New();
1884 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1886 return MEDCouplingUMesh::New(meshName,meshDim);
1890 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1892 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1895 std::string __str__() const throw(INTERP_KERNEL::Exception)
1897 return self->simpleRepr();
1900 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1902 std::ostringstream oss;
1903 self->reprQuickOverview(oss);
1907 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1909 return self->cellIterator();
1912 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
1914 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
1918 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1920 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1921 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1922 PyObject *res=PyList_New(result.size());
1923 for(int i=0;iL!=result.end(); i++, iL++)
1924 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1928 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1932 std::vector<int> multiVal;
1933 std::pair<int, std::pair<int,int> > slic;
1934 MEDCoupling::DataArrayInt *daIntTyypp=0;
1935 int nbc=self->getNumberOfCells();
1936 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1943 std::ostringstream oss;
1944 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1945 throw INTERP_KERNEL::Exception(oss.str().c_str());
1949 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1956 int tmp=nbc+singleVal;
1957 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1962 std::ostringstream oss;
1963 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1964 throw INTERP_KERNEL::Exception(oss.str().c_str());
1970 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1976 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1977 daIntTyypp->checkAllocated();
1978 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1982 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1986 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1990 std::vector<int> multiVal;
1991 std::pair<int, std::pair<int,int> > slic;
1992 MEDCoupling::DataArrayInt *daIntTyypp=0;
1993 int nbc=self->getNumberOfCells();
1994 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2001 std::ostringstream oss;
2002 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2003 throw INTERP_KERNEL::Exception(oss.str().c_str());
2007 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2014 int tmp=nbc+singleVal;
2015 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2020 std::ostringstream oss;
2021 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2022 throw INTERP_KERNEL::Exception(oss.str().c_str());
2028 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2033 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2039 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2040 daIntTyypp->checkAllocated();
2041 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2045 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2049 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2051 int szArr,sw,iTypppArr;
2052 std::vector<int> stdvecTyyppArr;
2053 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2056 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2057 throw INTERP_KERNEL::Exception(oss.str().c_str());
2059 self->insertNextCell(type,size,tmp);
2062 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2064 int szArr,sw,iTypppArr;
2065 std::vector<int> stdvecTyyppArr;
2066 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2067 self->insertNextCell(type,szArr,tmp);
2070 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2072 DataArrayInt *ret=self->getNodalConnectivity();
2077 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2079 DataArrayInt *ret=self->getNodalConnectivityIndex();
2085 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2087 int szArr,sw,iTypppArr;
2088 std::vector<int> stdvecTyyppArr;
2089 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2090 int nbOfDepthPeelingPerformed=0;
2091 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2092 PyObject *res=PyTuple_New(2);
2093 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2094 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2098 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2100 DataArrayInt *v0=0,*v1=0;
2101 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2102 PyObject *res = PyList_New(2);
2103 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2104 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2108 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2112 DataArrayDoubleTuple *aa;
2113 std::vector<double> bb;
2115 int nbOfCompo=self->getSpaceDimension();
2116 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2119 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2120 PyObject *ret=PyTuple_New(2);
2121 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2122 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2126 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2128 DataArrayInt *ret1=0;
2129 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2130 PyObject *ret=PyTuple_New(2);
2131 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2132 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2136 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2139 DataArrayInt *ret1(0);
2140 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2141 PyObject *ret=PyTuple_New(3);
2142 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2143 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2144 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2148 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2150 std::vector<int> cells;
2151 self->checkButterflyCells(cells,eps);
2152 DataArrayInt *ret=DataArrayInt::New();
2153 ret->alloc((int)cells.size(),1);
2154 std::copy(cells.begin(),cells.end(),ret->getPointer());
2155 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2158 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2160 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2162 PyObject *ret = PyList_New(sz);
2163 for(int i=0;i<sz;i++)
2164 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2168 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2170 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2171 int sz=retCpp.size();
2172 PyObject *ret=PyList_New(sz);
2173 for(int i=0;i<sz;i++)
2174 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2178 static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2180 std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2181 int sz=retCpp.size();
2182 PyObject *ret=PyList_New(sz);
2183 for(int i=0;i<sz;i++)
2184 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2188 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2191 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2192 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2193 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2196 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2199 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2200 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2204 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2207 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2208 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2212 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2214 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2215 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2216 PyObject *ret=PyTuple_New(3);
2217 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2218 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2219 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2223 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2225 DataArrayInt *tmp0=0,*tmp1=0;
2226 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2227 PyObject *ret=PyTuple_New(2);
2228 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2229 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2233 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2237 std::vector<int> multiVal;
2238 std::pair<int, std::pair<int,int> > slic;
2239 MEDCoupling::DataArrayInt *daIntTyypp=0;
2240 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2244 return self->duplicateNodes(&singleVal,&singleVal+1);
2246 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2248 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2250 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2254 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2258 std::vector<int> multiVal;
2259 std::pair<int, std::pair<int,int> > slic;
2260 MEDCoupling::DataArrayInt *daIntTyypp=0;
2261 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2265 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2267 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2269 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2271 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2275 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2278 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2279 DataArrayInt *tmp0,*tmp1=0;
2280 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2281 PyObject *ret=PyTuple_New(2);
2282 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2283 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2287 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2289 DataArrayInt *ret0=0,*ret1=0;
2290 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2291 PyObject *ret=PyTuple_New(2);
2292 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2293 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2297 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2299 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2300 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2301 DataArrayInt *ret1=0,*ret2=0;
2302 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2303 PyObject *ret=PyTuple_New(3);
2304 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2305 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2306 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2310 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2312 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2313 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2314 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2315 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2318 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2321 std::vector<const MEDCouplingUMesh *> meshes;
2322 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2323 std::vector<DataArrayInt *> corr;
2324 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2326 PyObject *ret1=PyList_New(sz);
2327 for(int i=0;i<sz;i++)
2328 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2329 PyObject *ret=PyList_New(2);
2330 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2331 PyList_SetItem(ret,1,ret1);
2335 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2337 std::vector<MEDCouplingUMesh *> meshes;
2338 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2339 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2342 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2344 std::vector<MEDCouplingUMesh *> meshes;
2345 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2346 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2349 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2353 std::vector<int> multiVal;
2354 std::pair<int, std::pair<int,int> > slic;
2355 MEDCoupling::DataArrayInt *daIntTyypp=0;
2357 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2358 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2362 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2364 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2366 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2368 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2372 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2374 DataArrayInt *arrOut=0,*arrIndexOut=0;
2377 std::vector<int> multiVal;
2378 std::pair<int, std::pair<int,int> > slic;
2379 MEDCoupling::DataArrayInt *daIntTyypp=0;
2381 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2382 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2387 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2392 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2397 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2401 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2403 PyObject *ret=PyTuple_New(2);
2404 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2405 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2409 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2411 DataArrayInt *arrOut=0,*arrIndexOut=0;
2412 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2413 PyObject *ret=PyTuple_New(2);
2414 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2415 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2419 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2421 if(!PySlice_Check(slic))
2422 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2423 Py_ssize_t strt=2,stp=2,step=2;
2424 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2426 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2427 arrIndxIn->checkAllocated();
2428 if(arrIndxIn->getNumberOfComponents()!=1)
2429 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2430 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2431 DataArrayInt *arrOut=0,*arrIndexOut=0;
2432 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2433 PyObject *ret=PyTuple_New(2);
2434 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2435 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2439 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2440 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2441 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2443 DataArrayInt *arrOut=0,*arrIndexOut=0;
2446 std::vector<int> multiVal;
2447 std::pair<int, std::pair<int,int> > slic;
2448 MEDCoupling::DataArrayInt *daIntTyypp=0;
2450 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2451 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2456 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2461 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2466 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2470 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2472 PyObject *ret=PyTuple_New(2);
2473 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2474 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2478 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2479 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2483 std::vector<int> multiVal;
2484 std::pair<int, std::pair<int,int> > slic;
2485 MEDCoupling::DataArrayInt *daIntTyypp=0;
2487 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2488 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2493 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2498 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2503 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2507 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2511 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2515 DataArrayDoubleTuple *aa;
2516 std::vector<double> bb;
2518 int spaceDim=self->getSpaceDimension();
2519 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2520 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2522 std::vector<int> cells;
2523 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2524 DataArrayInt *ret=DataArrayInt::New();
2525 ret->alloc((int)cells.size(),1);
2526 std::copy(cells.begin(),cells.end(),ret->getPointer());
2527 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2530 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2534 DataArrayDoubleTuple *aa;
2535 std::vector<double> bb;
2537 int spaceDim=self->getSpaceDimension();
2538 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2539 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2540 self->orientCorrectly2DCells(v,polyOnly);
2543 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2545 std::vector<int> cells;
2546 self->arePolyhedronsNotCorrectlyOriented(cells);
2547 DataArrayInt *ret=DataArrayInt::New();
2548 ret->alloc((int)cells.size(),1);
2549 std::copy(cells.begin(),cells.end(),ret->getPointer());
2550 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2553 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2557 self->getFastAveragePlaneOfThis(vec,pos);
2559 std::copy(vec,vec+3,vals);
2560 std::copy(pos,pos+3,vals+3);
2561 return convertDblArrToPyListOfTuple(vals,3,2);
2564 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2566 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2567 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2568 return MEDCouplingUMesh::MergeUMeshes(tmp);
2571 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2574 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2575 PyObject *ret=PyTuple_New(2);
2576 PyObject *ret0Py=ret0?Py_True:Py_False;
2578 PyTuple_SetItem(ret,0,ret0Py);
2579 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2583 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2586 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2587 PyObject *ret=PyTuple_New(2);
2588 PyObject *ret0Py=ret0?Py_True:Py_False;
2590 PyTuple_SetItem(ret,0,ret0Py);
2591 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2595 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2597 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2598 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2599 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2600 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2601 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2602 PyObject *ret=PyTuple_New(5);
2603 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2604 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2605 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2606 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2607 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2611 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2613 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2614 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2615 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2616 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2617 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2618 PyObject *ret=PyTuple_New(5);
2619 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2620 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2621 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2622 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2623 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2627 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2629 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2630 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2631 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2632 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2633 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2634 PyObject *ret=PyTuple_New(5);
2635 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2636 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2637 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2638 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2639 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2643 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2645 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2646 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2647 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2648 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2649 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2650 PyObject *ret=PyTuple_New(5);
2651 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2652 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2653 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2654 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2655 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2659 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2661 DataArrayInt *neighbors=0,*neighborsIdx=0;
2662 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2663 PyObject *ret=PyTuple_New(2);
2664 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2665 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2669 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2671 DataArrayInt *neighbors=0,*neighborsIdx=0;
2672 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2673 PyObject *ret=PyTuple_New(2);
2674 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2675 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2679 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const throw(INTERP_KERNEL::Exception)
2681 MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
2682 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2683 PyObject *ret=PyTuple_New(2);
2684 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2685 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2689 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2691 DataArrayInt *neighbors=0,*neighborsIdx=0;
2692 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2693 PyObject *ret=PyTuple_New(2);
2694 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2695 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2699 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2701 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2702 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2703 DataArrayInt *d2,*d3,*d4,*dd5;
2704 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2705 PyObject *ret=PyTuple_New(7);
2706 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2707 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2708 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2709 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2710 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2711 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2712 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2716 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2719 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2720 da->checkAllocated();
2721 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2724 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2727 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2728 da->checkAllocated();
2729 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2732 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2735 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2736 da->checkAllocated();
2737 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2740 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2743 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2744 da->checkAllocated();
2745 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2746 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2747 PyObject *res = PyList_New(result.size());
2748 for (int i=0;iL!=result.end(); i++, iL++)
2749 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2753 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2756 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2757 da->checkAllocated();
2758 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2759 ret->setName(da->getName().c_str());
2763 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2765 DataArrayInt *cellNb1=0,*cellNb2=0;
2766 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2767 PyObject *ret=PyTuple_New(3);
2768 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2769 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2770 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2774 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2776 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2777 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2778 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2779 PyObject *ret(PyTuple_New(4));
2780 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2781 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2782 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2783 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2787 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2789 int spaceDim=self->getSpaceDimension();
2791 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2793 DataArrayDouble *a,*a2;
2794 DataArrayDoubleTuple *aa,*aa2;
2795 std::vector<double> bb,bb2;
2797 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2798 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2799 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2800 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2802 DataArrayInt *cellIds=0;
2803 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2804 PyObject *ret=PyTuple_New(2);
2805 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2806 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2810 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2812 int spaceDim=self->getSpaceDimension();
2814 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2816 DataArrayDouble *a,*a2;
2817 DataArrayDoubleTuple *aa,*aa2;
2818 std::vector<double> bb,bb2;
2820 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2821 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2822 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2823 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2825 DataArrayInt *cellIds=0;
2826 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2827 PyObject *ret=PyTuple_New(2);
2828 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2829 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2833 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2836 DataArrayDouble *a,*a2;
2837 DataArrayDoubleTuple *aa,*aa2;
2838 std::vector<double> bb,bb2;
2840 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st paramater for origin.";
2841 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd paramater for vector.";
2842 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2843 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2844 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2848 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2850 int spaceDim=self->getSpaceDimension();
2852 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2854 DataArrayDouble *a,*a2;
2855 DataArrayDoubleTuple *aa,*aa2;
2856 std::vector<double> bb,bb2;
2858 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2859 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2860 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2861 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2862 return self->getCellIdsCrossingPlane(orig,vect,eps);
2865 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2869 std::vector<int> pos2;
2870 DataArrayInt *pos3=0;
2871 DataArrayIntTuple *pos4=0;
2872 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2877 self->convertToPolyTypes(&pos1,&pos1+1);
2884 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2889 self->convertToPolyTypes(pos3->begin(),pos3->end());
2893 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2897 void convertAllToPoly();
2898 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2899 bool unPolyze() throw(INTERP_KERNEL::Exception);
2900 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2901 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2902 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2905 //== MEDCouplingUMesh End
2907 //== MEDCouplingMappedExtrudedMesh
2909 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
2912 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2913 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
2914 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2915 int get2DCellIdForExtrusion() const;
2917 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2919 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2922 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
2924 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
2927 MEDCouplingMappedExtrudedMesh()
2929 return MEDCouplingMappedExtrudedMesh::New();
2932 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2934 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
2937 std::string __str__() const throw(INTERP_KERNEL::Exception)
2939 return self->simpleRepr();
2942 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2944 std::ostringstream oss;
2945 self->reprQuickOverview(oss);
2949 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2951 MEDCouplingUMesh *ret=self->getMesh2D();
2954 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2956 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2958 MEDCouplingUMesh *ret=self->getMesh1D();
2961 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2963 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2965 DataArrayInt *ret=self->getMesh3DIds();
2968 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2973 //== MEDCouplingMappedExtrudedMesh End
2975 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
2978 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2979 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2980 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2981 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2982 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2983 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2986 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2988 int szArr,sw,iTypppArr;
2989 std::vector<int> stdvecTyyppArr;
2990 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2991 self->insertNextCell(tmp,tmp+szArr);
2994 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2996 DataArrayInt *ret=self->getNodalConnectivity();
2997 if(ret) ret->incrRef();
3001 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3003 std::vector< const MEDCoupling1GTUMesh *> parts;
3004 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3005 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3010 //== MEDCoupling1SGTUMesh
3012 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3015 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3016 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3017 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
3018 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
3019 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
3020 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3021 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
3022 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
3023 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
3026 MEDCoupling1SGTUMesh()
3028 return MEDCoupling1SGTUMesh::New();
3031 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3033 return MEDCoupling1SGTUMesh::New(name,type);
3036 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3038 return MEDCoupling1SGTUMesh::New(m);
3041 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3043 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
3046 std::string __str__() const throw(INTERP_KERNEL::Exception)
3048 return self->simpleRepr();
3051 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3053 std::ostringstream oss;
3054 self->reprQuickOverview(oss);
3058 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3060 DataArrayInt *cellPerm(0),*nodePerm(0);
3061 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3062 PyObject *ret(PyTuple_New(3));
3063 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3064 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3065 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3069 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3071 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3072 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3073 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3076 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3078 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3079 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3080 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3085 //== MEDCoupling1SGTUMesh End
3087 //== MEDCoupling1DGTUMesh
3089 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3092 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3093 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3094 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3095 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3096 bool isPacked() const throw(INTERP_KERNEL::Exception);
3099 MEDCoupling1DGTUMesh()
3101 return MEDCoupling1DGTUMesh::New();
3103 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3105 return MEDCoupling1DGTUMesh::New(name,type);
3108 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3110 return MEDCoupling1DGTUMesh::New(m);
3113 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3115 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3118 std::string __str__() const throw(INTERP_KERNEL::Exception)
3120 return self->simpleRepr();
3123 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3125 std::ostringstream oss;
3126 self->reprQuickOverview(oss);
3130 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3132 DataArrayInt *ret=self->getNodalConnectivityIndex();
3133 if(ret) ret->incrRef();
3137 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3139 DataArrayInt *ret1=0,*ret2=0;
3140 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3141 PyObject *ret0Py=ret0?Py_True:Py_False;
3143 PyObject *ret=PyTuple_New(3);
3144 PyTuple_SetItem(ret,0,ret0Py);
3145 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3146 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3150 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3153 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3154 PyObject *ret=PyTuple_New(2);
3155 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3156 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3157 PyTuple_SetItem(ret,1,ret1Py);
3161 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3163 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3164 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3165 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3168 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3170 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3171 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3172 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3175 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3177 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3178 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3179 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3184 //== MEDCoupling1DGTUMeshEnd
3186 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3189 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3190 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3191 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3192 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3193 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3194 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3195 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3196 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3197 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3198 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3199 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3200 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3201 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3202 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3203 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3206 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3208 int tmpp1=-1,tmpp2=-1;
3209 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3210 std::vector< std::pair<int,int> > inp;
3214 for(int i=0;i<tmpp1;i++)
3215 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3220 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3221 inp.resize(tmpp1/2);
3222 for(int i=0;i<tmpp1/2;i++)
3223 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3226 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3227 return self->buildStructuredSubPart(inp);
3230 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3232 std::vector< std::pair<int,int> > inp;
3233 convertPyToVectorPairInt(part,inp);
3235 int szArr,sw,iTypppArr;
3236 std::vector<int> stdvecTyyppArr;
3237 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3238 std::vector<int> tmp5(tmp4,tmp4+szArr);
3240 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3243 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3245 std::vector< std::pair<int,int> > inp;
3246 convertPyToVectorPairInt(part,inp);
3247 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3250 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3252 std::vector< std::pair<int,int> > inp;
3253 convertPyToVectorPairInt(part,inp);
3254 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3257 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3259 std::vector< std::pair<int,int> > inp;
3260 convertPyToVectorPairInt(part,inp);
3261 std::vector<int> stWithGhost;
3262 std::vector< std::pair<int,int> > partWithGhost;
3263 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3264 PyObject *ret(PyTuple_New(2));
3265 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3266 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3270 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3272 std::vector< std::pair<int,int> > inp;
3273 convertPyToVectorPairInt(partCompactFormat,inp);
3274 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3277 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3279 std::vector< std::pair<int,int> > inp;
3280 convertPyToVectorPairInt(partCompactFormat,inp);
3281 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3284 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3286 std::vector< std::pair<int,int> > inp;
3287 convertPyToVectorPairInt(part,inp);
3288 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3291 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3293 int szArr,sw,iTypppArr;
3294 std::vector<int> stdvecTyyppArr;
3295 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3296 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3299 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3301 int szArr,sw,iTypppArr;
3302 std::vector<int> stdvecTyyppArr;
3303 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3304 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3307 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3309 std::vector< std::pair<int,int> > inp;
3310 convertPyToVectorPairInt(partCompactFormat,inp);
3311 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3314 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3316 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3317 PyObject *retPy=PyList_New(ret.size());
3318 for(std::size_t i=0;i<ret.size();i++)
3320 PyObject *tmp=PyTuple_New(2);
3321 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3322 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3323 PyList_SetItem(retPy,i,tmp);
3328 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3330 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3331 convertPyToVectorPairInt(r1,r1Cpp);
3332 convertPyToVectorPairInt(r2,r2Cpp);
3333 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3334 PyObject *retPy=PyList_New(ret.size());
3335 for(std::size_t i=0;i<ret.size();i++)
3337 PyObject *tmp=PyTuple_New(2);
3338 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3339 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3340 PyList_SetItem(retPy,i,tmp);
3345 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3347 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3348 convertPyToVectorPairInt(r1,r1Cpp);
3349 convertPyToVectorPairInt(r2,r2Cpp);
3350 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3353 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3355 int szArr,sw,iTypppArr;
3356 std::vector<int> stdvecTyyppArr;
3357 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3358 int szArr2,sw2,iTypppArr2;
3359 std::vector<int> stdvecTyyppArr2;
3360 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3361 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3362 std::vector< std::pair<int,int> > partCompactFormat;
3363 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3364 PyObject *ret=PyTuple_New(2);
3365 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3366 PyTuple_SetItem(ret,0,ret0Py);
3367 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3368 for(std::size_t i=0;i<partCompactFormat.size();i++)
3370 PyObject *tmp4=PyTuple_New(2);
3371 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3372 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3373 PyList_SetItem(ret1Py,i,tmp4);
3375 PyTuple_SetItem(ret,1,ret1Py);
3379 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3381 std::vector< std::pair<int,int> > param0,param1,ret;
3382 convertPyToVectorPairInt(bigInAbs,param0);
3383 convertPyToVectorPairInt(partOfBigInAbs,param1);
3384 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3385 PyObject *retPy(PyList_New(ret.size()));
3386 for(std::size_t i=0;i<ret.size();i++)
3388 PyObject *tmp(PyTuple_New(2));
3389 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3390 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3391 PyList_SetItem(retPy,i,tmp);
3396 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3398 std::vector< std::pair<int,int> > param0;
3399 convertPyToVectorPairInt(part,param0);
3400 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3401 PyObject *retPy(PyList_New(ret.size()));
3402 for(std::size_t i=0;i<ret.size();i++)
3404 PyObject *tmp(PyTuple_New(2));
3405 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3406 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3407 PyList_SetItem(retPy,i,tmp);
3412 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3414 std::vector< std::pair<int,int> > param0,param1;
3415 convertPyToVectorPairInt(startingFrom,param0);
3416 convertPyToVectorPairInt(goingTo,param1);
3417 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3420 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3422 std::vector< std::pair<int,int> > param0,param1,ret;
3423 convertPyToVectorPairInt(bigInAbs,param0);
3424 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3425 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3426 PyObject *retPy(PyList_New(ret.size()));
3427 for(std::size_t i=0;i<ret.size();i++)
3429 PyObject *tmp(PyTuple_New(2));
3430 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3431 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3432 PyList_SetItem(retPy,i,tmp);
3439 class MEDCouplingCurveLinearMesh;
3441 //== MEDCouplingCMesh
3443 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3446 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3447 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3448 void setCoords(const DataArrayDouble *coordsX,
3449 const DataArrayDouble *coordsY=0,
3450 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3451 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3452 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3454 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3456 return MEDCouplingCMesh::New();
3458 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3460 return MEDCouplingCMesh::New(meshName);
3463 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3465 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3467 std::string __str__() const throw(INTERP_KERNEL::Exception)
3469 return self->simpleRepr();
3471 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3473 std::ostringstream oss;
3474 self->reprQuickOverview(oss);
3477 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3479 DataArrayDouble *ret=self->getCoordsAt(i);
3487 //== MEDCouplingCMesh End
3489 //== MEDCouplingCurveLinearMesh
3491 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3494 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3495 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3496 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3498 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3500 return MEDCouplingCurveLinearMesh::New();
3502 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3504 return MEDCouplingCurveLinearMesh::New(meshName);
3506 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3508 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3510 std::string __str__() const throw(INTERP_KERNEL::Exception)
3512 return self->simpleRepr();
3514 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3516 std::ostringstream oss;
3517 self->reprQuickOverview(oss);
3520 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3522 DataArrayDouble *ret=self->getCoords();
3527 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3529 int szArr,sw,iTypppArr;
3530 std::vector<int> stdvecTyyppArr;
3531 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3532 self->setNodeGridStructure(tmp,tmp+szArr);
3537 //== MEDCouplingCurveLinearMesh End
3539 //== MEDCouplingIMesh
3541 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3544 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3546 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3547 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3548 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3549 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3550 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3551 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3552 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3553 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3554 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3555 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3556 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3561 return MEDCouplingIMesh::New();
3563 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3565 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3566 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3567 const int *nodeStrctPtr(0);
3568 const double *originPtr(0),*dxyzPtr(0);
3570 std::vector<int> bb0;
3571 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3574 std::vector<double> bb,bb2;
3576 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3577 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3579 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3582 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3584 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3587 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3589 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3592 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3595 std::vector<int> bb0;
3596 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3597 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3600 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3602 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3605 DataArrayDoubleTuple *aa;
3606 std::vector<double> bb;
3608 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3609 self->setOrigin(originPtr,originPtr+nbTuples);
3612 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3614 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3617 DataArrayDoubleTuple *aa;
3618 std::vector<double> bb;
3620 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3621 self->setDXYZ(originPtr,originPtr+nbTuples);
3624 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3626 std::vector< std::pair<int,int> > inp;
3627 convertPyToVectorPairInt(fineLocInCoarse,inp);
3628 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3631 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)
3633 std::vector< std::pair<int,int> > inp;
3634 convertPyToVectorPairInt(fineLocInCoarse,inp);
3635 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3638 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3640 std::vector< std::pair<int,int> > inp;
3641 convertPyToVectorPairInt(fineLocInCoarse,inp);
3642 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3645 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)
3647 std::vector< std::pair<int,int> > inp;
3648 convertPyToVectorPairInt(fineLocInCoarse,inp);
3649 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3652 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)
3654 std::vector< std::pair<int,int> > inp;
3655 convertPyToVectorPairInt(fineLocInCoarse,inp);
3656 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3659 std::string __str__() const throw(INTERP_KERNEL::Exception)
3661 return self->simpleRepr();
3663 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3665 std::ostringstream oss;
3666 self->reprQuickOverview(oss);
3672 //== MEDCouplingIMesh End
3676 namespace MEDCoupling
3678 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3681 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3682 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3683 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3684 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3685 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3686 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3687 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3688 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3689 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3690 std::string getName() const throw(INTERP_KERNEL::Exception);
3691 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3692 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3693 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3694 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3695 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3696 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3697 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3698 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3699 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3700 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3701 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3702 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3703 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3704 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3705 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3706 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3708 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3710 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3713 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3716 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3718 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3721 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3724 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3726 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3727 return convertIntArrToPyList3(ret);
3730 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3733 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3734 PyObject *ret=PyTuple_New(2);
3735 PyObject *ret0Py=ret0?Py_True:Py_False;
3737 PyTuple_SetItem(ret,0,ret0Py);
3738 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3742 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3744 DataArrayInt *ret1=0;
3745 MEDCouplingMesh *ret0=0;
3747 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3748 if (!SWIG_IsOK(res1))
3751 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3752 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3756 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3758 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3759 da2->checkAllocated();
3760 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3762 PyObject *res = PyList_New(2);
3763 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3764 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3768 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3770 DataArrayInt *ret1=0;
3772 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3773 PyObject *res=PyTuple_New(2);
3774 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3776 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3779 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3780 PyTuple_SetItem(res,1,res1);
3785 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3788 int v0; std::vector<int> v1;
3789 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3790 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3793 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3794 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3797 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3798 if (!SWIG_IsOK(res1))
3801 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3802 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3806 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3808 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3809 da2->checkAllocated();
3810 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3814 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3816 std::vector<int> tmp;
3817 self->getCellIdsHavingGaussLocalization(locId,tmp);
3818 DataArrayInt *ret=DataArrayInt::New();
3819 ret->alloc((int)tmp.size(),1);
3820 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3821 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3824 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3826 std::vector<int> inp0;
3827 convertPyToNewIntArr4(code,1,3,inp0);
3828 std::vector<const DataArrayInt *> inp1;
3829 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3830 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3835 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3838 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3839 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3840 static MEDCouplingFieldTemplate *New(TypeOfField type);
3841 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3842 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3845 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3847 return MEDCouplingFieldTemplate::New(f);
3850 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3852 return MEDCouplingFieldTemplate::New(f);
3855 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3857 return MEDCouplingFieldTemplate::New(type);
3860 std::string __str__() const throw(INTERP_KERNEL::Exception)
3862 return self->simpleRepr();
3865 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3867 std::ostringstream oss;
3868 self->reprQuickOverview(oss);
3874 class MEDCouplingFieldInt;
3876 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3879 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3880 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3881 void setTimeUnit(const std::string& unit);
3882 std::string getTimeUnit() const;
3883 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3884 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3885 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3886 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3887 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3888 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3889 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
3890 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3891 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3892 MEDCouplingFieldDouble *deepCopy() const;
3893 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
3894 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3895 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3896 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3897 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3898 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3899 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3900 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3901 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3902 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3903 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3904 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3905 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3906 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3907 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3908 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3909 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3910 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3911 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3912 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3913 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3914 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3915 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3916 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3917 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3918 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3919 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3920 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3921 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3922 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3923 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3924 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3925 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3926 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3927 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3928 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3929 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3930 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3931 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3932 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3933 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3934 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3935 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3936 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3937 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3938 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3939 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3940 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3941 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3942 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3943 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3944 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3945 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3946 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3947 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3948 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3949 double getMinValue() const throw(INTERP_KERNEL::Exception);
3950 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3951 double norm2() const throw(INTERP_KERNEL::Exception);
3952 double normMax() const throw(INTERP_KERNEL::Exception);
3953 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3954 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3955 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3956 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3957 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3958 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3959 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3960 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3961 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3962 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3963 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3964 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3965 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3966 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3967 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3968 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3969 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3970 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3971 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3972 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3973 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3974 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3976 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3978 return MEDCouplingFieldDouble::New(type,td);
3981 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3983 return MEDCouplingFieldDouble::New(ft,td);
3986 std::string __str__() const throw(INTERP_KERNEL::Exception)
3988 return self->simpleRepr();
3991 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3993 std::ostringstream oss;
3994 self->reprQuickOverview(oss);
3998 MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
4000 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4004 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
4006 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4010 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4012 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4014 DataArrayDouble *a,*a2;
4015 DataArrayDoubleTuple *aa,*aa2;
4016 std::vector<double> bb,bb2;
4018 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4019 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4020 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4023 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
4025 DataArrayDouble *ret=self->getArray();
4031 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4033 std::vector<DataArrayDouble *> arrs=self->getArrays();
4034 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4038 PyObject *ret=PyTuple_New(sz);
4039 for(int i=0;i<sz;i++)
4042 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4044 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4049 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4051 std::vector<const DataArrayDouble *> tmp;
4052 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4054 std::vector<DataArrayDouble *> arrs(sz);
4055 for(int i=0;i<sz;i++)
4056 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4057 self->setArrays(arrs);
4060 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4062 DataArrayDouble *ret=self->getEndArray();
4068 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4072 DataArrayDoubleTuple *aa;
4073 std::vector<double> bb;
4075 const MEDCouplingMesh *mesh=self->getMesh();
4077 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4078 int spaceDim=mesh->getSpaceDimension();
4079 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4080 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4082 int sz=self->getNumberOfComponents();
4083 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4084 self->getValueOn(spaceLoc,res);
4085 return convertDblArrToPyList(res,sz);
4088 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4090 int sz=self->getNumberOfComponents();
4091 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4092 self->getValueOnPos(i,j,k,res);
4093 return convertDblArrToPyList(res,sz);
4096 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4098 const MEDCouplingMesh *mesh(self->getMesh());
4100 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4103 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4104 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4105 mesh->getSpaceDimension(),true,nbPts);
4106 return self->getValueOnMulti(inp,nbPts);
4109 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4113 DataArrayDoubleTuple *aa;
4114 std::vector<double> bb;
4116 const MEDCouplingMesh *mesh=self->getMesh();
4118 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4119 int spaceDim=mesh->getSpaceDimension();
4120 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4121 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4124 int sz=self->getNumberOfComponents();
4125 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4126 self->getValueOn(spaceLoc,time,res);
4127 return convertDblArrToPyList(res,sz);
4130 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4132 if(self->getArray()!=0)
4133 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4136 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4137 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4138 self->setArray(arr);
4142 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4145 double tmp0=self->getTime(tmp1,tmp2);
4146 PyObject *res = PyList_New(3);
4147 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4148 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4149 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4153 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4156 double tmp0=self->getStartTime(tmp1,tmp2);
4157 PyObject *res = PyList_New(3);
4158 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4159 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4160 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4164 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4167 double tmp0=self->getEndTime(tmp1,tmp2);
4168 PyObject *res = PyList_New(3);
4169 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4170 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4171 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4174 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4176 int sz=self->getNumberOfComponents();
4177 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4178 self->accumulate(tmp);
4179 return convertDblArrToPyList(tmp,sz);
4181 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4183 int sz=self->getNumberOfComponents();
4184 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4185 self->integral(isWAbs,tmp);
4186 return convertDblArrToPyList(tmp,sz);
4188 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4190 int sz=self->getNumberOfComponents();
4191 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4192 self->getWeightedAverageValue(tmp,isWAbs);
4193 return convertDblArrToPyList(tmp,sz);
4195 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4197 int sz=self->getNumberOfComponents();
4198 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4200 return convertDblArrToPyList(tmp,sz);
4202 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4204 int sz=self->getNumberOfComponents();
4205 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4207 return convertDblArrToPyList(tmp,sz);
4209 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4211 int szArr,sw,iTypppArr;
4212 std::vector<int> stdvecTyyppArr;
4213 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4214 self->renumberCells(tmp,check);
4217 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4219 int szArr,sw,iTypppArr;
4220 std::vector<int> stdvecTyyppArr;
4221 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4222 self->renumberCellsWithoutMesh(tmp,check);
4225 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4227 int szArr,sw,iTypppArr;
4228 std::vector<int> stdvecTyyppArr;
4229 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4230 self->renumberNodes(tmp,eps);
4233 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4235 int szArr,sw,iTypppArr;
4236 std::vector<int> stdvecTyyppArr;
4237 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4238 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4241 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4245 std::vector<int> multiVal;
4246 std::pair<int, std::pair<int,int> > slic;
4247 MEDCoupling::DataArrayInt *daIntTyypp=0;
4248 const MEDCouplingMesh *mesh=self->getMesh();
4250 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4251 int nbc=mesh->getNumberOfCells();
4252 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4259 std::ostringstream oss;
4260 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4261 throw INTERP_KERNEL::Exception(oss.str().c_str());
4264 return self->buildSubPart(&singleVal,&singleVal+1);
4269 int tmp=nbc+singleVal;
4270 return self->buildSubPart(&tmp,&tmp+1);
4274 std::ostringstream oss;
4275 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4276 throw INTERP_KERNEL::Exception(oss.str().c_str());
4282 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4286 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4291 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4292 daIntTyypp->checkAllocated();
4293 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4296 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4300 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4302 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";
4303 if(PyTuple_Check(li))
4305 Py_ssize_t sz=PyTuple_Size(li);
4307 throw INTERP_KERNEL::Exception(msg);
4308 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4311 std::vector<int> multiVal;
4312 std::pair<int, std::pair<int,int> > slic;
4313 MEDCoupling::DataArrayInt *daIntTyypp=0;
4314 if(!self->getArray())
4315 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4317 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4318 catch(INTERP_KERNEL::Exception& e)
4319 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4320 MCAuto<MEDCouplingFieldDouble> ret0=MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4321 DataArrayDouble *ret0Arr=ret0->getArray();
4323 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4328 std::vector<int> v2(1,singleVal);
4329 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4330 ret0->setArray(aarr);
4335 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4336 ret0->setArray(aarr);
4341 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4342 std::vector<int> v2(nbOfComp);
4343 for(int i=0;i<nbOfComp;i++)
4344 v2[i]=slic.first+i*slic.second.second;
4345 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4346 ret0->setArray(aarr);
4350 throw INTERP_KERNEL::Exception(msg);
4355 return MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,li);
4358 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4361 double r1=self->getMaxValue2(tmp);
4362 PyObject *ret=PyTuple_New(2);
4363 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4364 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4368 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4371 double r1=self->getMinValue2(tmp);
4372 PyObject *ret=PyTuple_New(2);
4373 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4374 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4378 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4380 std::vector<int> tmp;
4381 convertPyToNewIntArr3(li,tmp);
4382 return self->keepSelectedComponents(tmp);
4385 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4387 std::vector<int> tmp;
4388 convertPyToNewIntArr3(li,tmp);
4389 self->setSelectedComponents(f,tmp);
4392 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4395 DataArrayDouble *a,*a2;
4396 DataArrayDoubleTuple *aa,*aa2;
4397 std::vector<double> bb,bb2;
4400 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4401 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4402 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4403 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4405 return self->extractSlice3D(orig,vect,eps);
4408 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4410 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4413 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4415 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4418 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4420 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.";
4421 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4424 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4426 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4428 return (*self)-(*other);
4430 throw INTERP_KERNEL::Exception(msg);
4435 DataArrayDoubleTuple *aa;
4436 std::vector<double> bb;
4438 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4443 if(!self->getArray())
4444 throw INTERP_KERNEL::Exception(msg2);
4445 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4446 ret->applyLin(1.,-val);
4447 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4448 ret2->setArray(ret);
4453 if(!self->getArray())
4454 throw INTERP_KERNEL::Exception(msg2);
4455 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4456 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4457 ret2->setArray(ret);
4462 if(!self->getArray())
4463 throw INTERP_KERNEL::Exception(msg2);
4464 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4465 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4466 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4467 ret2->setArray(ret);
4472 if(!self->getArray())
4473 throw INTERP_KERNEL::Exception(msg2);
4474 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4475 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4476 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4477 ret2->setArray(ret);
4481 { throw INTERP_KERNEL::Exception(msg); }
4485 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4487 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4490 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4492 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4495 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4497 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4500 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4502 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.";
4503 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4506 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4508 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4510 return (*self)/(*other);
4512 throw INTERP_KERNEL::Exception(msg);
4517 DataArrayDoubleTuple *aa;
4518 std::vector<double> bb;
4520 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4526 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4527 if(!self->getArray())
4528 throw INTERP_KERNEL::Exception(msg2);
4529 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4530 ret->applyLin(1./val,0);
4531 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4532 ret2->setArray(ret);
4537 if(!self->getArray())
4538 throw INTERP_KERNEL::Exception(msg2);
4539 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4540 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4541 ret2->setArray(ret);
4546 if(!self->getArray())
4547 throw INTERP_KERNEL::Exception(msg2);
4548 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4549 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4550 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4551 ret2->setArray(ret);
4556 if(!self->getArray())
4557 throw INTERP_KERNEL::Exception(msg2);
4558 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4559 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4560 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4561 ret2->setArray(ret);
4565 { throw INTERP_KERNEL::Exception(msg); }
4569 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4571 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4574 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4576 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.";
4577 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4580 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4582 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4584 return (*self)^(*other);
4586 throw INTERP_KERNEL::Exception(msg);
4591 DataArrayDoubleTuple *aa;
4592 std::vector<double> bb;
4594 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4599 if(!self->getArray())
4600 throw INTERP_KERNEL::Exception(msg2);
4601 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4603 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4604 ret2->setArray(ret);
4609 if(!self->getArray())
4610 throw INTERP_KERNEL::Exception(msg2);
4611 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4612 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4613 ret2->setArray(ret);
4618 if(!self->getArray())
4619 throw INTERP_KERNEL::Exception(msg2);
4620 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4621 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4622 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4623 ret2->setArray(ret);
4628 if(!self->getArray())
4629 throw INTERP_KERNEL::Exception(msg2);
4630 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4631 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4632 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4633 ret2->setArray(ret);
4637 { throw INTERP_KERNEL::Exception(msg); }
4641 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4643 return self->negate();
4646 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4648 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.";
4649 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4652 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4654 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4658 Py_XINCREF(trueSelf);
4662 throw INTERP_KERNEL::Exception(msg);
4667 DataArrayDoubleTuple *aa;
4668 std::vector<double> bb;
4670 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4675 if(!self->getArray())
4676 throw INTERP_KERNEL::Exception(msg2);
4677 self->getArray()->applyLin(1.,val);
4678 Py_XINCREF(trueSelf);
4683 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4686 Py_XINCREF(trueSelf);
4691 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4692 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4693 ret2->setArray(aaa);
4695 Py_XINCREF(trueSelf);
4700 if(!self->getArray())
4701 throw INTERP_KERNEL::Exception(msg2);
4702 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4703 self->getArray()->addEqual(aaa);
4704 Py_XINCREF(trueSelf);
4708 { throw INTERP_KERNEL::Exception(msg); }
4712 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4714 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.";
4715 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4718 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4720 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4724 Py_XINCREF(trueSelf);
4728 throw INTERP_KERNEL::Exception(msg);
4733 DataArrayDoubleTuple *aa;
4734 std::vector<double> bb;
4736 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4741 if(!self->getArray())
4742 throw INTERP_KERNEL::Exception(msg2);
4743 self->getArray()->applyLin(1.,-val);
4744 Py_XINCREF(trueSelf);
4749 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4752 Py_XINCREF(trueSelf);
4757 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4758 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4759 ret2->setArray(aaa);
4761 Py_XINCREF(trueSelf);
4766 if(!self->getArray())
4767 throw INTERP_KERNEL::Exception(msg2);
4768 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4769 self->getArray()->substractEqual(aaa);
4770 Py_XINCREF(trueSelf);
4774 { throw INTERP_KERNEL::Exception(msg); }
4778 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4780 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.";
4781 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4784 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4786 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4790 Py_XINCREF(trueSelf);
4794 throw INTERP_KERNEL::Exception(msg);
4799 DataArrayDoubleTuple *aa;
4800 std::vector<double> bb;
4802 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4807 if(!self->getArray())
4808 throw INTERP_KERNEL::Exception(msg2);
4809 self->getArray()->applyLin(val,0);
4810 Py_XINCREF(trueSelf);
4815 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4818 Py_XINCREF(trueSelf);
4823 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4824 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4825 ret2->setArray(aaa);
4827 Py_XINCREF(trueSelf);
4832 if(!self->getArray())
4833 throw INTERP_KERNEL::Exception(msg2);
4834 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4835 self->getArray()->multiplyEqual(aaa);
4836 Py_XINCREF(trueSelf);
4840 { throw INTERP_KERNEL::Exception(msg); }
4844 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4846 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.";
4847 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4850 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4852 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4856 Py_XINCREF(trueSelf);
4860 throw INTERP_KERNEL::Exception(msg);
4865 DataArrayDoubleTuple *aa;
4866 std::vector<double> bb;
4868 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4874 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4875 if(!self->getArray())
4876 throw INTERP_KERNEL::Exception(msg2);
4877 self->getArray()->applyLin(1./val,0);
4878 Py_XINCREF(trueSelf);
4883 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4886 Py_XINCREF(trueSelf);
4891 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4892 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4893 ret2->setArray(aaa);
4895 Py_XINCREF(trueSelf);
4900 if(!self->getArray())
4901 throw INTERP_KERNEL::Exception(msg2);
4902 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4903 self->getArray()->divideEqual(aaa);
4904 Py_XINCREF(trueSelf);
4908 { throw INTERP_KERNEL::Exception(msg); }
4912 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4914 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.";
4915 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4918 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4920 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4924 Py_XINCREF(trueSelf);
4928 throw INTERP_KERNEL::Exception(msg);
4933 DataArrayDoubleTuple *aa;
4934 std::vector<double> bb;
4936 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4941 if(!self->getArray())
4942 throw INTERP_KERNEL::Exception(msg2);
4943 self->getArray()->applyPow(val);
4944 Py_XINCREF(trueSelf);
4949 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4952 Py_XINCREF(trueSelf);
4957 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4958 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4959 ret2->setArray(aaa);
4961 Py_XINCREF(trueSelf);
4966 if(!self->getArray())
4967 throw INTERP_KERNEL::Exception(msg2);
4968 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4969 self->getArray()->powEqual(aaa);
4970 Py_XINCREF(trueSelf);
4974 { throw INTERP_KERNEL::Exception(msg); }
4978 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4980 std::vector<const MEDCouplingFieldDouble *> tmp;
4981 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4982 return MEDCouplingFieldDouble::MergeFields(tmp);
4985 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4987 std::vector<const MEDCouplingFieldDouble *> tmp;
4988 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4989 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4992 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4994 std::vector<double> a0;
4995 std::vector<int> a1;
4996 std::vector<std::string> a2;
4997 self->getTinySerializationDbleInformation(a0);
4998 self->getTinySerializationIntInformation(a1);
4999 self->getTinySerializationStrInformation(a2);
5001 PyObject *ret(PyTuple_New(3));
5002 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
5003 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
5005 PyObject *ret2(PyList_New(sz));
5007 for(int i=0;i<sz;i++)
5008 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
5010 PyTuple_SetItem(ret,2,ret2);
5014 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5016 DataArrayInt *ret0(0);
5017 std::vector<DataArrayDouble *> ret1;
5018 self->serialize(ret0,ret1);
5021 std::size_t sz(ret1.size());
5022 PyObject *ret(PyTuple_New(2));
5023 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
5024 PyObject *ret1Py(PyList_New(sz));
5025 for(std::size_t i=0;i<sz;i++)
5029 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5031 PyTuple_SetItem(ret,1,ret1Py);
5035 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
5037 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
5038 if(!PyTuple_Check(args))
5039 throw INTERP_KERNEL::Exception(MSG);
5040 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
5041 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
5042 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
5044 PyObject *tmp0(PyTuple_New(1));
5045 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
5046 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
5048 Py_DECREF(selfMeth);
5049 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
5050 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
5051 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
5053 PyObject *a(PyInt_FromLong(0));
5054 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
5057 throw INTERP_KERNEL::Exception(MSG);
5058 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
5059 throw INTERP_KERNEL::Exception(MSG);
5060 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
5063 Py_DECREF(initMeth);
5068 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
5069 {// put an empty dict in input to say to __new__ to call __init__...
5070 self->checkConsistencyLight();
5071 PyObject *ret(PyTuple_New(1));
5072 PyObject *ret0(PyDict_New());
5074 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
5075 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
5076 PyDict_SetItem(ret0,a,d);
5077 Py_DECREF(a); Py_DECREF(d);
5079 PyTuple_SetItem(ret,0,ret0);
5083 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5085 self->checkConsistencyLight();
5086 PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
5087 PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
5088 const MEDCouplingMesh *mesh(self->getMesh());
5091 PyObject *ret(PyTuple_New(3));
5092 PyTuple_SetItem(ret,0,ret0);
5093 PyTuple_SetItem(ret,1,ret1);
5094 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
5098 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5100 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
5101 if(!PyTuple_Check(inp))
5102 throw INTERP_KERNEL::Exception(MSG);
5103 int sz(PyTuple_Size(inp));
5105 throw INTERP_KERNEL::Exception(MSG);
5107 PyObject *elt2(PyTuple_GetItem(inp,2));
5109 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
5110 if(!SWIG_IsOK(status))
5111 throw INTERP_KERNEL::Exception(MSG);
5112 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
5114 PyObject *elt0(PyTuple_GetItem(inp,0));
5115 PyObject *elt1(PyTuple_GetItem(inp,1));
5116 std::vector<double> a0;
5117 std::vector<int> a1;
5118 std::vector<std::string> a2;
5119 DataArrayInt *b0(0);
5120 std::vector<DataArrayDouble *>b1;
5122 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5123 throw INTERP_KERNEL::Exception(MSG);
5124 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5126 fillArrayWithPyListDbl3(a0py,tmp,a0);
5127 convertPyToNewIntArr3(a1py,a1);
5128 fillStringVector(a2py,a2);
5131 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5132 throw INTERP_KERNEL::Exception(MSG);
5133 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5135 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5136 if(!SWIG_IsOK(status))
5137 throw INTERP_KERNEL::Exception(MSG);
5138 b0=reinterpret_cast<DataArrayInt *>(argp);
5139 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5141 self->checkForUnserialization(a1,b0,b1);
5142 // useless here to call resizeForUnserialization because arrays are well resized.
5143 self->finishUnserialization(a1,a0,a2);
5148 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5151 int getNumberOfFields() const;
5152 MEDCouplingMultiFields *deepCopy() const;
5153 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5154 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5155 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5156 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5157 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5160 std::string __str__() const throw(INTERP_KERNEL::Exception)
5162 return self->simpleRepr();
5164 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5166 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5167 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5169 std::vector<MEDCouplingFieldDouble *> fs(sz);
5170 for(int i=0;i<sz;i++)
5171 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5172 return MEDCouplingMultiFields::New(fs);
5174 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5176 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5177 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5179 std::vector<MEDCouplingFieldDouble *> fs(sz);
5180 for(int i=0;i<sz;i++)
5181 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5182 return MEDCouplingMultiFields::New(fs);
5184 PyObject *getFields() const
5186 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5187 int sz=fields.size();
5188 PyObject *res = PyList_New(sz);
5189 for(int i=0;i<sz;i++)
5193 fields[i]->incrRef();
5194 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5198 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5203 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5205 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5209 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5212 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5214 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5216 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5218 PyObject *res = PyList_New(sz);
5219 for(int i=0;i<sz;i++)
5224 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5228 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5233 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5235 std::vector<int> refs;
5236 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5238 PyObject *res = PyList_New(sz);
5239 for(int i=0;i<sz;i++)
5244 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5248 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5252 PyObject *ret=PyTuple_New(2);
5253 PyTuple_SetItem(ret,0,res);
5254 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5257 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5259 std::vector<DataArrayDouble *> ms=self->getArrays();
5261 PyObject *res = PyList_New(sz);
5262 for(int i=0;i<sz;i++)
5267 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5271 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5276 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5278 std::vector< std::vector<int> > refs;
5279 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5281 PyObject *res = PyList_New(sz);
5282 PyObject *res2 = PyList_New(sz);
5283 for(int i=0;i<sz;i++)
5288 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5292 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5294 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5297 PyObject *ret=PyTuple_New(2);
5298 PyTuple_SetItem(ret,0,res);
5299 PyTuple_SetItem(ret,1,res2);
5305 class MEDCouplingFieldInt : public MEDCouplingField
5308 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5309 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5310 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5311 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5312 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5313 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5314 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5315 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5316 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5317 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5319 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5321 return MEDCouplingFieldInt::New(type,td);
5324 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5326 return MEDCouplingFieldInt::New(ft,td);
5329 std::string __str__() const throw(INTERP_KERNEL::Exception)
5331 return self->simpleRepr();
5334 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5336 std::ostringstream oss;
5337 self->reprQuickOverview(oss);
5341 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5343 DataArrayInt *ret=self->getArray();
5349 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5352 double tmp0=self->getTime(tmp1,tmp2);
5353 PyObject *res = PyList_New(3);
5354 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5355 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5356 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5362 class MEDCouplingDefinitionTime
5365 MEDCouplingDefinitionTime();
5366 void assign(const MEDCouplingDefinitionTime& other);
5367 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5368 double getTimeResolution() const;
5369 std::vector<double> getHotSpotsTime() const;
5372 std::string __str__() const throw(INTERP_KERNEL::Exception)
5374 std::ostringstream oss;
5375 self->appendRepr(oss);
5379 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5381 int meshId,arrId,arrIdInField,fieldId;
5382 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5383 PyObject *res=PyList_New(4);
5384 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5385 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5386 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5387 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5391 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5393 int meshId,arrId,arrIdInField,fieldId;
5394 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5395 PyObject *res=PyList_New(4);
5396 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5397 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5398 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5399 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5405 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5408 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5409 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5413 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5415 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5416 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5418 std::vector<MEDCouplingFieldDouble *> fs(sz);
5419 for(int i=0;i<sz;i++)
5420 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5421 return MEDCouplingFieldOverTime::New(fs);
5423 std::string __str__() const throw(INTERP_KERNEL::Exception)
5425 return self->simpleRepr();
5427 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5429 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5430 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5432 std::vector<MEDCouplingFieldDouble *> fs(sz);
5433 for(int i=0;i<sz;i++)
5434 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5435 return MEDCouplingFieldOverTime::New(fs);
5440 class MEDCouplingCartesianAMRMesh;
5442 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5445 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5446 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5447 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5450 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5452 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5460 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5463 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5464 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5465 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5468 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5470 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5471 return convertFromVectorPairInt(ret);
5474 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5476 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5477 return convertFromVectorPairInt(ret);
5480 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5482 std::vector< std::pair<int,int> > inp;
5483 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5484 self->addPatch(inp,factors);
5487 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5489 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5491 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5492 if(patchId==mesh->getNumberOfPatches())
5494 std::ostringstream oss;
5495 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5496 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5499 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5505 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5507 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5509 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5510 mesh->removePatch(patchId);
5513 int __len__() const throw(INTERP_KERNEL::Exception)
5515 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5517 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5518 return mesh->getNumberOfPatches();
5523 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5527 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5530 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5531 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5532 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5533 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5534 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5535 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5536 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5537 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5538 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5539 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5540 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5541 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5542 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5544 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5545 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5546 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5547 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5548 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5549 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5550 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5551 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5552 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5553 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5554 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5555 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5556 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5557 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5558 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5559 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5560 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5561 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5562 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5563 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5566 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5568 std::vector< std::pair<int,int> > inp;
5569 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5570 self->addPatch(inp,factors);
5573 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5575 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5577 PyObject *ret = PyList_New(sz);
5578 for(int i=0;i<sz;i++)
5580 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5583 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5588 // agy : don't know why typemap fails here ??? let it in the extend section
5589 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5591 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5594 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5596 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5597 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5603 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5605 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5606 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5612 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5614 std::vector<int> out1;
5615 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5616 PyObject *ret(PyTuple_New(2));
5617 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5618 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5622 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5624 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5626 PyObject *ret = PyList_New(sz);
5627 for(int i=0;i<sz;i++)
5628 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5632 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5634 std::vector<const DataArrayDouble *> inp;
5635 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5636 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5639 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5641 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5647 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5649 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5655 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5657 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5663 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5665 const MEDCouplingIMesh *ret(self->getImageMesh());
5668 return const_cast<MEDCouplingIMesh *>(ret);
5671 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5673 if(patchId==self->getNumberOfPatches())
5675 std::ostringstream oss;
5676 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5677 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5680 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5686 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5688 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5689 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5690 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5693 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5695 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5696 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5697 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5700 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5702 self->removePatch(patchId);
5705 int __len__() const throw(INTERP_KERNEL::Exception)
5707 return self->getNumberOfPatches();
5712 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5716 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5719 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5722 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5724 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5725 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5726 const int *nodeStrctPtr(0);
5727 const double *originPtr(0),*dxyzPtr(0);
5729 std::vector<int> bb0;
5730 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5733 std::vector<double> bb,bb2;
5735 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5736 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5738 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5741 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5743 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5744 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5745 std::vector< std::vector<int> > inp2;
5746 convertPyToVectorOfVectorOfInt(factors,inp2);
5747 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5750 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5752 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5755 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5757 return MEDCouplingCartesianAMRMesh::New(mesh);
5762 class MEDCouplingDataForGodFather : public RefCountObject
5765 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5766 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5767 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5768 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5769 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5770 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5771 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5772 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5773 virtual void alloc() throw(INTERP_KERNEL::Exception);
5774 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5777 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5779 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5787 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5790 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5791 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5792 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5793 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5794 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5795 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5796 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5797 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5798 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5801 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5803 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5804 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5805 MEDCouplingAMRAttribute *ret(0);
5808 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5809 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5811 catch(INTERP_KERNEL::Exception&)
5813 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5814 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5819 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5821 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5824 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5826 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5827 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5833 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5835 std::vector< std::vector<std::string> > compNamesCpp;
5836 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5837 self->spillInfoOnComponents(compNamesCpp);
5840 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5842 std::vector<int> inp0;
5843 if(!fillIntVector(nfs,inp0))
5844 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5845 std::size_t sz(inp0.size());
5846 std::vector<NatureOfField> inp00(sz);
5847 for(std::size_t i=0;i<sz;i++)
5848 inp00[i]=(NatureOfField)inp0[i];
5849 self->spillNatures(inp00);
5852 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5854 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5855 int sz((int)ret.size());
5856 PyObject *retPy(PyList_New(sz));
5857 for(int i=0;i<sz;i++)
5858 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5864 class DenseMatrix : public RefCountObject, public TimeLabel
5867 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5868 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5869 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5870 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5872 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5873 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5874 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5875 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5876 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5877 void transpose() throw(INTERP_KERNEL::Exception);
5879 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5880 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5881 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5884 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5886 return DenseMatrix::New(nbRows,nbCols);
5889 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5891 return DenseMatrix::New(array,nbRows,nbCols);
5894 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5897 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5898 PyObject *ret=PyTuple_New(2);
5899 PyObject *ret0Py=ret0?Py_True:Py_False;
5901 PyTuple_SetItem(ret,0,ret0Py);
5902 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5906 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5908 DataArrayDouble *ret(self->getData());
5914 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5916 return MEDCoupling::DenseMatrix::Add(self,other);
5919 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5921 return MEDCoupling::DenseMatrix::Substract(self,other);
5924 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5926 return MEDCoupling::DenseMatrix::Multiply(self,other);
5929 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5931 return MEDCoupling::DenseMatrix::Multiply(self,other);
5934 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5936 self->addEqual(other);
5937 Py_XINCREF(trueSelf);
5941 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5943 self->substractEqual(other);
5944 Py_XINCREF(trueSelf);
5948 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5950 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5957 class PartDefinition : public RefCountObject, public TimeLabel
5960 static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5961 static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5962 virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
5963 virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
5964 virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
5965 virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
5966 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5967 virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
5970 virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
5972 return (*self)+other;
5975 virtual PyObject *isEqual(const PartDefinition *other) const throw(INTERP_KERNEL::Exception)
5978 bool ret0(self->isEqual(other,ret1));
5979 PyObject *ret=PyTuple_New(2);
5980 PyObject *ret0Py=ret0?Py_True:Py_False;
5982 PyTuple_SetItem(ret,0,ret0Py);
5983 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5987 virtual PyObject *deepCopy() const throw(INTERP_KERNEL::Exception)
5989 return convertPartDefinition(self->deepCopy(),SWIG_POINTER_OWN | 0);
5993 virtual ~PartDefinition();
5996 class DataArrayPartDefinition : public PartDefinition
5999 static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
6002 DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
6004 return DataArrayPartDefinition::New(listOfIds);
6007 std::string __str__() const throw(INTERP_KERNEL::Exception)
6009 return self->getRepr();
6012 std::string __repr__() const throw(INTERP_KERNEL::Exception)
6014 std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
6015 oss << self->getRepr();
6020 virtual ~DataArrayPartDefinition();
6023 class SlicePartDefinition : public PartDefinition
6026 static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
6027 int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
6030 SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
6032 return SlicePartDefinition::New(start,stop,step);
6035 PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
6038 self->getSlice(a,b,c);
6039 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
6042 std::string __str__() const throw(INTERP_KERNEL::Exception)
6044 return self->getRepr();
6047 std::string __repr__() const throw(INTERP_KERNEL::Exception)
6049 std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
6050 oss << self->getRepr();
6055 virtual ~SlicePartDefinition();
6061 __filename=os.environ.get('PYTHONSTARTUP')
6062 if __filename and os.path.isfile(__filename):
6063 execfile(__filename)