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::findAndCorrectBadOriented3DExtrudedCells;
319 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
320 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
321 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
322 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
323 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
324 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
325 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
326 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
327 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
328 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
329 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
330 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
331 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
332 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
333 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
334 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
335 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
336 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
337 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
338 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
339 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
340 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
341 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
342 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
343 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
344 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
345 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
346 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
347 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
348 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
349 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
350 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
351 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
352 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
353 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
354 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
355 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
356 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
357 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
358 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
359 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
360 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
361 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
362 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
363 %newobject MEDCoupling::MEDCouplingCMesh::New;
364 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
365 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
366 %newobject MEDCoupling::MEDCouplingIMesh::New;
367 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
368 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
369 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
370 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
371 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
372 %newobject MEDCoupling::MEDCouplingMultiFields::New;
373 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
374 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
375 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
376 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
377 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
378 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
379 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
380 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
381 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
382 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
383 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
384 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
385 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
386 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
387 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
388 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
389 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
390 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
391 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
392 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
393 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
394 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
395 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
396 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
397 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
398 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
399 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
400 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
401 %newobject MEDCoupling::DenseMatrix::New;
402 %newobject MEDCoupling::DenseMatrix::deepCopy;
403 %newobject MEDCoupling::DenseMatrix::shallowCpy;
404 %newobject MEDCoupling::DenseMatrix::getData;
405 %newobject MEDCoupling::DenseMatrix::matVecMult;
406 %newobject MEDCoupling::DenseMatrix::MatVecMult;
407 %newobject MEDCoupling::DenseMatrix::__add__;
408 %newobject MEDCoupling::DenseMatrix::__sub__;
409 %newobject MEDCoupling::DenseMatrix::__mul__;
410 %newobject MEDCoupling::PartDefinition::New;
411 %newobject MEDCoupling::PartDefinition::toDAI;
412 %newobject MEDCoupling::PartDefinition::__add__;
413 %newobject MEDCoupling::PartDefinition::composeWith;
414 %newobject MEDCoupling::PartDefinition::tryToSimplify;
415 %newobject MEDCoupling::DataArrayPartDefinition::New;
416 %newobject MEDCoupling::SlicePartDefinition::New;
417 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
418 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
420 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
421 %feature("unref") MEDCouplingMesh "$this->decrRef();"
422 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
423 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
424 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
425 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
426 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
427 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
428 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
429 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
430 %feature("unref") MEDCouplingField "$this->decrRef();"
431 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
432 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
433 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
434 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
435 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
436 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
437 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
438 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
439 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
440 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
441 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
442 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
443 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
444 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
445 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
446 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
447 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
448 %feature("unref") DenseMatrix "$this->decrRef();"
449 %feature("unref") PartDefinition "$this->decrRef();"
450 %feature("unref") DataArrayPartDefinition "$this->decrRef();"
451 %feature("unref") SlicePartDefinition "$this->decrRef();"
453 %rename(assign) *::operator=;
454 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
455 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
456 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
457 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
461 %rename (InterpKernelException) INTERP_KERNEL::Exception;
463 %include "MEDCouplingRefCountObject.i"
464 %include "MEDCouplingMemArray.i"
466 namespace INTERP_KERNEL
469 * \class BoxSplittingOptions
470 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
472 class BoxSplittingOptions
475 BoxSplittingOptions();
476 void init() throw(INTERP_KERNEL::Exception);
477 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
478 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
479 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
480 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
481 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
482 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
483 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
484 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
485 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
486 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
487 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
488 std::string printOptions() const throw(INTERP_KERNEL::Exception);
491 std::string __str__() const throw(INTERP_KERNEL::Exception)
493 return self->printOptions();
499 namespace MEDCoupling
515 CONST_ON_TIME_INTERVAL = 7
516 } TypeOfTimeDiscretization;
524 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
525 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
527 } MEDCouplingMeshType;
530 class DataArrayDouble;
531 class MEDCouplingUMesh;
532 class MEDCouplingCMesh;
533 class MEDCouplingFieldDouble;
535 %extend RefCountObject
537 std::string getHiddenCppPointer() const
539 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
544 %extend MEDCouplingGaussLocalization
546 std::string __str__() const throw(INTERP_KERNEL::Exception)
548 return self->getStringRepr();
551 std::string __repr__() const throw(INTERP_KERNEL::Exception)
553 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
554 oss << self->getStringRepr();
561 class MEDCouplingMesh : public RefCountObject, public TimeLabel
564 void setName(const std::string& name);
565 std::string getName() const;
566 void setDescription(const std::string& descr);
567 std::string getDescription() const;
568 void setTime(double val, int iteration, int order);
569 void setTimeUnit(const std::string& unit);
570 std::string getTimeUnit() const;
571 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
572 bool isStructured() const throw(INTERP_KERNEL::Exception);
573 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
574 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
575 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
576 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
577 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
578 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
579 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
580 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
581 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
582 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
583 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
584 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
585 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
586 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
587 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
588 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
589 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
590 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
591 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
592 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
593 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
594 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
595 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
596 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
597 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
598 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
599 virtual std::string getVTKFileExtension() const;
600 std::string getVTKFileNameOf(const std::string& fileName) const;
602 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
603 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
604 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
605 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
606 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
607 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
608 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
609 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
610 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
611 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
612 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);
613 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
614 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
615 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
616 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
617 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
618 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
619 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
622 std::string __str__() const throw(INTERP_KERNEL::Exception)
624 return self->simpleRepr();
627 PyObject *getTime() throw(INTERP_KERNEL::Exception)
630 double tmp0=self->getTime(tmp1,tmp2);
631 PyObject *res = PyList_New(3);
632 PyList_SetItem(res,0,SWIG_From_double(tmp0));
633 PyList_SetItem(res,1,SWIG_From_int(tmp1));
634 PyList_SetItem(res,2,SWIG_From_int(tmp2));
638 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
640 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
641 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
647 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
651 DataArrayDoubleTuple *aa;
652 std::vector<double> bb;
654 int spaceDim=self->getSpaceDimension();
655 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
656 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
657 return self->getCellContainingPoint(pos,eps);
660 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
664 DataArrayDoubleTuple *aa;
665 std::vector<double> bb;
667 int spaceDim=self->getSpaceDimension();
668 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
669 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
670 MCAuto<DataArrayInt> elts,eltsIndex;
671 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
672 PyObject *ret=PyTuple_New(2);
673 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
674 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
678 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
680 MCAuto<DataArrayInt> elts,eltsIndex;
681 int spaceDim=self->getSpaceDimension();
683 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
684 if (!SWIG_IsOK(res1))
687 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
688 int nbOfPoints=size/spaceDim;
691 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
693 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
697 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
699 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
700 da2->checkAllocated();
701 int size=da2->getNumberOfTuples();
702 int nbOfCompo=da2->getNumberOfComponents();
703 if(nbOfCompo!=spaceDim)
705 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
707 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
709 PyObject *ret=PyTuple_New(2);
710 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
711 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
715 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
719 DataArrayDoubleTuple *aa;
720 std::vector<double> bb;
722 int spaceDim=self->getSpaceDimension();
723 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
724 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
725 std::vector<int> elts;
726 self->getCellsContainingPoint(pos,eps,elts);
727 DataArrayInt *ret=DataArrayInt::New();
728 ret->alloc((int)elts.size(),1);
729 std::copy(elts.begin(),elts.end(),ret->getPointer());
730 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
733 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
735 MCAuto<DataArrayInt> d0=DataArrayInt::New();
736 MCAuto<DataArrayInt> d1=DataArrayInt::New();
737 self->getReverseNodalConnectivity(d0,d1);
738 PyObject *ret=PyTuple_New(2);
739 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
740 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
744 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
747 int v0; std::vector<int> v1;
748 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
749 self->renumberCells(ids,check);
752 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
754 DataArrayInt *cellCor, *nodeCor;
755 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
756 PyObject *res = PyList_New(2);
757 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
758 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
762 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
764 DataArrayInt *cellCor=0,*nodeCor=0;
765 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
766 PyObject *res = PyList_New(2);
767 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
768 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
772 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
774 DataArrayInt *cellCor=0;
775 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
779 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
782 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
783 if (!SWIG_IsOK(res1))
786 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
787 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
791 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
793 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
794 da2->checkAllocated();
795 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
798 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
800 std::vector<int> conn;
801 self->getNodeIdsOfCell(cellId,conn);
802 return convertIntArrToPyList2(conn);
805 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
807 std::vector<double> coo;
808 self->getCoordinatesOfNode(nodeId,coo);
809 return convertDblArrToPyList2(coo);
812 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
816 DataArrayDoubleTuple *aa;
817 std::vector<double> bb;
819 int spaceDim=self->getSpaceDimension();
820 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
821 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
822 self->scale(pointPtr,factor);
825 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
827 int spaceDim=self->getSpaceDimension();
828 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
829 self->getBoundingBox(tmp);
830 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
834 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
837 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
838 PyObject *ret=PyTuple_New(2);
839 PyObject *ret0Py=ret0?Py_True:Py_False;
841 PyTuple_SetItem(ret,0,ret0Py);
842 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
846 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
848 int szArr,sw,iTypppArr;
849 std::vector<int> stdvecTyyppArr;
850 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
851 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
852 if(sw==3)//DataArrayInt
854 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
855 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
856 std::string name=argpt->getName();
858 ret->setName(name.c_str());
860 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
863 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
865 int szArr,sw,iTypppArr;
866 std::vector<int> stdvecTyyppArr;
868 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
869 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
870 if(sw==3)//DataArrayInt
872 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
873 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
874 std::string name=argpt->getName();
876 ret->setName(name.c_str());
879 PyObject *res = PyList_New(2);
880 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
881 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
882 PyList_SetItem(res,0,obj0);
883 PyList_SetItem(res,1,obj1);
887 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
891 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
892 PyObject *res = PyTuple_New(2);
893 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
896 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
898 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
899 PyTuple_SetItem(res,0,obj0);
900 PyTuple_SetItem(res,1,obj1);
904 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
906 std::vector<int> vals=self->getDistributionOfTypes();
908 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
909 PyObject *ret=PyList_New((int)vals.size()/3);
910 for(int j=0;j<(int)vals.size()/3;j++)
912 PyObject *ret1=PyList_New(3);
913 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
914 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
915 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
916 PyList_SetItem(ret,j,ret1);
921 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
923 std::vector<int> code;
924 std::vector<const DataArrayInt *> idsPerType;
925 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
926 convertPyToNewIntArr4(li,1,3,code);
927 return self->checkTypeConsistencyAndContig(code,idsPerType);
930 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
932 std::vector<int> code;
933 std::vector<DataArrayInt *> idsInPflPerType;
934 std::vector<DataArrayInt *> idsPerType;
935 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
936 PyObject *ret=PyTuple_New(3);
939 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
940 PyObject *ret0=PyList_New((int)code.size()/3);
941 for(int j=0;j<(int)code.size()/3;j++)
943 PyObject *ret00=PyList_New(3);
944 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
945 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
946 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
947 PyList_SetItem(ret0,j,ret00);
949 PyTuple_SetItem(ret,0,ret0);
951 PyObject *ret1=PyList_New(idsInPflPerType.size());
952 for(std::size_t j=0;j<idsInPflPerType.size();j++)
953 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
954 PyTuple_SetItem(ret,1,ret1);
955 int n=idsPerType.size();
956 PyObject *ret2=PyList_New(n);
958 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
959 PyTuple_SetItem(ret,2,ret2);
963 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
967 DataArrayDoubleTuple *aa;
968 std::vector<double> bb;
970 int spaceDim=self->getSpaceDimension();
971 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
972 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
973 self->translate(vectorPtr);
976 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
978 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
981 DataArrayDoubleTuple *aa;
982 std::vector<double> bb;
984 int spaceDim=self->getSpaceDimension();
985 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
986 self->rotate(centerPtr,0,alpha);
989 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
991 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
993 DataArrayDouble *a,*a2;
994 DataArrayDoubleTuple *aa,*aa2;
995 std::vector<double> bb,bb2;
997 int spaceDim=self->getSpaceDimension();
998 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
999 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
1000 self->rotate(centerPtr,vectorPtr,alpha);
1003 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1005 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1006 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1007 PyObject *res=PyList_New(result.size());
1008 for(int i=0;iL!=result.end(); i++, iL++)
1009 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1013 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
1015 std::vector<double> a0;
1016 std::vector<int> a1;
1017 std::vector<std::string> a2;
1018 self->getTinySerializationInformation(a0,a1,a2);
1019 PyObject *ret(PyTuple_New(3));
1020 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1021 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1023 PyObject *ret2(PyList_New(sz));
1025 for(int i=0;i<sz;i++)
1026 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1028 PyTuple_SetItem(ret,2,ret2);
1032 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1034 DataArrayInt *a0Tmp(0);
1035 DataArrayDouble *a1Tmp(0);
1036 self->serialize(a0Tmp,a1Tmp);
1037 PyObject *ret(PyTuple_New(2));
1038 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1039 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1043 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1045 std::vector<std::string> littleStrings;
1046 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1049 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1050 {// put an empty dict in input to say to __new__ to call __init__...
1051 PyObject *ret(PyTuple_New(1));
1052 PyObject *ret0(PyDict_New());
1053 PyTuple_SetItem(ret,0,ret0);
1057 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1059 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1060 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1061 PyObject *ret(PyTuple_New(2));
1062 PyTuple_SetItem(ret,0,ret0);
1063 PyTuple_SetItem(ret,1,ret1);
1067 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1069 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1070 if(!PyTuple_Check(inp))
1071 throw INTERP_KERNEL::Exception(MSG);
1072 int sz(PyTuple_Size(inp));
1074 throw INTERP_KERNEL::Exception(MSG);
1075 PyObject *elt0(PyTuple_GetItem(inp,0));
1076 PyObject *elt1(PyTuple_GetItem(inp,1));
1077 std::vector<double> a0;
1078 std::vector<int> a1;
1079 std::vector<std::string> a2;
1080 DataArrayInt *b0(0);
1081 DataArrayDouble *b1(0);
1083 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1084 throw INTERP_KERNEL::Exception(MSG);
1085 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1087 fillArrayWithPyListDbl3(a0py,tmp,a0);
1088 convertPyToNewIntArr3(a1py,a1);
1089 fillStringVector(a2py,a2);
1092 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1093 throw INTERP_KERNEL::Exception(MSG);
1094 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1096 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1097 if(!SWIG_IsOK(status))
1098 throw INTERP_KERNEL::Exception(MSG);
1099 b0=reinterpret_cast<DataArrayInt *>(argp);
1100 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1101 if(!SWIG_IsOK(status))
1102 throw INTERP_KERNEL::Exception(MSG);
1103 b1=reinterpret_cast<DataArrayDouble *>(argp);
1105 // useless here to call resizeForUnserialization because arrays are well resized.
1106 self->unserialization(a0,a1,b0,b1,a2);
1109 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1111 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1112 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1113 return MEDCouplingMesh::MergeMeshes(tmp);
1119 //== MEDCouplingMesh End
1121 %include "NormalizedGeometricTypes"
1122 %include "MEDCouplingNatureOfFieldEnum"
1124 namespace MEDCoupling
1126 class MEDCouplingNatureOfField
1129 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1130 static std::string GetReprNoThrow(NatureOfField nat);
1131 static std::string GetAllPossibilitiesStr();
1135 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1136 // include "MEDCouplingTimeDiscretization.i"
1138 namespace MEDCoupling
1140 class MEDCouplingGaussLocalization
1143 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1144 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1145 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1146 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1147 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1148 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1149 int getDimension() const throw(INTERP_KERNEL::Exception);
1150 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1151 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1152 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1153 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1155 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1156 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1157 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1158 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1159 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1160 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1161 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1162 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1163 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1164 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1165 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1166 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1168 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1172 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const throw(INTERP_KERNEL::Exception)
1174 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1178 MEDCouplingUMesh *buildRefCell() const throw(INTERP_KERNEL::Exception)
1180 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1186 class MEDCouplingSkyLineArray
1189 MEDCouplingSkyLineArray();
1190 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray &myArray );
1191 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value );
1192 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value );
1194 void set( DataArrayInt* index, DataArrayInt* value );
1195 int getNumberOf() const;
1196 int getLength() const;
1197 DataArrayInt* getIndexArray() const;
1198 DataArrayInt* getValueArray() const;
1201 std::string __str__() const throw(INTERP_KERNEL::Exception)
1203 return self->simpleRepr();
1209 %include "MEDCouplingFieldDiscretization.i"
1211 //== MEDCouplingPointSet
1213 namespace MEDCoupling
1215 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1218 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1219 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1220 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1221 void zipCoords() throw(INTERP_KERNEL::Exception);
1222 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1223 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1224 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1225 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1226 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1227 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1228 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1229 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1230 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1231 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1232 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1233 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1234 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1235 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1236 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1237 virtual DataArrayInt *findBoundaryNodes() const;
1238 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1239 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1240 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1241 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1242 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1243 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1244 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1245 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1246 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1249 std::string __str__() const throw(INTERP_KERNEL::Exception)
1251 return self->simpleRepr();
1254 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1257 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1258 PyObject *res = PyList_New(2);
1259 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1260 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1264 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1266 DataArrayInt *comm, *commIndex;
1267 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1268 PyObject *res = PyList_New(2);
1269 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1270 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1274 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1276 DataArrayDouble *ret1=self->getCoords();
1279 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1282 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1284 int szArr,sw,iTypppArr;
1285 std::vector<int> stdvecTyyppArr;
1286 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1287 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1288 if(sw==3)//DataArrayInt
1290 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1291 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1292 std::string name=argpt->getName();
1294 ret->setName(name.c_str());
1296 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1299 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1301 int szArr,sw,iTypppArr;
1302 std::vector<int> stdvecTyyppArr;
1303 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1304 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1305 if(sw==3)//DataArrayInt
1307 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1308 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1309 std::string name=argpt->getName();
1311 ret->setName(name.c_str());
1313 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1316 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1318 int szArr,sw,iTypppArr;
1319 std::vector<int> stdvecTyyppArr;
1320 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1321 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1322 if(sw==3)//DataArrayInt
1324 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1325 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1326 std::string name=argpt->getName();
1328 ret->setName(name.c_str());
1330 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1333 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1335 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1336 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1339 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1341 int szArr,sw,iTypppArr;
1342 std::vector<int> stdvecTyyppArr;
1343 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1344 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1345 if(sw==3)//DataArrayInt
1347 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1348 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1349 std::string name=argpt->getName();
1351 ret->setName(name.c_str());
1353 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1356 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1358 int szArr,sw,iTypppArr;
1359 std::vector<int> stdvecTyyppArr;
1360 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1361 self->renumberNodes(tmp,newNbOfNodes);
1364 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1366 int szArr,sw,iTypppArr;
1367 std::vector<int> stdvecTyyppArr;
1368 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1369 self->renumberNodesCenter(tmp,newNbOfNodes);
1372 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1374 int spaceDim=self->getSpaceDimension();
1376 DataArrayDouble *a,*a2;
1377 DataArrayDoubleTuple *aa,*aa2;
1378 std::vector<double> bb,bb2;
1380 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1381 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1382 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1383 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1384 std::vector<int> nodes;
1385 self->findNodesOnLine(p,v,eps,nodes);
1386 DataArrayInt *ret=DataArrayInt::New();
1387 ret->alloc((int)nodes.size(),1);
1388 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1389 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1391 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1393 int spaceDim=self->getSpaceDimension();
1395 DataArrayDouble *a,*a2;
1396 DataArrayDoubleTuple *aa,*aa2;
1397 std::vector<double> bb,bb2;
1399 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1400 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1401 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1402 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1403 std::vector<int> nodes;
1404 self->findNodesOnPlane(p,v,eps,nodes);
1405 DataArrayInt *ret=DataArrayInt::New();
1406 ret->alloc((int)nodes.size(),1);
1407 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1408 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1411 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1415 DataArrayDoubleTuple *aa;
1416 std::vector<double> bb;
1418 int spaceDim=self->getSpaceDimension();
1419 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1420 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1421 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1422 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1425 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1427 DataArrayInt *c=0,*cI=0;
1431 DataArrayDoubleTuple *aa;
1432 std::vector<double> bb;
1434 int spaceDim=self->getSpaceDimension();
1435 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1436 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1437 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1438 PyObject *ret=PyTuple_New(2);
1439 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1440 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1444 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1446 DataArrayInt *c=0,*cI=0;
1447 int spaceDim=self->getSpaceDimension();
1450 DataArrayDoubleTuple *aa;
1451 std::vector<double> bb;
1454 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1455 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1457 PyObject *ret=PyTuple_New(2);
1458 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1459 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1463 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1467 DataArrayDoubleTuple *aa;
1468 std::vector<double> bb;
1470 int spaceDim=self->getSpaceDimension();
1471 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1472 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1474 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1475 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1478 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1482 std::vector<int> multiVal;
1483 std::pair<int, std::pair<int,int> > slic;
1484 MEDCoupling::DataArrayInt *daIntTyypp=0;
1485 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1489 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1491 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1493 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1495 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1499 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1501 DataArrayInt *v0=0,*v1=0;
1502 self->findCommonCells(compType,startCellId,v0,v1);
1503 PyObject *res = PyList_New(2);
1504 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1505 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1510 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1513 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1514 if (!SWIG_IsOK(res1))
1517 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1518 self->renumberNodesInConn(tmp);
1522 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1524 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1525 da2->checkAllocated();
1526 self->renumberNodesInConn(da2->getConstPointer());
1530 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1533 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1534 PyObject *ret=PyTuple_New(2);
1535 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1536 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1540 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1542 DataArrayInt *ret=0;
1544 int szArr,sw,iTypppArr;
1545 std::vector<int> stdvecTyyppArr;
1546 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1547 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1551 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1555 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1556 PyObject *res = PyList_New(3);
1557 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1558 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1559 PyList_SetItem(res,2,SWIG_From_int(ret2));
1563 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1567 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1568 PyObject *res = PyList_New(3);
1569 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1570 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1571 PyList_SetItem(res,2,SWIG_From_int(ret2));
1575 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1578 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1579 if (!SWIG_IsOK(res1))
1582 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1583 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1587 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1589 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1590 da2->checkAllocated();
1591 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1595 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1599 std::vector<int> multiVal;
1600 std::pair<int, std::pair<int,int> > slic;
1601 MEDCoupling::DataArrayInt *daIntTyypp=0;
1602 int nbc=self->getNumberOfCells();
1603 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1610 std::ostringstream oss;
1611 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1612 throw INTERP_KERNEL::Exception(oss.str().c_str());
1615 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1620 int tmp=nbc+singleVal;
1621 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1625 std::ostringstream oss;
1626 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1627 throw INTERP_KERNEL::Exception(oss.str().c_str());
1633 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1637 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1642 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1643 daIntTyypp->checkAllocated();
1644 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1647 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1651 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1654 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1655 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1656 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1657 for(int i=0;i<sz;i++)
1658 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1661 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1664 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1666 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1667 std::vector<double> val3;
1668 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1669 "Rotate2DAlg",2,true,nbNodes);
1671 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1672 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1675 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1678 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1679 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1680 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1681 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1682 for(int i=0;i<sz;i++)
1683 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1686 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1689 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1691 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1692 std::vector<double> val3;
1693 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1694 "Rotate3DAlg",3,true,nbNodes);
1696 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1697 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1698 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1703 //== MEDCouplingPointSet End
1705 class MEDCouplingUMeshCell
1708 INTERP_KERNEL::NormalizedCellType getType() const;
1711 std::string __str__() const throw(INTERP_KERNEL::Exception)
1713 return self->repr();
1716 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1719 const int *r=self->getAllConn(ret2);
1720 PyObject *ret=PyTuple_New(ret2);
1721 for(int i=0;i<ret2;i++)
1722 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1728 class MEDCouplingUMeshCellIterator
1735 MEDCouplingUMeshCell *ret=self->nextt();
1737 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1740 PyErr_SetString(PyExc_StopIteration,"No more data.");
1747 class MEDCouplingUMeshCellByTypeIterator
1750 ~MEDCouplingUMeshCellByTypeIterator();
1755 MEDCouplingUMeshCellEntry *ret=self->nextt();
1757 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1760 PyErr_SetString(PyExc_StopIteration,"No more data.");
1767 class MEDCouplingUMeshCellByTypeEntry
1770 ~MEDCouplingUMeshCellByTypeEntry();
1773 MEDCouplingUMeshCellByTypeIterator *__iter__()
1775 return self->iterator();
1780 class MEDCouplingUMeshCellEntry
1783 INTERP_KERNEL::NormalizedCellType getType() const;
1784 int getNumberOfElems() const;
1787 MEDCouplingUMeshCellIterator *__iter__()
1789 return self->iterator();
1794 //== MEDCouplingUMesh
1796 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1799 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1800 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1801 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1802 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1803 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1804 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1805 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1806 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1807 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1808 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1809 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1810 void computeTypes() throw(INTERP_KERNEL::Exception);
1811 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1812 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1814 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1815 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1816 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1817 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1818 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1819 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1820 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1821 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1822 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1823 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1824 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1825 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1826 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1827 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1828 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1829 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1830 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1831 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1832 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1833 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1834 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1835 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1836 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1837 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1838 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1839 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1840 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1841 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1842 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1843 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1844 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1845 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1846 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1847 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1848 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1849 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1850 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1851 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1852 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1853 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1854 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1855 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1856 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1857 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1858 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1859 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);
1860 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1861 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1862 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1863 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1864 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1866 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1868 return MEDCouplingUMesh::New();
1871 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1873 return MEDCouplingUMesh::New(meshName,meshDim);
1877 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1879 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1882 std::string __str__() const throw(INTERP_KERNEL::Exception)
1884 return self->simpleRepr();
1887 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1889 std::ostringstream oss;
1890 self->reprQuickOverview(oss);
1894 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1896 return self->cellIterator();
1899 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1901 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1902 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1903 PyObject *res=PyList_New(result.size());
1904 for(int i=0;iL!=result.end(); i++, iL++)
1905 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1909 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1913 std::vector<int> multiVal;
1914 std::pair<int, std::pair<int,int> > slic;
1915 MEDCoupling::DataArrayInt *daIntTyypp=0;
1916 int nbc=self->getNumberOfCells();
1917 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1924 std::ostringstream oss;
1925 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1926 throw INTERP_KERNEL::Exception(oss.str().c_str());
1930 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1937 int tmp=nbc+singleVal;
1938 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1943 std::ostringstream oss;
1944 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1945 throw INTERP_KERNEL::Exception(oss.str().c_str());
1951 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1957 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1958 daIntTyypp->checkAllocated();
1959 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1963 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1967 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1971 std::vector<int> multiVal;
1972 std::pair<int, std::pair<int,int> > slic;
1973 MEDCoupling::DataArrayInt *daIntTyypp=0;
1974 int nbc=self->getNumberOfCells();
1975 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1982 std::ostringstream oss;
1983 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1984 throw INTERP_KERNEL::Exception(oss.str().c_str());
1988 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1995 int tmp=nbc+singleVal;
1996 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2001 std::ostringstream oss;
2002 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2003 throw INTERP_KERNEL::Exception(oss.str().c_str());
2009 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2014 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2020 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2021 daIntTyypp->checkAllocated();
2022 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2026 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2030 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2032 int szArr,sw,iTypppArr;
2033 std::vector<int> stdvecTyyppArr;
2034 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2037 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2038 throw INTERP_KERNEL::Exception(oss.str().c_str());
2040 self->insertNextCell(type,size,tmp);
2043 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2045 int szArr,sw,iTypppArr;
2046 std::vector<int> stdvecTyyppArr;
2047 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2048 self->insertNextCell(type,szArr,tmp);
2051 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2053 DataArrayInt *ret=self->getNodalConnectivity();
2058 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2060 DataArrayInt *ret=self->getNodalConnectivityIndex();
2066 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2068 int szArr,sw,iTypppArr;
2069 std::vector<int> stdvecTyyppArr;
2070 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2071 int nbOfDepthPeelingPerformed=0;
2072 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2073 PyObject *res=PyTuple_New(2);
2074 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2075 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2079 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2081 DataArrayInt *v0=0,*v1=0;
2082 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2083 PyObject *res = PyList_New(2);
2084 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2085 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2089 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2093 DataArrayDoubleTuple *aa;
2094 std::vector<double> bb;
2096 int nbOfCompo=self->getSpaceDimension();
2097 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2100 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2101 PyObject *ret=PyTuple_New(2);
2102 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2103 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2107 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2109 DataArrayInt *ret1=0;
2110 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2111 PyObject *ret=PyTuple_New(2);
2112 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2113 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2117 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2120 DataArrayInt *ret1(0);
2121 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2122 PyObject *ret=PyTuple_New(3);
2123 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2124 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2125 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2129 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2131 std::vector<int> cells;
2132 self->checkButterflyCells(cells,eps);
2133 DataArrayInt *ret=DataArrayInt::New();
2134 ret->alloc((int)cells.size(),1);
2135 std::copy(cells.begin(),cells.end(),ret->getPointer());
2136 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2139 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2141 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2143 PyObject *ret = PyList_New(sz);
2144 for(int i=0;i<sz;i++)
2145 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2149 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2151 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2152 int sz=retCpp.size();
2153 PyObject *ret=PyList_New(sz);
2154 for(int i=0;i<sz;i++)
2155 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2159 static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2161 std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2162 int sz=retCpp.size();
2163 PyObject *ret=PyList_New(sz);
2164 for(int i=0;i<sz;i++)
2165 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2169 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2172 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2173 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2174 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2177 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2180 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2181 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2185 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2188 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2189 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2193 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2195 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2196 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2197 PyObject *ret=PyTuple_New(3);
2198 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2199 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2200 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2204 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2206 DataArrayInt *tmp0=0,*tmp1=0;
2207 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2208 PyObject *ret=PyTuple_New(2);
2209 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2210 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2214 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2218 std::vector<int> multiVal;
2219 std::pair<int, std::pair<int,int> > slic;
2220 MEDCoupling::DataArrayInt *daIntTyypp=0;
2221 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2225 return self->duplicateNodes(&singleVal,&singleVal+1);
2227 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2229 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2231 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2235 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2239 std::vector<int> multiVal;
2240 std::pair<int, std::pair<int,int> > slic;
2241 MEDCoupling::DataArrayInt *daIntTyypp=0;
2242 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2246 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2248 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2250 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2252 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2256 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2259 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2260 DataArrayInt *tmp0,*tmp1=0;
2261 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2262 PyObject *ret=PyTuple_New(2);
2263 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2264 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2268 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2270 DataArrayInt *ret0=0,*ret1=0;
2271 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2272 PyObject *ret=PyTuple_New(2);
2273 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2274 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2278 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2280 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2281 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2282 DataArrayInt *ret1=0,*ret2=0;
2283 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2284 PyObject *ret=PyTuple_New(3);
2285 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2286 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2287 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2291 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2293 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2294 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2295 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2296 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2299 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2302 std::vector<const MEDCouplingUMesh *> meshes;
2303 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2304 std::vector<DataArrayInt *> corr;
2305 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2307 PyObject *ret1=PyList_New(sz);
2308 for(int i=0;i<sz;i++)
2309 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2310 PyObject *ret=PyList_New(2);
2311 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2312 PyList_SetItem(ret,1,ret1);
2316 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2318 std::vector<MEDCouplingUMesh *> meshes;
2319 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2320 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2323 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2325 std::vector<MEDCouplingUMesh *> meshes;
2326 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2327 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2330 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2334 std::vector<int> multiVal;
2335 std::pair<int, std::pair<int,int> > slic;
2336 MEDCoupling::DataArrayInt *daIntTyypp=0;
2338 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2339 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2343 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2345 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2347 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2349 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2353 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2355 DataArrayInt *arrOut=0,*arrIndexOut=0;
2358 std::vector<int> multiVal;
2359 std::pair<int, std::pair<int,int> > slic;
2360 MEDCoupling::DataArrayInt *daIntTyypp=0;
2362 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2363 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2368 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2373 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2378 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2382 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2384 PyObject *ret=PyTuple_New(2);
2385 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2386 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2390 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2392 DataArrayInt *arrOut=0,*arrIndexOut=0;
2393 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2394 PyObject *ret=PyTuple_New(2);
2395 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2396 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2400 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2402 if(!PySlice_Check(slic))
2403 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2404 Py_ssize_t strt=2,stp=2,step=2;
2405 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2407 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2408 arrIndxIn->checkAllocated();
2409 if(arrIndxIn->getNumberOfComponents()!=1)
2410 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2411 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2412 DataArrayInt *arrOut=0,*arrIndexOut=0;
2413 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2414 PyObject *ret=PyTuple_New(2);
2415 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2416 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2420 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2421 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2422 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2424 DataArrayInt *arrOut=0,*arrIndexOut=0;
2427 std::vector<int> multiVal;
2428 std::pair<int, std::pair<int,int> > slic;
2429 MEDCoupling::DataArrayInt *daIntTyypp=0;
2431 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2432 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2437 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2442 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2447 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2451 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2453 PyObject *ret=PyTuple_New(2);
2454 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2455 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2459 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2460 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2464 std::vector<int> multiVal;
2465 std::pair<int, std::pair<int,int> > slic;
2466 MEDCoupling::DataArrayInt *daIntTyypp=0;
2468 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2469 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2474 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2479 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2484 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2488 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2492 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2496 DataArrayDoubleTuple *aa;
2497 std::vector<double> bb;
2499 int spaceDim=self->getSpaceDimension();
2500 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2501 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2503 std::vector<int> cells;
2504 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2505 DataArrayInt *ret=DataArrayInt::New();
2506 ret->alloc((int)cells.size(),1);
2507 std::copy(cells.begin(),cells.end(),ret->getPointer());
2508 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2511 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) 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::orientCorrectly2DCells : ";
2520 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2521 self->orientCorrectly2DCells(v,polyOnly);
2524 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2526 std::vector<int> cells;
2527 self->arePolyhedronsNotCorrectlyOriented(cells);
2528 DataArrayInt *ret=DataArrayInt::New();
2529 ret->alloc((int)cells.size(),1);
2530 std::copy(cells.begin(),cells.end(),ret->getPointer());
2531 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2534 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2538 self->getFastAveragePlaneOfThis(vec,pos);
2540 std::copy(vec,vec+3,vals);
2541 std::copy(pos,pos+3,vals+3);
2542 return convertDblArrToPyListOfTuple(vals,3,2);
2545 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2547 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2548 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2549 return MEDCouplingUMesh::MergeUMeshes(tmp);
2552 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2555 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2556 PyObject *ret=PyTuple_New(2);
2557 PyObject *ret0Py=ret0?Py_True:Py_False;
2559 PyTuple_SetItem(ret,0,ret0Py);
2560 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2564 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2567 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2568 PyObject *ret=PyTuple_New(2);
2569 PyObject *ret0Py=ret0?Py_True:Py_False;
2571 PyTuple_SetItem(ret,0,ret0Py);
2572 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2576 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2578 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2579 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2580 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2581 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2582 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2583 PyObject *ret=PyTuple_New(5);
2584 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2585 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2586 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2587 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2588 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2592 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2594 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2595 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2596 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2597 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2598 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2599 PyObject *ret=PyTuple_New(5);
2600 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2601 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2602 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2603 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2604 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2608 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2610 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2611 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2612 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2613 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2614 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2615 PyObject *ret=PyTuple_New(5);
2616 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2617 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2618 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2619 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2620 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2624 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2626 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2627 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2628 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2629 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2630 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2631 PyObject *ret=PyTuple_New(5);
2632 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2633 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2634 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2635 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2636 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2640 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2642 DataArrayInt *neighbors=0,*neighborsIdx=0;
2643 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2644 PyObject *ret=PyTuple_New(2);
2645 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2646 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2650 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2652 DataArrayInt *neighbors=0,*neighborsIdx=0;
2653 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2654 PyObject *ret=PyTuple_New(2);
2655 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2656 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2660 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const throw(INTERP_KERNEL::Exception)
2662 MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
2663 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2664 PyObject *ret=PyTuple_New(2);
2665 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2666 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2670 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2672 DataArrayInt *neighbors=0,*neighborsIdx=0;
2673 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2674 PyObject *ret=PyTuple_New(2);
2675 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2676 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2680 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2682 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2683 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2684 DataArrayInt *d2,*d3,*d4,*dd5;
2685 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2686 PyObject *ret=PyTuple_New(7);
2687 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2688 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2689 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2690 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2691 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2692 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2693 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2697 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2700 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2701 da->checkAllocated();
2702 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2705 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2708 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2709 da->checkAllocated();
2710 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2713 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2716 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2717 da->checkAllocated();
2718 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2721 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2724 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2725 da->checkAllocated();
2726 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2727 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2728 PyObject *res = PyList_New(result.size());
2729 for (int i=0;iL!=result.end(); i++, iL++)
2730 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2734 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2737 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2738 da->checkAllocated();
2739 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2740 ret->setName(da->getName().c_str());
2744 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2746 DataArrayInt *cellNb1=0,*cellNb2=0;
2747 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2748 PyObject *ret=PyTuple_New(3);
2749 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2750 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2751 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2755 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2757 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2758 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2759 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2760 PyObject *ret(PyTuple_New(4));
2761 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2762 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2763 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2764 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2768 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2770 int spaceDim=self->getSpaceDimension();
2772 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2774 DataArrayDouble *a,*a2;
2775 DataArrayDoubleTuple *aa,*aa2;
2776 std::vector<double> bb,bb2;
2778 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2779 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2780 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2781 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2783 DataArrayInt *cellIds=0;
2784 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2785 PyObject *ret=PyTuple_New(2);
2786 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2787 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2791 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2793 int spaceDim=self->getSpaceDimension();
2795 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2797 DataArrayDouble *a,*a2;
2798 DataArrayDoubleTuple *aa,*aa2;
2799 std::vector<double> bb,bb2;
2801 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2802 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2803 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2804 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2806 DataArrayInt *cellIds=0;
2807 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2808 PyObject *ret=PyTuple_New(2);
2809 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2810 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2814 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2817 DataArrayDouble *a,*a2;
2818 DataArrayDoubleTuple *aa,*aa2;
2819 std::vector<double> bb,bb2;
2821 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st paramater for origin.";
2822 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd paramater for vector.";
2823 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2824 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2825 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2829 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2831 int spaceDim=self->getSpaceDimension();
2833 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2835 DataArrayDouble *a,*a2;
2836 DataArrayDoubleTuple *aa,*aa2;
2837 std::vector<double> bb,bb2;
2839 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2840 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2841 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2842 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2843 return self->getCellIdsCrossingPlane(orig,vect,eps);
2846 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2850 std::vector<int> pos2;
2851 DataArrayInt *pos3=0;
2852 DataArrayIntTuple *pos4=0;
2853 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2858 self->convertToPolyTypes(&pos1,&pos1+1);
2865 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2870 self->convertToPolyTypes(pos3->begin(),pos3->end());
2874 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2878 void convertAllToPoly();
2879 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2880 bool unPolyze() throw(INTERP_KERNEL::Exception);
2881 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2882 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2883 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2886 //== MEDCouplingUMesh End
2888 //== MEDCouplingMappedExtrudedMesh
2890 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
2893 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2894 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
2895 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2896 int get2DCellIdForExtrusion() const;
2898 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2900 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2903 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
2905 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
2908 MEDCouplingMappedExtrudedMesh()
2910 return MEDCouplingMappedExtrudedMesh::New();
2913 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2915 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
2918 std::string __str__() const throw(INTERP_KERNEL::Exception)
2920 return self->simpleRepr();
2923 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2925 std::ostringstream oss;
2926 self->reprQuickOverview(oss);
2930 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2932 MEDCouplingUMesh *ret=self->getMesh2D();
2935 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2937 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2939 MEDCouplingUMesh *ret=self->getMesh1D();
2942 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2944 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2946 DataArrayInt *ret=self->getMesh3DIds();
2949 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2954 //== MEDCouplingMappedExtrudedMesh End
2956 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
2959 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2960 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2961 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2962 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2963 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2964 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2967 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2969 int szArr,sw,iTypppArr;
2970 std::vector<int> stdvecTyyppArr;
2971 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2972 self->insertNextCell(tmp,tmp+szArr);
2975 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2977 DataArrayInt *ret=self->getNodalConnectivity();
2978 if(ret) ret->incrRef();
2982 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2984 std::vector< const MEDCoupling1GTUMesh *> parts;
2985 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2986 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2991 //== MEDCoupling1SGTUMesh
2993 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
2996 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2997 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2998 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2999 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
3000 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
3001 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3002 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
3003 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
3004 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
3007 MEDCoupling1SGTUMesh()
3009 return MEDCoupling1SGTUMesh::New();
3012 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3014 return MEDCoupling1SGTUMesh::New(name,type);
3017 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3019 return MEDCoupling1SGTUMesh::New(m);
3022 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3024 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
3027 std::string __str__() const throw(INTERP_KERNEL::Exception)
3029 return self->simpleRepr();
3032 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3034 std::ostringstream oss;
3035 self->reprQuickOverview(oss);
3039 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3041 DataArrayInt *cellPerm(0),*nodePerm(0);
3042 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3043 PyObject *ret(PyTuple_New(3));
3044 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3045 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3046 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3050 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3052 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3053 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3054 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3057 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3059 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3060 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3061 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3066 //== MEDCoupling1SGTUMesh End
3068 //== MEDCoupling1DGTUMesh
3070 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3073 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3074 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3075 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3076 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3077 bool isPacked() const throw(INTERP_KERNEL::Exception);
3080 MEDCoupling1DGTUMesh()
3082 return MEDCoupling1DGTUMesh::New();
3084 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3086 return MEDCoupling1DGTUMesh::New(name,type);
3089 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3091 return MEDCoupling1DGTUMesh::New(m);
3094 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3096 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3099 std::string __str__() const throw(INTERP_KERNEL::Exception)
3101 return self->simpleRepr();
3104 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3106 std::ostringstream oss;
3107 self->reprQuickOverview(oss);
3111 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3113 DataArrayInt *ret=self->getNodalConnectivityIndex();
3114 if(ret) ret->incrRef();
3118 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3120 DataArrayInt *ret1=0,*ret2=0;
3121 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3122 PyObject *ret0Py=ret0?Py_True:Py_False;
3124 PyObject *ret=PyTuple_New(3);
3125 PyTuple_SetItem(ret,0,ret0Py);
3126 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3127 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3131 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3134 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3135 PyObject *ret=PyTuple_New(2);
3136 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3137 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3138 PyTuple_SetItem(ret,1,ret1Py);
3142 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3144 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3145 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3146 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3149 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3151 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3152 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3153 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3156 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3158 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3159 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3160 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3165 //== MEDCoupling1DGTUMeshEnd
3167 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3170 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3171 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3172 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3173 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3174 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3175 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3176 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3177 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3178 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3179 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3180 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3181 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3182 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3183 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3184 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3187 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3189 int tmpp1=-1,tmpp2=-1;
3190 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3191 std::vector< std::pair<int,int> > inp;
3195 for(int i=0;i<tmpp1;i++)
3196 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3201 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3202 inp.resize(tmpp1/2);
3203 for(int i=0;i<tmpp1/2;i++)
3204 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3207 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3208 return self->buildStructuredSubPart(inp);
3211 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3213 std::vector< std::pair<int,int> > inp;
3214 convertPyToVectorPairInt(part,inp);
3216 int szArr,sw,iTypppArr;
3217 std::vector<int> stdvecTyyppArr;
3218 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3219 std::vector<int> tmp5(tmp4,tmp4+szArr);
3221 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3224 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3226 std::vector< std::pair<int,int> > inp;
3227 convertPyToVectorPairInt(part,inp);
3228 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3231 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3233 std::vector< std::pair<int,int> > inp;
3234 convertPyToVectorPairInt(part,inp);
3235 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3238 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3240 std::vector< std::pair<int,int> > inp;
3241 convertPyToVectorPairInt(part,inp);
3242 std::vector<int> stWithGhost;
3243 std::vector< std::pair<int,int> > partWithGhost;
3244 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3245 PyObject *ret(PyTuple_New(2));
3246 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3247 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3251 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3253 std::vector< std::pair<int,int> > inp;
3254 convertPyToVectorPairInt(partCompactFormat,inp);
3255 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3258 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3260 std::vector< std::pair<int,int> > inp;
3261 convertPyToVectorPairInt(partCompactFormat,inp);
3262 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3265 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3267 std::vector< std::pair<int,int> > inp;
3268 convertPyToVectorPairInt(part,inp);
3269 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3272 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3274 int szArr,sw,iTypppArr;
3275 std::vector<int> stdvecTyyppArr;
3276 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3277 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3280 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3282 int szArr,sw,iTypppArr;
3283 std::vector<int> stdvecTyyppArr;
3284 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3285 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3288 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3290 std::vector< std::pair<int,int> > inp;
3291 convertPyToVectorPairInt(partCompactFormat,inp);
3292 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3295 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3297 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3298 PyObject *retPy=PyList_New(ret.size());
3299 for(std::size_t i=0;i<ret.size();i++)
3301 PyObject *tmp=PyTuple_New(2);
3302 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3303 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3304 PyList_SetItem(retPy,i,tmp);
3309 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3311 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3312 convertPyToVectorPairInt(r1,r1Cpp);
3313 convertPyToVectorPairInt(r2,r2Cpp);
3314 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3315 PyObject *retPy=PyList_New(ret.size());
3316 for(std::size_t i=0;i<ret.size();i++)
3318 PyObject *tmp=PyTuple_New(2);
3319 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3320 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3321 PyList_SetItem(retPy,i,tmp);
3326 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3328 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3329 convertPyToVectorPairInt(r1,r1Cpp);
3330 convertPyToVectorPairInt(r2,r2Cpp);
3331 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3334 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3336 int szArr,sw,iTypppArr;
3337 std::vector<int> stdvecTyyppArr;
3338 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3339 int szArr2,sw2,iTypppArr2;
3340 std::vector<int> stdvecTyyppArr2;
3341 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3342 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3343 std::vector< std::pair<int,int> > partCompactFormat;
3344 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3345 PyObject *ret=PyTuple_New(2);
3346 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3347 PyTuple_SetItem(ret,0,ret0Py);
3348 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3349 for(std::size_t i=0;i<partCompactFormat.size();i++)
3351 PyObject *tmp4=PyTuple_New(2);
3352 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3353 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3354 PyList_SetItem(ret1Py,i,tmp4);
3356 PyTuple_SetItem(ret,1,ret1Py);
3360 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3362 std::vector< std::pair<int,int> > param0,param1,ret;
3363 convertPyToVectorPairInt(bigInAbs,param0);
3364 convertPyToVectorPairInt(partOfBigInAbs,param1);
3365 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3366 PyObject *retPy(PyList_New(ret.size()));
3367 for(std::size_t i=0;i<ret.size();i++)
3369 PyObject *tmp(PyTuple_New(2));
3370 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3371 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3372 PyList_SetItem(retPy,i,tmp);
3377 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3379 std::vector< std::pair<int,int> > param0;
3380 convertPyToVectorPairInt(part,param0);
3381 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3382 PyObject *retPy(PyList_New(ret.size()));
3383 for(std::size_t i=0;i<ret.size();i++)
3385 PyObject *tmp(PyTuple_New(2));
3386 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3387 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3388 PyList_SetItem(retPy,i,tmp);
3393 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3395 std::vector< std::pair<int,int> > param0,param1;
3396 convertPyToVectorPairInt(startingFrom,param0);
3397 convertPyToVectorPairInt(goingTo,param1);
3398 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3401 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3403 std::vector< std::pair<int,int> > param0,param1,ret;
3404 convertPyToVectorPairInt(bigInAbs,param0);
3405 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3406 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3407 PyObject *retPy(PyList_New(ret.size()));
3408 for(std::size_t i=0;i<ret.size();i++)
3410 PyObject *tmp(PyTuple_New(2));
3411 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3412 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3413 PyList_SetItem(retPy,i,tmp);
3420 class MEDCouplingCurveLinearMesh;
3422 //== MEDCouplingCMesh
3424 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3427 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3428 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3429 void setCoords(const DataArrayDouble *coordsX,
3430 const DataArrayDouble *coordsY=0,
3431 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3432 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3433 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3435 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3437 return MEDCouplingCMesh::New();
3439 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3441 return MEDCouplingCMesh::New(meshName);
3444 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3446 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3448 std::string __str__() const throw(INTERP_KERNEL::Exception)
3450 return self->simpleRepr();
3452 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3454 std::ostringstream oss;
3455 self->reprQuickOverview(oss);
3458 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3460 DataArrayDouble *ret=self->getCoordsAt(i);
3468 //== MEDCouplingCMesh End
3470 //== MEDCouplingCurveLinearMesh
3472 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3475 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3476 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3477 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3479 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3481 return MEDCouplingCurveLinearMesh::New();
3483 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3485 return MEDCouplingCurveLinearMesh::New(meshName);
3487 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3489 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3491 std::string __str__() const throw(INTERP_KERNEL::Exception)
3493 return self->simpleRepr();
3495 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3497 std::ostringstream oss;
3498 self->reprQuickOverview(oss);
3501 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3503 DataArrayDouble *ret=self->getCoords();
3508 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3510 int szArr,sw,iTypppArr;
3511 std::vector<int> stdvecTyyppArr;
3512 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3513 self->setNodeGridStructure(tmp,tmp+szArr);
3518 //== MEDCouplingCurveLinearMesh End
3520 //== MEDCouplingIMesh
3522 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3525 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3527 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3528 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3529 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3530 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3531 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3532 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3533 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3534 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3535 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3536 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3537 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3542 return MEDCouplingIMesh::New();
3544 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3546 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3547 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3548 const int *nodeStrctPtr(0);
3549 const double *originPtr(0),*dxyzPtr(0);
3551 std::vector<int> bb0;
3552 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3555 std::vector<double> bb,bb2;
3557 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3558 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3560 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3563 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3565 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3568 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3570 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3573 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3576 std::vector<int> bb0;
3577 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3578 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3581 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3583 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3586 DataArrayDoubleTuple *aa;
3587 std::vector<double> bb;
3589 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3590 self->setOrigin(originPtr,originPtr+nbTuples);
3593 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3595 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3598 DataArrayDoubleTuple *aa;
3599 std::vector<double> bb;
3601 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3602 self->setDXYZ(originPtr,originPtr+nbTuples);
3605 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3607 std::vector< std::pair<int,int> > inp;
3608 convertPyToVectorPairInt(fineLocInCoarse,inp);
3609 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3612 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)
3614 std::vector< std::pair<int,int> > inp;
3615 convertPyToVectorPairInt(fineLocInCoarse,inp);
3616 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3619 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3621 std::vector< std::pair<int,int> > inp;
3622 convertPyToVectorPairInt(fineLocInCoarse,inp);
3623 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3626 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)
3628 std::vector< std::pair<int,int> > inp;
3629 convertPyToVectorPairInt(fineLocInCoarse,inp);
3630 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3633 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)
3635 std::vector< std::pair<int,int> > inp;
3636 convertPyToVectorPairInt(fineLocInCoarse,inp);
3637 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3640 std::string __str__() const throw(INTERP_KERNEL::Exception)
3642 return self->simpleRepr();
3644 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3646 std::ostringstream oss;
3647 self->reprQuickOverview(oss);
3653 //== MEDCouplingIMesh End
3657 namespace MEDCoupling
3659 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3662 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3663 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3664 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3665 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3666 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3667 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3668 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3669 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3670 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3671 std::string getName() const throw(INTERP_KERNEL::Exception);
3672 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3673 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3674 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3675 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3676 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3677 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3678 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3679 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3680 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3681 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3682 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3683 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3684 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3685 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3686 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3687 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3689 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3691 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3694 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3697 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3699 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3702 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3705 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3707 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3708 return convertIntArrToPyList3(ret);
3711 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3714 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3715 PyObject *ret=PyTuple_New(2);
3716 PyObject *ret0Py=ret0?Py_True:Py_False;
3718 PyTuple_SetItem(ret,0,ret0Py);
3719 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3723 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3725 DataArrayInt *ret1=0;
3726 MEDCouplingMesh *ret0=0;
3728 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3729 if (!SWIG_IsOK(res1))
3732 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3733 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3737 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3739 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3740 da2->checkAllocated();
3741 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3743 PyObject *res = PyList_New(2);
3744 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3745 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3749 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3751 DataArrayInt *ret1=0;
3753 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3754 PyObject *res=PyTuple_New(2);
3755 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3757 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3760 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3761 PyTuple_SetItem(res,1,res1);
3766 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3769 int v0; std::vector<int> v1;
3770 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3771 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3774 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3775 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3778 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3779 if (!SWIG_IsOK(res1))
3782 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3783 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3787 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3789 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3790 da2->checkAllocated();
3791 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3795 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3797 std::vector<int> tmp;
3798 self->getCellIdsHavingGaussLocalization(locId,tmp);
3799 DataArrayInt *ret=DataArrayInt::New();
3800 ret->alloc((int)tmp.size(),1);
3801 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3802 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3805 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3807 std::vector<int> inp0;
3808 convertPyToNewIntArr4(code,1,3,inp0);
3809 std::vector<const DataArrayInt *> inp1;
3810 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3811 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3816 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3819 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3820 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3821 static MEDCouplingFieldTemplate *New(TypeOfField type);
3822 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3823 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3826 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3828 return MEDCouplingFieldTemplate::New(f);
3831 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3833 return MEDCouplingFieldTemplate::New(f);
3836 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3838 return MEDCouplingFieldTemplate::New(type);
3841 std::string __str__() const throw(INTERP_KERNEL::Exception)
3843 return self->simpleRepr();
3846 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3848 std::ostringstream oss;
3849 self->reprQuickOverview(oss);
3855 class MEDCouplingFieldInt;
3857 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3860 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3861 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3862 void setTimeUnit(const std::string& unit);
3863 std::string getTimeUnit() const;
3864 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3865 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3866 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3867 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3868 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3869 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3870 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
3871 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3872 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3873 MEDCouplingFieldDouble *deepCopy() const;
3874 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
3875 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3876 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3877 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3878 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3879 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3880 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3881 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3882 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3883 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3884 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3885 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3886 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3887 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3888 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3889 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3890 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3891 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3892 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3893 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3894 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3895 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3896 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3897 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3898 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3899 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3900 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3901 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3902 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3903 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3904 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3905 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3906 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3907 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3908 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3909 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3910 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3911 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3912 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3913 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3914 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3915 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3916 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3917 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3918 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3919 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3920 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3921 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3922 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3923 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3924 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3925 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3926 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3927 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3928 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3929 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3930 double getMinValue() const throw(INTERP_KERNEL::Exception);
3931 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3932 double norm2() const throw(INTERP_KERNEL::Exception);
3933 double normMax() const throw(INTERP_KERNEL::Exception);
3934 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3935 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3936 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3937 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3938 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3939 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3940 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3941 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3942 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3943 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3944 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3945 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3946 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3947 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3948 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3949 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3950 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3951 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3952 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3953 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3954 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3955 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3957 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3959 return MEDCouplingFieldDouble::New(type,td);
3962 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3964 return MEDCouplingFieldDouble::New(ft,td);
3967 std::string __str__() const throw(INTERP_KERNEL::Exception)
3969 return self->simpleRepr();
3972 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3974 std::ostringstream oss;
3975 self->reprQuickOverview(oss);
3979 MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
3981 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
3985 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
3987 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
3991 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
3993 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
3995 DataArrayDouble *a,*a2;
3996 DataArrayDoubleTuple *aa,*aa2;
3997 std::vector<double> bb,bb2;
3999 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4000 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4001 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4004 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
4006 DataArrayDouble *ret=self->getArray();
4012 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4014 std::vector<DataArrayDouble *> arrs=self->getArrays();
4015 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4019 PyObject *ret=PyTuple_New(sz);
4020 for(int i=0;i<sz;i++)
4023 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4025 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4030 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4032 std::vector<const DataArrayDouble *> tmp;
4033 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4035 std::vector<DataArrayDouble *> arrs(sz);
4036 for(int i=0;i<sz;i++)
4037 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4038 self->setArrays(arrs);
4041 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4043 DataArrayDouble *ret=self->getEndArray();
4049 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4053 DataArrayDoubleTuple *aa;
4054 std::vector<double> bb;
4056 const MEDCouplingMesh *mesh=self->getMesh();
4058 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4059 int spaceDim=mesh->getSpaceDimension();
4060 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4061 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4063 int sz=self->getNumberOfComponents();
4064 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4065 self->getValueOn(spaceLoc,res);
4066 return convertDblArrToPyList(res,sz);
4069 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4071 int sz=self->getNumberOfComponents();
4072 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4073 self->getValueOnPos(i,j,k,res);
4074 return convertDblArrToPyList(res,sz);
4077 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4079 const MEDCouplingMesh *mesh(self->getMesh());
4081 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4084 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4085 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4086 mesh->getSpaceDimension(),true,nbPts);
4087 return self->getValueOnMulti(inp,nbPts);
4090 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4094 DataArrayDoubleTuple *aa;
4095 std::vector<double> bb;
4097 const MEDCouplingMesh *mesh=self->getMesh();
4099 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4100 int spaceDim=mesh->getSpaceDimension();
4101 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4102 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4105 int sz=self->getNumberOfComponents();
4106 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4107 self->getValueOn(spaceLoc,time,res);
4108 return convertDblArrToPyList(res,sz);
4111 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4113 if(self->getArray()!=0)
4114 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4117 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4118 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4119 self->setArray(arr);
4123 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4126 double tmp0=self->getTime(tmp1,tmp2);
4127 PyObject *res = PyList_New(3);
4128 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4129 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4130 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4134 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4137 double tmp0=self->getStartTime(tmp1,tmp2);
4138 PyObject *res = PyList_New(3);
4139 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4140 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4141 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4145 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4148 double tmp0=self->getEndTime(tmp1,tmp2);
4149 PyObject *res = PyList_New(3);
4150 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4151 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4152 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4155 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4157 int sz=self->getNumberOfComponents();
4158 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4159 self->accumulate(tmp);
4160 return convertDblArrToPyList(tmp,sz);
4162 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4164 int sz=self->getNumberOfComponents();
4165 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4166 self->integral(isWAbs,tmp);
4167 return convertDblArrToPyList(tmp,sz);
4169 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4171 int sz=self->getNumberOfComponents();
4172 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4173 self->getWeightedAverageValue(tmp,isWAbs);
4174 return convertDblArrToPyList(tmp,sz);
4176 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4178 int sz=self->getNumberOfComponents();
4179 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4181 return convertDblArrToPyList(tmp,sz);
4183 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4185 int sz=self->getNumberOfComponents();
4186 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4188 return convertDblArrToPyList(tmp,sz);
4190 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4192 int szArr,sw,iTypppArr;
4193 std::vector<int> stdvecTyyppArr;
4194 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4195 self->renumberCells(tmp,check);
4198 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4200 int szArr,sw,iTypppArr;
4201 std::vector<int> stdvecTyyppArr;
4202 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4203 self->renumberCellsWithoutMesh(tmp,check);
4206 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4208 int szArr,sw,iTypppArr;
4209 std::vector<int> stdvecTyyppArr;
4210 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4211 self->renumberNodes(tmp,eps);
4214 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4216 int szArr,sw,iTypppArr;
4217 std::vector<int> stdvecTyyppArr;
4218 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4219 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4222 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4226 std::vector<int> multiVal;
4227 std::pair<int, std::pair<int,int> > slic;
4228 MEDCoupling::DataArrayInt *daIntTyypp=0;
4229 const MEDCouplingMesh *mesh=self->getMesh();
4231 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4232 int nbc=mesh->getNumberOfCells();
4233 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4240 std::ostringstream oss;
4241 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4242 throw INTERP_KERNEL::Exception(oss.str().c_str());
4245 return self->buildSubPart(&singleVal,&singleVal+1);
4250 int tmp=nbc+singleVal;
4251 return self->buildSubPart(&tmp,&tmp+1);
4255 std::ostringstream oss;
4256 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4257 throw INTERP_KERNEL::Exception(oss.str().c_str());
4263 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4267 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4272 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4273 daIntTyypp->checkAllocated();
4274 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4277 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4281 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4283 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";
4284 if(PyTuple_Check(li))
4286 Py_ssize_t sz=PyTuple_Size(li);
4288 throw INTERP_KERNEL::Exception(msg);
4289 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4292 std::vector<int> multiVal;
4293 std::pair<int, std::pair<int,int> > slic;
4294 MEDCoupling::DataArrayInt *daIntTyypp=0;
4295 if(!self->getArray())
4296 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4298 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4299 catch(INTERP_KERNEL::Exception& e)
4300 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4301 MCAuto<MEDCouplingFieldDouble> ret0=MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4302 DataArrayDouble *ret0Arr=ret0->getArray();
4304 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4309 std::vector<int> v2(1,singleVal);
4310 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4311 ret0->setArray(aarr);
4316 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4317 ret0->setArray(aarr);
4322 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4323 std::vector<int> v2(nbOfComp);
4324 for(int i=0;i<nbOfComp;i++)
4325 v2[i]=slic.first+i*slic.second.second;
4326 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4327 ret0->setArray(aarr);
4331 throw INTERP_KERNEL::Exception(msg);
4336 return MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,li);
4339 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4342 double r1=self->getMaxValue2(tmp);
4343 PyObject *ret=PyTuple_New(2);
4344 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4345 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4349 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4352 double r1=self->getMinValue2(tmp);
4353 PyObject *ret=PyTuple_New(2);
4354 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4355 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4359 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4361 std::vector<int> tmp;
4362 convertPyToNewIntArr3(li,tmp);
4363 return self->keepSelectedComponents(tmp);
4366 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4368 std::vector<int> tmp;
4369 convertPyToNewIntArr3(li,tmp);
4370 self->setSelectedComponents(f,tmp);
4373 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4376 DataArrayDouble *a,*a2;
4377 DataArrayDoubleTuple *aa,*aa2;
4378 std::vector<double> bb,bb2;
4381 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4382 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4383 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4384 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4386 return self->extractSlice3D(orig,vect,eps);
4389 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4391 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4394 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4396 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4399 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4401 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.";
4402 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4405 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4407 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4409 return (*self)-(*other);
4411 throw INTERP_KERNEL::Exception(msg);
4416 DataArrayDoubleTuple *aa;
4417 std::vector<double> bb;
4419 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4424 if(!self->getArray())
4425 throw INTERP_KERNEL::Exception(msg2);
4426 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4427 ret->applyLin(1.,-val);
4428 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4429 ret2->setArray(ret);
4434 if(!self->getArray())
4435 throw INTERP_KERNEL::Exception(msg2);
4436 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4437 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4438 ret2->setArray(ret);
4443 if(!self->getArray())
4444 throw INTERP_KERNEL::Exception(msg2);
4445 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4446 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4447 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4448 ret2->setArray(ret);
4453 if(!self->getArray())
4454 throw INTERP_KERNEL::Exception(msg2);
4455 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4456 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4457 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4458 ret2->setArray(ret);
4462 { throw INTERP_KERNEL::Exception(msg); }
4466 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4468 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4471 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4473 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4476 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4478 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4481 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4483 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.";
4484 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4487 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4489 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4491 return (*self)/(*other);
4493 throw INTERP_KERNEL::Exception(msg);
4498 DataArrayDoubleTuple *aa;
4499 std::vector<double> bb;
4501 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4507 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4508 if(!self->getArray())
4509 throw INTERP_KERNEL::Exception(msg2);
4510 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4511 ret->applyLin(1./val,0);
4512 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4513 ret2->setArray(ret);
4518 if(!self->getArray())
4519 throw INTERP_KERNEL::Exception(msg2);
4520 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4521 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4522 ret2->setArray(ret);
4527 if(!self->getArray())
4528 throw INTERP_KERNEL::Exception(msg2);
4529 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4530 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4531 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4532 ret2->setArray(ret);
4537 if(!self->getArray())
4538 throw INTERP_KERNEL::Exception(msg2);
4539 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4540 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4541 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4542 ret2->setArray(ret);
4546 { throw INTERP_KERNEL::Exception(msg); }
4550 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4552 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4555 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4557 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.";
4558 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4561 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4563 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4565 return (*self)^(*other);
4567 throw INTERP_KERNEL::Exception(msg);
4572 DataArrayDoubleTuple *aa;
4573 std::vector<double> bb;
4575 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4580 if(!self->getArray())
4581 throw INTERP_KERNEL::Exception(msg2);
4582 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4584 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4585 ret2->setArray(ret);
4590 if(!self->getArray())
4591 throw INTERP_KERNEL::Exception(msg2);
4592 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4593 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4594 ret2->setArray(ret);
4599 if(!self->getArray())
4600 throw INTERP_KERNEL::Exception(msg2);
4601 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4602 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4603 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4604 ret2->setArray(ret);
4609 if(!self->getArray())
4610 throw INTERP_KERNEL::Exception(msg2);
4611 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4612 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4613 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4614 ret2->setArray(ret);
4618 { throw INTERP_KERNEL::Exception(msg); }
4622 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4624 return self->negate();
4627 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4629 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.";
4630 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4633 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4635 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4639 Py_XINCREF(trueSelf);
4643 throw INTERP_KERNEL::Exception(msg);
4648 DataArrayDoubleTuple *aa;
4649 std::vector<double> bb;
4651 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4656 if(!self->getArray())
4657 throw INTERP_KERNEL::Exception(msg2);
4658 self->getArray()->applyLin(1.,val);
4659 Py_XINCREF(trueSelf);
4664 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4667 Py_XINCREF(trueSelf);
4672 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4673 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4674 ret2->setArray(aaa);
4676 Py_XINCREF(trueSelf);
4681 if(!self->getArray())
4682 throw INTERP_KERNEL::Exception(msg2);
4683 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4684 self->getArray()->addEqual(aaa);
4685 Py_XINCREF(trueSelf);
4689 { throw INTERP_KERNEL::Exception(msg); }
4693 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4695 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.";
4696 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4699 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4701 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4705 Py_XINCREF(trueSelf);
4709 throw INTERP_KERNEL::Exception(msg);
4714 DataArrayDoubleTuple *aa;
4715 std::vector<double> bb;
4717 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4722 if(!self->getArray())
4723 throw INTERP_KERNEL::Exception(msg2);
4724 self->getArray()->applyLin(1.,-val);
4725 Py_XINCREF(trueSelf);
4730 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4733 Py_XINCREF(trueSelf);
4738 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4739 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4740 ret2->setArray(aaa);
4742 Py_XINCREF(trueSelf);
4747 if(!self->getArray())
4748 throw INTERP_KERNEL::Exception(msg2);
4749 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4750 self->getArray()->substractEqual(aaa);
4751 Py_XINCREF(trueSelf);
4755 { throw INTERP_KERNEL::Exception(msg); }
4759 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4761 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.";
4762 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4765 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4767 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4771 Py_XINCREF(trueSelf);
4775 throw INTERP_KERNEL::Exception(msg);
4780 DataArrayDoubleTuple *aa;
4781 std::vector<double> bb;
4783 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4788 if(!self->getArray())
4789 throw INTERP_KERNEL::Exception(msg2);
4790 self->getArray()->applyLin(val,0);
4791 Py_XINCREF(trueSelf);
4796 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4799 Py_XINCREF(trueSelf);
4804 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4805 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4806 ret2->setArray(aaa);
4808 Py_XINCREF(trueSelf);
4813 if(!self->getArray())
4814 throw INTERP_KERNEL::Exception(msg2);
4815 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4816 self->getArray()->multiplyEqual(aaa);
4817 Py_XINCREF(trueSelf);
4821 { throw INTERP_KERNEL::Exception(msg); }
4825 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4827 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.";
4828 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4831 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4833 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4837 Py_XINCREF(trueSelf);
4841 throw INTERP_KERNEL::Exception(msg);
4846 DataArrayDoubleTuple *aa;
4847 std::vector<double> bb;
4849 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4855 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4856 if(!self->getArray())
4857 throw INTERP_KERNEL::Exception(msg2);
4858 self->getArray()->applyLin(1./val,0);
4859 Py_XINCREF(trueSelf);
4864 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4867 Py_XINCREF(trueSelf);
4872 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4873 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4874 ret2->setArray(aaa);
4876 Py_XINCREF(trueSelf);
4881 if(!self->getArray())
4882 throw INTERP_KERNEL::Exception(msg2);
4883 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4884 self->getArray()->divideEqual(aaa);
4885 Py_XINCREF(trueSelf);
4889 { throw INTERP_KERNEL::Exception(msg); }
4893 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4895 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.";
4896 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4899 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4901 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4905 Py_XINCREF(trueSelf);
4909 throw INTERP_KERNEL::Exception(msg);
4914 DataArrayDoubleTuple *aa;
4915 std::vector<double> bb;
4917 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4922 if(!self->getArray())
4923 throw INTERP_KERNEL::Exception(msg2);
4924 self->getArray()->applyPow(val);
4925 Py_XINCREF(trueSelf);
4930 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4933 Py_XINCREF(trueSelf);
4938 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4939 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4940 ret2->setArray(aaa);
4942 Py_XINCREF(trueSelf);
4947 if(!self->getArray())
4948 throw INTERP_KERNEL::Exception(msg2);
4949 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4950 self->getArray()->powEqual(aaa);
4951 Py_XINCREF(trueSelf);
4955 { throw INTERP_KERNEL::Exception(msg); }
4959 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4961 std::vector<const MEDCouplingFieldDouble *> tmp;
4962 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4963 return MEDCouplingFieldDouble::MergeFields(tmp);
4966 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4968 std::vector<const MEDCouplingFieldDouble *> tmp;
4969 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4970 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4973 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4975 std::vector<double> a0;
4976 std::vector<int> a1;
4977 std::vector<std::string> a2;
4978 self->getTinySerializationDbleInformation(a0);
4979 self->getTinySerializationIntInformation(a1);
4980 self->getTinySerializationStrInformation(a2);
4982 PyObject *ret(PyTuple_New(3));
4983 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4984 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
4986 PyObject *ret2(PyList_New(sz));
4988 for(int i=0;i<sz;i++)
4989 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
4991 PyTuple_SetItem(ret,2,ret2);
4995 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
4997 DataArrayInt *ret0(0);
4998 std::vector<DataArrayDouble *> ret1;
4999 self->serialize(ret0,ret1);
5002 std::size_t sz(ret1.size());
5003 PyObject *ret(PyTuple_New(2));
5004 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
5005 PyObject *ret1Py(PyList_New(sz));
5006 for(std::size_t i=0;i<sz;i++)
5010 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5012 PyTuple_SetItem(ret,1,ret1Py);
5016 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
5018 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
5019 if(!PyTuple_Check(args))
5020 throw INTERP_KERNEL::Exception(MSG);
5021 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
5022 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
5023 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
5025 PyObject *tmp0(PyTuple_New(1));
5026 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
5027 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
5029 Py_DECREF(selfMeth);
5030 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
5031 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
5032 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
5034 PyObject *a(PyInt_FromLong(0));
5035 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
5038 throw INTERP_KERNEL::Exception(MSG);
5039 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
5040 throw INTERP_KERNEL::Exception(MSG);
5041 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
5044 Py_DECREF(initMeth);
5049 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
5050 {// put an empty dict in input to say to __new__ to call __init__...
5051 self->checkConsistencyLight();
5052 PyObject *ret(PyTuple_New(1));
5053 PyObject *ret0(PyDict_New());
5055 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
5056 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
5057 PyDict_SetItem(ret0,a,d);
5058 Py_DECREF(a); Py_DECREF(d);
5060 PyTuple_SetItem(ret,0,ret0);
5064 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5066 self->checkConsistencyLight();
5067 PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
5068 PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
5069 const MEDCouplingMesh *mesh(self->getMesh());
5072 PyObject *ret(PyTuple_New(3));
5073 PyTuple_SetItem(ret,0,ret0);
5074 PyTuple_SetItem(ret,1,ret1);
5075 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
5079 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5081 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
5082 if(!PyTuple_Check(inp))
5083 throw INTERP_KERNEL::Exception(MSG);
5084 int sz(PyTuple_Size(inp));
5086 throw INTERP_KERNEL::Exception(MSG);
5088 PyObject *elt2(PyTuple_GetItem(inp,2));
5090 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
5091 if(!SWIG_IsOK(status))
5092 throw INTERP_KERNEL::Exception(MSG);
5093 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
5095 PyObject *elt0(PyTuple_GetItem(inp,0));
5096 PyObject *elt1(PyTuple_GetItem(inp,1));
5097 std::vector<double> a0;
5098 std::vector<int> a1;
5099 std::vector<std::string> a2;
5100 DataArrayInt *b0(0);
5101 std::vector<DataArrayDouble *>b1;
5103 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5104 throw INTERP_KERNEL::Exception(MSG);
5105 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5107 fillArrayWithPyListDbl3(a0py,tmp,a0);
5108 convertPyToNewIntArr3(a1py,a1);
5109 fillStringVector(a2py,a2);
5112 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5113 throw INTERP_KERNEL::Exception(MSG);
5114 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5116 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5117 if(!SWIG_IsOK(status))
5118 throw INTERP_KERNEL::Exception(MSG);
5119 b0=reinterpret_cast<DataArrayInt *>(argp);
5120 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5122 self->checkForUnserialization(a1,b0,b1);
5123 // useless here to call resizeForUnserialization because arrays are well resized.
5124 self->finishUnserialization(a1,a0,a2);
5129 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5132 int getNumberOfFields() const;
5133 MEDCouplingMultiFields *deepCopy() const;
5134 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5135 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5136 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5137 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5138 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5141 std::string __str__() const throw(INTERP_KERNEL::Exception)
5143 return self->simpleRepr();
5145 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5147 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5148 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5150 std::vector<MEDCouplingFieldDouble *> fs(sz);
5151 for(int i=0;i<sz;i++)
5152 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5153 return MEDCouplingMultiFields::New(fs);
5155 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5157 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5158 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5160 std::vector<MEDCouplingFieldDouble *> fs(sz);
5161 for(int i=0;i<sz;i++)
5162 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5163 return MEDCouplingMultiFields::New(fs);
5165 PyObject *getFields() const
5167 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5168 int sz=fields.size();
5169 PyObject *res = PyList_New(sz);
5170 for(int i=0;i<sz;i++)
5174 fields[i]->incrRef();
5175 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5179 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5184 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5186 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5190 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5193 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5195 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5197 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5199 PyObject *res = PyList_New(sz);
5200 for(int i=0;i<sz;i++)
5205 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5209 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5214 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5216 std::vector<int> refs;
5217 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5219 PyObject *res = PyList_New(sz);
5220 for(int i=0;i<sz;i++)
5225 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5229 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5233 PyObject *ret=PyTuple_New(2);
5234 PyTuple_SetItem(ret,0,res);
5235 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5238 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5240 std::vector<DataArrayDouble *> ms=self->getArrays();
5242 PyObject *res = PyList_New(sz);
5243 for(int i=0;i<sz;i++)
5248 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5252 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5257 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5259 std::vector< std::vector<int> > refs;
5260 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5262 PyObject *res = PyList_New(sz);
5263 PyObject *res2 = PyList_New(sz);
5264 for(int i=0;i<sz;i++)
5269 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5273 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5275 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5278 PyObject *ret=PyTuple_New(2);
5279 PyTuple_SetItem(ret,0,res);
5280 PyTuple_SetItem(ret,1,res2);
5286 class MEDCouplingFieldInt : public MEDCouplingField
5289 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5290 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5291 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5292 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5293 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5294 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5295 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5296 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5297 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5298 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5300 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5302 return MEDCouplingFieldInt::New(type,td);
5305 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5307 return MEDCouplingFieldInt::New(ft,td);
5310 std::string __str__() const throw(INTERP_KERNEL::Exception)
5312 return self->simpleRepr();
5315 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5317 std::ostringstream oss;
5318 self->reprQuickOverview(oss);
5322 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5324 DataArrayInt *ret=self->getArray();
5330 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5333 double tmp0=self->getTime(tmp1,tmp2);
5334 PyObject *res = PyList_New(3);
5335 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5336 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5337 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5343 class MEDCouplingDefinitionTime
5346 MEDCouplingDefinitionTime();
5347 void assign(const MEDCouplingDefinitionTime& other);
5348 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5349 double getTimeResolution() const;
5350 std::vector<double> getHotSpotsTime() const;
5353 std::string __str__() const throw(INTERP_KERNEL::Exception)
5355 std::ostringstream oss;
5356 self->appendRepr(oss);
5360 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5362 int meshId,arrId,arrIdInField,fieldId;
5363 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5364 PyObject *res=PyList_New(4);
5365 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5366 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5367 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5368 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5372 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5374 int meshId,arrId,arrIdInField,fieldId;
5375 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5376 PyObject *res=PyList_New(4);
5377 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5378 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5379 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5380 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5386 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5389 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5390 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5394 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5396 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5397 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5399 std::vector<MEDCouplingFieldDouble *> fs(sz);
5400 for(int i=0;i<sz;i++)
5401 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5402 return MEDCouplingFieldOverTime::New(fs);
5404 std::string __str__() const throw(INTERP_KERNEL::Exception)
5406 return self->simpleRepr();
5408 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5410 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5411 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5413 std::vector<MEDCouplingFieldDouble *> fs(sz);
5414 for(int i=0;i<sz;i++)
5415 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5416 return MEDCouplingFieldOverTime::New(fs);
5421 class MEDCouplingCartesianAMRMesh;
5423 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5426 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5427 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5428 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5431 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5433 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5441 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5444 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5445 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5446 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5449 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5451 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5452 return convertFromVectorPairInt(ret);
5455 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5457 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5458 return convertFromVectorPairInt(ret);
5461 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5463 std::vector< std::pair<int,int> > inp;
5464 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5465 self->addPatch(inp,factors);
5468 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5470 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5472 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5473 if(patchId==mesh->getNumberOfPatches())
5475 std::ostringstream oss;
5476 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5477 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5480 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5486 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5488 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5490 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5491 mesh->removePatch(patchId);
5494 int __len__() const throw(INTERP_KERNEL::Exception)
5496 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5498 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5499 return mesh->getNumberOfPatches();
5504 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5508 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5511 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5512 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5513 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5514 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5515 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5516 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5517 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5518 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5519 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5520 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5521 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5522 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5523 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5525 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5526 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5527 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5528 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5529 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5530 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5531 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5532 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5533 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5534 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5535 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5536 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5537 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5538 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5539 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5540 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5541 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5542 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5543 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5544 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5547 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5549 std::vector< std::pair<int,int> > inp;
5550 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5551 self->addPatch(inp,factors);
5554 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5556 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5558 PyObject *ret = PyList_New(sz);
5559 for(int i=0;i<sz;i++)
5561 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5564 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5569 // agy : don't know why typemap fails here ??? let it in the extend section
5570 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5572 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5575 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5577 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5578 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5584 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5586 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5587 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5593 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5595 std::vector<int> out1;
5596 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5597 PyObject *ret(PyTuple_New(2));
5598 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5599 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5603 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5605 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5607 PyObject *ret = PyList_New(sz);
5608 for(int i=0;i<sz;i++)
5609 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5613 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5615 std::vector<const DataArrayDouble *> inp;
5616 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5617 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5620 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5622 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5628 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5630 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5636 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5638 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5644 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5646 const MEDCouplingIMesh *ret(self->getImageMesh());
5649 return const_cast<MEDCouplingIMesh *>(ret);
5652 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5654 if(patchId==self->getNumberOfPatches())
5656 std::ostringstream oss;
5657 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5658 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5661 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5667 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5669 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5670 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5671 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5674 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5676 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5677 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5678 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5681 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5683 self->removePatch(patchId);
5686 int __len__() const throw(INTERP_KERNEL::Exception)
5688 return self->getNumberOfPatches();
5693 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5697 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5700 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5703 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5705 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5706 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5707 const int *nodeStrctPtr(0);
5708 const double *originPtr(0),*dxyzPtr(0);
5710 std::vector<int> bb0;
5711 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5714 std::vector<double> bb,bb2;
5716 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5717 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5719 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5722 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5724 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5725 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5726 std::vector< std::vector<int> > inp2;
5727 convertPyToVectorOfVectorOfInt(factors,inp2);
5728 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5731 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5733 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5736 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5738 return MEDCouplingCartesianAMRMesh::New(mesh);
5743 class MEDCouplingDataForGodFather : public RefCountObject
5746 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5747 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5748 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5749 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5750 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5751 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5752 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5753 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5754 virtual void alloc() throw(INTERP_KERNEL::Exception);
5755 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5758 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5760 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5768 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5771 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5772 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5773 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5774 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5775 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5776 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5777 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5778 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5779 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5782 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5784 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5785 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5786 MEDCouplingAMRAttribute *ret(0);
5789 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5790 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5792 catch(INTERP_KERNEL::Exception&)
5794 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5795 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5800 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5802 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5805 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5807 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5808 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5814 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5816 std::vector< std::vector<std::string> > compNamesCpp;
5817 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5818 self->spillInfoOnComponents(compNamesCpp);
5821 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5823 std::vector<int> inp0;
5824 if(!fillIntVector(nfs,inp0))
5825 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5826 std::size_t sz(inp0.size());
5827 std::vector<NatureOfField> inp00(sz);
5828 for(std::size_t i=0;i<sz;i++)
5829 inp00[i]=(NatureOfField)inp0[i];
5830 self->spillNatures(inp00);
5833 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5835 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5836 int sz((int)ret.size());
5837 PyObject *retPy(PyList_New(sz));
5838 for(int i=0;i<sz;i++)
5839 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5845 class DenseMatrix : public RefCountObject, public TimeLabel
5848 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5849 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5850 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5851 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5853 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5854 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5855 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5856 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5857 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5858 void transpose() throw(INTERP_KERNEL::Exception);
5860 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5861 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5862 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5865 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5867 return DenseMatrix::New(nbRows,nbCols);
5870 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5872 return DenseMatrix::New(array,nbRows,nbCols);
5875 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5878 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5879 PyObject *ret=PyTuple_New(2);
5880 PyObject *ret0Py=ret0?Py_True:Py_False;
5882 PyTuple_SetItem(ret,0,ret0Py);
5883 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5887 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5889 DataArrayDouble *ret(self->getData());
5895 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5897 return MEDCoupling::DenseMatrix::Add(self,other);
5900 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5902 return MEDCoupling::DenseMatrix::Substract(self,other);
5905 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5907 return MEDCoupling::DenseMatrix::Multiply(self,other);
5910 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5912 return MEDCoupling::DenseMatrix::Multiply(self,other);
5915 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5917 self->addEqual(other);
5918 Py_XINCREF(trueSelf);
5922 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5924 self->substractEqual(other);
5925 Py_XINCREF(trueSelf);
5929 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5931 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5938 class PartDefinition : public RefCountObject, public TimeLabel
5941 static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5942 static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5943 virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
5944 virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
5945 virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
5946 virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
5947 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5948 virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
5951 virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
5953 return (*self)+other;
5956 virtual PyObject *isEqual(const PartDefinition *other) const throw(INTERP_KERNEL::Exception)
5959 bool ret0(self->isEqual(other,ret1));
5960 PyObject *ret=PyTuple_New(2);
5961 PyObject *ret0Py=ret0?Py_True:Py_False;
5963 PyTuple_SetItem(ret,0,ret0Py);
5964 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5968 virtual PyObject *deepCopy() const throw(INTERP_KERNEL::Exception)
5970 return convertPartDefinition(self->deepCopy(),SWIG_POINTER_OWN | 0);
5974 virtual ~PartDefinition();
5977 class DataArrayPartDefinition : public PartDefinition
5980 static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5983 DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
5985 return DataArrayPartDefinition::New(listOfIds);
5988 std::string __str__() const throw(INTERP_KERNEL::Exception)
5990 return self->getRepr();
5993 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5995 std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
5996 oss << self->getRepr();
6001 virtual ~DataArrayPartDefinition();
6004 class SlicePartDefinition : public PartDefinition
6007 static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
6008 int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
6011 SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
6013 return SlicePartDefinition::New(start,stop,step);
6016 PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
6019 self->getSlice(a,b,c);
6020 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
6023 std::string __str__() const throw(INTERP_KERNEL::Exception)
6025 return self->getRepr();
6028 std::string __repr__() const throw(INTERP_KERNEL::Exception)
6030 std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
6031 oss << self->getRepr();
6036 virtual ~SlicePartDefinition();
6042 __filename=os.environ.get('PYTHONSTARTUP')
6043 if __filename and os.path.isfile(__filename):
6044 execfile(__filename)