1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #ifdef WITH_DOCSTRINGS
24 %include MEDCoupling_doc.i
31 #include "MEDCouplingMemArray.hxx"
32 #include "MEDCouplingUMesh.hxx"
33 #include "MEDCouplingMappedExtrudedMesh.hxx"
34 #include "MEDCouplingCMesh.hxx"
35 #include "MEDCouplingIMesh.hxx"
36 #include "MEDCouplingCurveLinearMesh.hxx"
37 #include "MEDCoupling1GTUMesh.hxx"
38 #include "MEDCouplingField.hxx"
39 #include "MEDCouplingFieldDouble.hxx"
40 #include "MEDCouplingFieldInt.hxx"
41 #include "MEDCouplingFieldTemplate.hxx"
42 #include "MEDCouplingGaussLocalization.hxx"
44 #include "MEDCouplingMultiFields.hxx"
45 #include "MEDCouplingFieldOverTime.hxx"
46 #include "MEDCouplingDefinitionTime.hxx"
47 #include "MEDCouplingFieldDiscretization.hxx"
48 #include "MEDCouplingCartesianAMRMesh.hxx"
49 #include "MEDCouplingAMRAttribute.hxx"
50 #include "MEDCouplingMatrix.hxx"
51 #include "MEDCouplingPartDefinition.hxx"
52 #include "MEDCouplingSkyLineArray.hxx"
53 #include "MEDCouplingTypemaps.i"
55 #include "InterpKernelAutoPtr.hxx"
56 #include "BoxSplittingOptions.hxx"
58 using namespace MEDCoupling;
59 using namespace INTERP_KERNEL;
63 %template(ivec) std::vector<int>;
64 %template(dvec) std::vector<double>;
65 %template(svec) std::vector<std::string>;
68 %typemap(out) MEDCoupling::MEDCouplingMesh*
70 $result=convertMesh($1,$owner);
73 %typemap(out) MEDCouplingMesh*
75 $result=convertMesh($1,$owner);
80 %typemap(out) MEDCoupling::MEDCouplingPointSet*
82 $result=convertMesh($1,$owner);
85 %typemap(out) MEDCouplingPointSet*
87 $result=convertMesh($1,$owner);
92 %typemap(out) MEDCouplingCartesianAMRPatchGen*
94 $result=convertCartesianAMRPatch($1,$owner);
99 %typemap(out) MEDCouplingCartesianAMRMeshGen*
101 $result=convertCartesianAMRMesh($1,$owner);
106 %typemap(out) MEDCouplingDataForGodFather*
108 $result=convertDataForGodFather($1,$owner);
113 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
115 $result=convertMesh($1,$owner);
118 %typemap(out) MEDCoupling1GTUMesh*
120 $result=convertMesh($1,$owner);
125 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
127 $result=convertMesh($1,$owner);
130 %typemap(out) MEDCouplingStructuredMesh*
132 $result=convertMesh($1,$owner);
137 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
139 $result=convertFieldDiscretization($1,$owner);
142 %typemap(out) MEDCouplingFieldDiscretization*
144 $result=convertFieldDiscretization($1,$owner);
149 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
151 $result=convertMultiFields($1,$owner);
154 %typemap(out) MEDCouplingMultiFields*
156 $result=convertMultiFields($1,$owner);
161 %typemap(out) MEDCoupling::PartDefinition*
163 $result=convertPartDefinition($1,$owner);
166 %typemap(out) PartDefinition*
168 $result=convertPartDefinition($1,$owner);
173 %init %{ import_array(); %}
176 %feature("autodoc", "1");
177 %feature("docstring");
179 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
180 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
181 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
182 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
183 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
184 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
185 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
186 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
187 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
188 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
189 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
190 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
191 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
192 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
193 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
194 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
195 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
196 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
197 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
198 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
199 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
200 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
201 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
202 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
203 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
204 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
205 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
206 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
207 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
208 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
209 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
210 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
211 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
212 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
213 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
214 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
215 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
216 %newobject MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear;
217 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
218 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
235 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
236 %newobject MEDCoupling::MEDCouplingFieldInt::New;
237 %newobject MEDCoupling::MEDCouplingFieldInt::convertToDblField;
238 %newobject MEDCoupling::MEDCouplingFieldInt::getArray;
239 %newobject MEDCoupling::MEDCouplingFieldInt::deepCopy;
240 %newobject MEDCoupling::MEDCouplingFieldInt::clone;
241 %newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh;
242 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
243 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
244 %newobject MEDCoupling::MEDCouplingMesh::clone;
245 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
246 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
247 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
248 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
249 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
250 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
251 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
252 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
253 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
254 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
255 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
256 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
257 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
258 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
259 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
260 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
261 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
262 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
263 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
264 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
265 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
266 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
267 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
268 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
269 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
270 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
271 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
272 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
273 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
274 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
275 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
276 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
277 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
278 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
279 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
280 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
281 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
282 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
283 %newobject MEDCoupling::MEDCouplingUMesh::New;
284 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
285 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
286 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
287 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
288 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
289 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
290 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
291 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
292 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
293 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
294 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
295 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
296 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
297 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
298 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
299 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
300 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
301 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
302 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
303 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
304 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
305 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
306 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
307 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
308 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
309 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
310 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
311 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
312 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
313 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
314 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
315 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
316 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
317 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
318 %newobject MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords;
319 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
320 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
321 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
322 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
323 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
324 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
325 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
326 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
327 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
328 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
329 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
330 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
331 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
332 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
333 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
334 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
335 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
336 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
337 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
338 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
339 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
340 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
341 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
342 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
343 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
344 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
345 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
346 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
347 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
348 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
349 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
350 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
351 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
352 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
353 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
354 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
355 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
356 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
357 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
358 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
359 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
360 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
361 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
362 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
363 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
364 %newobject MEDCoupling::MEDCouplingCMesh::New;
365 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
366 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
367 %newobject MEDCoupling::MEDCouplingIMesh::New;
368 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
369 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
370 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
371 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
372 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
373 %newobject MEDCoupling::MEDCouplingMultiFields::New;
374 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
375 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
376 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
377 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
378 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
379 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
380 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
381 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
382 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
383 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
384 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
385 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
386 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
387 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
388 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
389 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
390 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
391 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
392 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
393 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
394 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
395 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
396 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
397 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
398 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
399 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
400 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
401 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
402 %newobject MEDCoupling::DenseMatrix::New;
403 %newobject MEDCoupling::DenseMatrix::deepCopy;
404 %newobject MEDCoupling::DenseMatrix::shallowCpy;
405 %newobject MEDCoupling::DenseMatrix::getData;
406 %newobject MEDCoupling::DenseMatrix::matVecMult;
407 %newobject MEDCoupling::DenseMatrix::MatVecMult;
408 %newobject MEDCoupling::DenseMatrix::__add__;
409 %newobject MEDCoupling::DenseMatrix::__sub__;
410 %newobject MEDCoupling::DenseMatrix::__mul__;
411 %newobject MEDCoupling::PartDefinition::New;
412 %newobject MEDCoupling::PartDefinition::toDAI;
413 %newobject MEDCoupling::PartDefinition::__add__;
414 %newobject MEDCoupling::PartDefinition::composeWith;
415 %newobject MEDCoupling::PartDefinition::tryToSimplify;
416 %newobject MEDCoupling::DataArrayPartDefinition::New;
417 %newobject MEDCoupling::SlicePartDefinition::New;
418 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
419 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
421 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
422 %feature("unref") MEDCouplingMesh "$this->decrRef();"
423 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
424 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
425 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
426 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
427 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
428 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
429 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
430 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
431 %feature("unref") MEDCouplingField "$this->decrRef();"
432 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
433 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
434 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
435 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
436 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
437 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
438 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
439 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
440 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
441 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
442 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
443 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
444 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
445 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
446 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
447 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
448 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
449 %feature("unref") DenseMatrix "$this->decrRef();"
450 %feature("unref") PartDefinition "$this->decrRef();"
451 %feature("unref") DataArrayPartDefinition "$this->decrRef();"
452 %feature("unref") SlicePartDefinition "$this->decrRef();"
454 %rename(assign) *::operator=;
455 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
456 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
457 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
458 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
462 %rename (InterpKernelException) INTERP_KERNEL::Exception;
464 %include "MEDCouplingRefCountObject.i"
465 %include "MEDCouplingMemArray.i"
467 namespace INTERP_KERNEL
470 * \class BoxSplittingOptions
471 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
473 class BoxSplittingOptions
476 BoxSplittingOptions();
477 void init() throw(INTERP_KERNEL::Exception);
478 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
479 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
480 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
481 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
482 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
483 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
484 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
485 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
486 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
487 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
488 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
489 std::string printOptions() const throw(INTERP_KERNEL::Exception);
492 std::string __str__() const throw(INTERP_KERNEL::Exception)
494 return self->printOptions();
500 namespace MEDCoupling
516 CONST_ON_TIME_INTERVAL = 7
517 } TypeOfTimeDiscretization;
525 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
526 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
528 } MEDCouplingMeshType;
531 class DataArrayDouble;
532 class MEDCouplingUMesh;
533 class MEDCouplingCMesh;
534 class MEDCouplingFieldDouble;
536 %extend RefCountObject
538 std::string getHiddenCppPointer() const
540 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
545 %extend MEDCouplingGaussLocalization
547 std::string __str__() const throw(INTERP_KERNEL::Exception)
549 return self->getStringRepr();
552 std::string __repr__() const throw(INTERP_KERNEL::Exception)
554 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
555 oss << self->getStringRepr();
562 class MEDCouplingMesh : public RefCountObject, public TimeLabel
565 void setName(const std::string& name);
566 std::string getName() const;
567 void setDescription(const std::string& descr);
568 std::string getDescription() const;
569 void setTime(double val, int iteration, int order);
570 void setTimeUnit(const std::string& unit);
571 std::string getTimeUnit() const;
572 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
573 bool isStructured() const throw(INTERP_KERNEL::Exception);
574 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
575 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
576 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
577 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
578 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
579 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
580 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
581 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
582 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
583 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
584 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
585 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
586 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
587 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
588 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
589 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
590 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
591 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
592 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
593 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
594 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
595 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
596 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
597 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
598 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
599 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
600 virtual std::string getVTKFileExtension() const;
601 std::string getVTKFileNameOf(const std::string& fileName) const;
603 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
604 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
605 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
606 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
607 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
608 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
609 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
610 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
611 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
612 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
613 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);
614 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
615 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
616 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
617 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
618 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
619 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
620 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
623 std::string __str__() const throw(INTERP_KERNEL::Exception)
625 return self->simpleRepr();
628 PyObject *getTime() throw(INTERP_KERNEL::Exception)
631 double tmp0=self->getTime(tmp1,tmp2);
632 PyObject *res = PyList_New(3);
633 PyList_SetItem(res,0,SWIG_From_double(tmp0));
634 PyList_SetItem(res,1,SWIG_From_int(tmp1));
635 PyList_SetItem(res,2,SWIG_From_int(tmp2));
639 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
641 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
642 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
648 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
652 DataArrayDoubleTuple *aa;
653 std::vector<double> bb;
655 int spaceDim=self->getSpaceDimension();
656 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
657 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
658 return self->getCellContainingPoint(pos,eps);
661 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
665 DataArrayDoubleTuple *aa;
666 std::vector<double> bb;
668 int spaceDim=self->getSpaceDimension();
669 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
670 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
671 MCAuto<DataArrayInt> elts,eltsIndex;
672 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
673 PyObject *ret=PyTuple_New(2);
674 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
675 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
679 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
681 MCAuto<DataArrayInt> elts,eltsIndex;
682 int spaceDim=self->getSpaceDimension();
684 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
685 if (!SWIG_IsOK(res1))
688 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
689 int nbOfPoints=size/spaceDim;
692 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
694 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
698 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
700 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
701 da2->checkAllocated();
702 int size=da2->getNumberOfTuples();
703 int nbOfCompo=da2->getNumberOfComponents();
704 if(nbOfCompo!=spaceDim)
706 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
708 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
710 PyObject *ret=PyTuple_New(2);
711 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
712 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
716 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
720 DataArrayDoubleTuple *aa;
721 std::vector<double> bb;
723 int spaceDim=self->getSpaceDimension();
724 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
725 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
726 std::vector<int> elts;
727 self->getCellsContainingPoint(pos,eps,elts);
728 DataArrayInt *ret=DataArrayInt::New();
729 ret->alloc((int)elts.size(),1);
730 std::copy(elts.begin(),elts.end(),ret->getPointer());
731 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
734 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
736 MCAuto<DataArrayInt> d0=DataArrayInt::New();
737 MCAuto<DataArrayInt> d1=DataArrayInt::New();
738 self->getReverseNodalConnectivity(d0,d1);
739 PyObject *ret=PyTuple_New(2);
740 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
741 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
745 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
748 int v0; std::vector<int> v1;
749 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
750 self->renumberCells(ids,check);
753 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
755 DataArrayInt *cellCor, *nodeCor;
756 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
757 PyObject *res = PyList_New(2);
758 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
759 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
763 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
765 DataArrayInt *cellCor=0,*nodeCor=0;
766 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
767 PyObject *res = PyList_New(2);
768 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
769 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
773 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
775 DataArrayInt *cellCor=0;
776 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
780 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
783 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
784 if (!SWIG_IsOK(res1))
787 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
788 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
792 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
794 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
795 da2->checkAllocated();
796 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
799 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
801 std::vector<int> conn;
802 self->getNodeIdsOfCell(cellId,conn);
803 return convertIntArrToPyList2(conn);
806 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
808 std::vector<double> coo;
809 self->getCoordinatesOfNode(nodeId,coo);
810 return convertDblArrToPyList2(coo);
813 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
817 DataArrayDoubleTuple *aa;
818 std::vector<double> bb;
820 int spaceDim=self->getSpaceDimension();
821 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
822 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
823 self->scale(pointPtr,factor);
826 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
828 int spaceDim=self->getSpaceDimension();
829 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
830 self->getBoundingBox(tmp);
831 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
835 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
838 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
839 PyObject *ret=PyTuple_New(2);
840 PyObject *ret0Py=ret0?Py_True:Py_False;
842 PyTuple_SetItem(ret,0,ret0Py);
843 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
847 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
849 int szArr,sw,iTypppArr;
850 std::vector<int> stdvecTyyppArr;
851 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
852 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
853 if(sw==3)//DataArrayInt
855 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
856 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
857 std::string name=argpt->getName();
859 ret->setName(name.c_str());
861 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
864 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
866 int szArr,sw,iTypppArr;
867 std::vector<int> stdvecTyyppArr;
869 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
870 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
871 if(sw==3)//DataArrayInt
873 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
874 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
875 std::string name=argpt->getName();
877 ret->setName(name.c_str());
880 PyObject *res = PyList_New(2);
881 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
882 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
883 PyList_SetItem(res,0,obj0);
884 PyList_SetItem(res,1,obj1);
888 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
892 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
893 PyObject *res = PyTuple_New(2);
894 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
897 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
899 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
900 PyTuple_SetItem(res,0,obj0);
901 PyTuple_SetItem(res,1,obj1);
905 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
907 std::vector<int> vals=self->getDistributionOfTypes();
909 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
910 PyObject *ret=PyList_New((int)vals.size()/3);
911 for(int j=0;j<(int)vals.size()/3;j++)
913 PyObject *ret1=PyList_New(3);
914 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
915 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
916 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
917 PyList_SetItem(ret,j,ret1);
922 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
924 std::vector<int> code;
925 std::vector<const DataArrayInt *> idsPerType;
926 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
927 convertPyToNewIntArr4(li,1,3,code);
928 return self->checkTypeConsistencyAndContig(code,idsPerType);
931 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
933 std::vector<int> code;
934 std::vector<DataArrayInt *> idsInPflPerType;
935 std::vector<DataArrayInt *> idsPerType;
936 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
937 PyObject *ret=PyTuple_New(3);
940 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
941 PyObject *ret0=PyList_New((int)code.size()/3);
942 for(int j=0;j<(int)code.size()/3;j++)
944 PyObject *ret00=PyList_New(3);
945 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
946 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
947 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
948 PyList_SetItem(ret0,j,ret00);
950 PyTuple_SetItem(ret,0,ret0);
952 PyObject *ret1=PyList_New(idsInPflPerType.size());
953 for(std::size_t j=0;j<idsInPflPerType.size();j++)
954 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
955 PyTuple_SetItem(ret,1,ret1);
956 int n=idsPerType.size();
957 PyObject *ret2=PyList_New(n);
959 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
960 PyTuple_SetItem(ret,2,ret2);
964 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
968 DataArrayDoubleTuple *aa;
969 std::vector<double> bb;
971 int spaceDim=self->getSpaceDimension();
972 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
973 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
974 self->translate(vectorPtr);
977 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
979 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
982 DataArrayDoubleTuple *aa;
983 std::vector<double> bb;
985 int spaceDim=self->getSpaceDimension();
986 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
987 self->rotate(centerPtr,0,alpha);
990 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
992 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
994 DataArrayDouble *a,*a2;
995 DataArrayDoubleTuple *aa,*aa2;
996 std::vector<double> bb,bb2;
998 int spaceDim=self->getSpaceDimension();
999 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1000 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
1001 self->rotate(centerPtr,vectorPtr,alpha);
1004 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1006 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1007 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1008 PyObject *res=PyList_New(result.size());
1009 for(int i=0;iL!=result.end(); i++, iL++)
1010 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1014 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
1016 std::vector<double> a0;
1017 std::vector<int> a1;
1018 std::vector<std::string> a2;
1019 self->getTinySerializationInformation(a0,a1,a2);
1020 PyObject *ret(PyTuple_New(3));
1021 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1022 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1024 PyObject *ret2(PyList_New(sz));
1026 for(int i=0;i<sz;i++)
1027 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1029 PyTuple_SetItem(ret,2,ret2);
1033 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1035 DataArrayInt *a0Tmp(0);
1036 DataArrayDouble *a1Tmp(0);
1037 self->serialize(a0Tmp,a1Tmp);
1038 PyObject *ret(PyTuple_New(2));
1039 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1040 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1044 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1046 std::vector<std::string> littleStrings;
1047 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1050 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1051 {// put an empty dict in input to say to __new__ to call __init__...
1052 PyObject *ret(PyTuple_New(1));
1053 PyObject *ret0(PyDict_New());
1054 PyTuple_SetItem(ret,0,ret0);
1058 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1060 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1061 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1062 PyObject *ret(PyTuple_New(2));
1063 PyTuple_SetItem(ret,0,ret0);
1064 PyTuple_SetItem(ret,1,ret1);
1068 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1070 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1071 if(!PyTuple_Check(inp))
1072 throw INTERP_KERNEL::Exception(MSG);
1073 int sz(PyTuple_Size(inp));
1075 throw INTERP_KERNEL::Exception(MSG);
1076 PyObject *elt0(PyTuple_GetItem(inp,0));
1077 PyObject *elt1(PyTuple_GetItem(inp,1));
1078 std::vector<double> a0;
1079 std::vector<int> a1;
1080 std::vector<std::string> a2;
1081 DataArrayInt *b0(0);
1082 DataArrayDouble *b1(0);
1084 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1085 throw INTERP_KERNEL::Exception(MSG);
1086 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1088 fillArrayWithPyListDbl3(a0py,tmp,a0);
1089 convertPyToNewIntArr3(a1py,a1);
1090 fillStringVector(a2py,a2);
1093 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1094 throw INTERP_KERNEL::Exception(MSG);
1095 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1097 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1098 if(!SWIG_IsOK(status))
1099 throw INTERP_KERNEL::Exception(MSG);
1100 b0=reinterpret_cast<DataArrayInt *>(argp);
1101 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1102 if(!SWIG_IsOK(status))
1103 throw INTERP_KERNEL::Exception(MSG);
1104 b1=reinterpret_cast<DataArrayDouble *>(argp);
1106 // useless here to call resizeForUnserialization because arrays are well resized.
1107 self->unserialization(a0,a1,b0,b1,a2);
1110 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1112 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1113 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1114 return MEDCouplingMesh::MergeMeshes(tmp);
1120 //== MEDCouplingMesh End
1122 %include "NormalizedGeometricTypes"
1123 %include "MEDCouplingNatureOfFieldEnum"
1125 namespace MEDCoupling
1127 class MEDCouplingNatureOfField
1130 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1131 static std::string GetReprNoThrow(NatureOfField nat);
1132 static std::string GetAllPossibilitiesStr();
1136 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1137 // include "MEDCouplingTimeDiscretization.i"
1139 namespace MEDCoupling
1141 class MEDCouplingGaussLocalization
1144 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1145 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1146 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1147 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1148 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1149 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1150 int getDimension() const throw(INTERP_KERNEL::Exception);
1151 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1152 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1153 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1154 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1156 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1157 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1158 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1159 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1160 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1161 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1162 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1163 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1164 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1165 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1166 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1167 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1169 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1173 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const throw(INTERP_KERNEL::Exception)
1175 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1179 MEDCouplingUMesh *buildRefCell() const throw(INTERP_KERNEL::Exception)
1181 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1187 class MEDCouplingSkyLineArray
1190 MEDCouplingSkyLineArray();
1191 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray &myArray );
1192 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value );
1193 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value );
1195 void set( DataArrayInt* index, DataArrayInt* value );
1196 int getNumberOf() const;
1197 int getLength() const;
1198 DataArrayInt* getIndexArray() const;
1199 DataArrayInt* getValueArray() const;
1202 std::string __str__() const throw(INTERP_KERNEL::Exception)
1204 return self->simpleRepr();
1210 %include "MEDCouplingFieldDiscretization.i"
1212 //== MEDCouplingPointSet
1214 namespace MEDCoupling
1216 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1219 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1220 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1221 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1222 void zipCoords() throw(INTERP_KERNEL::Exception);
1223 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1224 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1225 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1226 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1227 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1228 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1229 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1230 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1231 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1232 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1233 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1234 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1235 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1236 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1237 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1238 virtual DataArrayInt *findBoundaryNodes() const;
1239 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1240 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1241 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1242 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1243 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1244 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1245 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1246 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1247 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1250 std::string __str__() const throw(INTERP_KERNEL::Exception)
1252 return self->simpleRepr();
1255 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1258 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1259 PyObject *res = PyList_New(2);
1260 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1261 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1265 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1267 DataArrayInt *comm, *commIndex;
1268 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1269 PyObject *res = PyList_New(2);
1270 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1271 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1275 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1277 DataArrayDouble *ret1=self->getCoords();
1280 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1283 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1285 int szArr,sw,iTypppArr;
1286 std::vector<int> stdvecTyyppArr;
1287 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1288 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1289 if(sw==3)//DataArrayInt
1291 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1292 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1293 std::string name=argpt->getName();
1295 ret->setName(name.c_str());
1297 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1300 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1302 int szArr,sw,iTypppArr;
1303 std::vector<int> stdvecTyyppArr;
1304 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1305 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1306 if(sw==3)//DataArrayInt
1308 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1309 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1310 std::string name=argpt->getName();
1312 ret->setName(name.c_str());
1314 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1317 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1319 int szArr,sw,iTypppArr;
1320 std::vector<int> stdvecTyyppArr;
1321 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1322 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1323 if(sw==3)//DataArrayInt
1325 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1326 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1327 std::string name=argpt->getName();
1329 ret->setName(name.c_str());
1331 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1334 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1336 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1337 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1340 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1342 int szArr,sw,iTypppArr;
1343 std::vector<int> stdvecTyyppArr;
1344 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1345 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1346 if(sw==3)//DataArrayInt
1348 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1349 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1350 std::string name=argpt->getName();
1352 ret->setName(name.c_str());
1354 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1357 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1359 int szArr,sw,iTypppArr;
1360 std::vector<int> stdvecTyyppArr;
1361 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1362 self->renumberNodes(tmp,newNbOfNodes);
1365 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1367 int szArr,sw,iTypppArr;
1368 std::vector<int> stdvecTyyppArr;
1369 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1370 self->renumberNodesCenter(tmp,newNbOfNodes);
1373 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1375 int spaceDim=self->getSpaceDimension();
1377 DataArrayDouble *a,*a2;
1378 DataArrayDoubleTuple *aa,*aa2;
1379 std::vector<double> bb,bb2;
1381 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1382 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1383 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1384 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1385 std::vector<int> nodes;
1386 self->findNodesOnLine(p,v,eps,nodes);
1387 DataArrayInt *ret=DataArrayInt::New();
1388 ret->alloc((int)nodes.size(),1);
1389 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1390 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1392 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1394 int spaceDim=self->getSpaceDimension();
1396 DataArrayDouble *a,*a2;
1397 DataArrayDoubleTuple *aa,*aa2;
1398 std::vector<double> bb,bb2;
1400 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1401 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1402 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1403 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1404 std::vector<int> nodes;
1405 self->findNodesOnPlane(p,v,eps,nodes);
1406 DataArrayInt *ret=DataArrayInt::New();
1407 ret->alloc((int)nodes.size(),1);
1408 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1409 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1412 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1416 DataArrayDoubleTuple *aa;
1417 std::vector<double> bb;
1419 int spaceDim=self->getSpaceDimension();
1420 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1421 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1422 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1423 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1426 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1428 DataArrayInt *c=0,*cI=0;
1432 DataArrayDoubleTuple *aa;
1433 std::vector<double> bb;
1435 int spaceDim=self->getSpaceDimension();
1436 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1437 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1438 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1439 PyObject *ret=PyTuple_New(2);
1440 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1441 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1445 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1447 DataArrayInt *c=0,*cI=0;
1448 int spaceDim=self->getSpaceDimension();
1451 DataArrayDoubleTuple *aa;
1452 std::vector<double> bb;
1455 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1456 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1458 PyObject *ret=PyTuple_New(2);
1459 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1460 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1464 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1468 DataArrayDoubleTuple *aa;
1469 std::vector<double> bb;
1471 int spaceDim=self->getSpaceDimension();
1472 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1473 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1475 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1476 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1479 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1483 std::vector<int> multiVal;
1484 std::pair<int, std::pair<int,int> > slic;
1485 MEDCoupling::DataArrayInt *daIntTyypp=0;
1486 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1490 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1492 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1494 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1496 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1500 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1502 DataArrayInt *v0=0,*v1=0;
1503 self->findCommonCells(compType,startCellId,v0,v1);
1504 PyObject *res = PyList_New(2);
1505 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1506 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1511 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1514 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1515 if (!SWIG_IsOK(res1))
1518 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1519 self->renumberNodesInConn(tmp);
1523 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1525 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1526 da2->checkAllocated();
1527 self->renumberNodesInConn(da2->getConstPointer());
1531 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1534 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1535 PyObject *ret=PyTuple_New(2);
1536 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1537 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1541 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1543 DataArrayInt *ret=0;
1545 int szArr,sw,iTypppArr;
1546 std::vector<int> stdvecTyyppArr;
1547 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1548 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1552 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1556 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1557 PyObject *res = PyList_New(3);
1558 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1559 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1560 PyList_SetItem(res,2,SWIG_From_int(ret2));
1564 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1568 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1569 PyObject *res = PyList_New(3);
1570 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1571 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1572 PyList_SetItem(res,2,SWIG_From_int(ret2));
1576 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1579 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1580 if (!SWIG_IsOK(res1))
1583 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1584 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1588 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1590 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1591 da2->checkAllocated();
1592 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1596 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1600 std::vector<int> multiVal;
1601 std::pair<int, std::pair<int,int> > slic;
1602 MEDCoupling::DataArrayInt *daIntTyypp=0;
1603 int nbc=self->getNumberOfCells();
1604 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1611 std::ostringstream oss;
1612 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1613 throw INTERP_KERNEL::Exception(oss.str().c_str());
1616 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1621 int tmp=nbc+singleVal;
1622 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1626 std::ostringstream oss;
1627 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1628 throw INTERP_KERNEL::Exception(oss.str().c_str());
1634 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1638 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1643 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1644 daIntTyypp->checkAllocated();
1645 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1648 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1652 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1655 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1656 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1657 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1658 for(int i=0;i<sz;i++)
1659 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1662 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1665 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1667 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1668 std::vector<double> val3;
1669 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1670 "Rotate2DAlg",2,true,nbNodes);
1672 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1673 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1676 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1679 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1680 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1681 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1682 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1683 for(int i=0;i<sz;i++)
1684 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1687 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1690 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1692 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1693 std::vector<double> val3;
1694 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1695 "Rotate3DAlg",3,true,nbNodes);
1697 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1698 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1699 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1704 //== MEDCouplingPointSet End
1706 class MEDCouplingUMeshCell
1709 INTERP_KERNEL::NormalizedCellType getType() const;
1712 std::string __str__() const throw(INTERP_KERNEL::Exception)
1714 return self->repr();
1717 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1720 const int *r=self->getAllConn(ret2);
1721 PyObject *ret=PyTuple_New(ret2);
1722 for(int i=0;i<ret2;i++)
1723 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1729 class MEDCouplingUMeshCellIterator
1736 MEDCouplingUMeshCell *ret=self->nextt();
1738 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1741 PyErr_SetString(PyExc_StopIteration,"No more data.");
1748 class MEDCouplingUMeshCellByTypeIterator
1751 ~MEDCouplingUMeshCellByTypeIterator();
1756 MEDCouplingUMeshCellEntry *ret=self->nextt();
1758 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1761 PyErr_SetString(PyExc_StopIteration,"No more data.");
1768 class MEDCouplingUMeshCellByTypeEntry
1771 ~MEDCouplingUMeshCellByTypeEntry();
1774 MEDCouplingUMeshCellByTypeIterator *__iter__()
1776 return self->iterator();
1781 class MEDCouplingUMeshCellEntry
1784 INTERP_KERNEL::NormalizedCellType getType() const;
1785 int getNumberOfElems() const;
1788 MEDCouplingUMeshCellIterator *__iter__()
1790 return self->iterator();
1795 //== MEDCouplingUMesh
1797 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1800 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1801 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1802 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1803 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1804 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1805 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1806 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1807 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1808 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1809 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1810 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1811 void computeTypes() throw(INTERP_KERNEL::Exception);
1812 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1813 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1815 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1816 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1817 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1818 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1819 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1820 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1821 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1822 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1823 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1824 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1825 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1826 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1827 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1828 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1829 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1830 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1831 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1832 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1833 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1834 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1835 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1836 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1837 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1838 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1839 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1840 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1841 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1842 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1843 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1844 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1845 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1846 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1847 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1848 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1849 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1850 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1851 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1852 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1853 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1854 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1855 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1856 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1857 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1858 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1859 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1860 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);
1861 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1862 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1863 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1864 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1865 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1867 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1869 return MEDCouplingUMesh::New();
1872 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1874 return MEDCouplingUMesh::New(meshName,meshDim);
1878 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1880 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1883 std::string __str__() const throw(INTERP_KERNEL::Exception)
1885 return self->simpleRepr();
1888 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1890 std::ostringstream oss;
1891 self->reprQuickOverview(oss);
1895 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1897 return self->cellIterator();
1900 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
1902 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
1906 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1908 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1909 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1910 PyObject *res=PyList_New(result.size());
1911 for(int i=0;iL!=result.end(); i++, iL++)
1912 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1916 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1920 std::vector<int> multiVal;
1921 std::pair<int, std::pair<int,int> > slic;
1922 MEDCoupling::DataArrayInt *daIntTyypp=0;
1923 int nbc=self->getNumberOfCells();
1924 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1931 std::ostringstream oss;
1932 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1933 throw INTERP_KERNEL::Exception(oss.str().c_str());
1937 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1944 int tmp=nbc+singleVal;
1945 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1950 std::ostringstream oss;
1951 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1952 throw INTERP_KERNEL::Exception(oss.str().c_str());
1958 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1964 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1965 daIntTyypp->checkAllocated();
1966 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1970 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1974 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1978 std::vector<int> multiVal;
1979 std::pair<int, std::pair<int,int> > slic;
1980 MEDCoupling::DataArrayInt *daIntTyypp=0;
1981 int nbc=self->getNumberOfCells();
1982 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1989 std::ostringstream oss;
1990 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1991 throw INTERP_KERNEL::Exception(oss.str().c_str());
1995 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2002 int tmp=nbc+singleVal;
2003 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2008 std::ostringstream oss;
2009 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2010 throw INTERP_KERNEL::Exception(oss.str().c_str());
2016 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2021 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2027 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2028 daIntTyypp->checkAllocated();
2029 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2033 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2037 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2039 int szArr,sw,iTypppArr;
2040 std::vector<int> stdvecTyyppArr;
2041 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2044 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2045 throw INTERP_KERNEL::Exception(oss.str().c_str());
2047 self->insertNextCell(type,size,tmp);
2050 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2052 int szArr,sw,iTypppArr;
2053 std::vector<int> stdvecTyyppArr;
2054 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2055 self->insertNextCell(type,szArr,tmp);
2058 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2060 DataArrayInt *ret=self->getNodalConnectivity();
2065 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2067 DataArrayInt *ret=self->getNodalConnectivityIndex();
2073 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2075 int szArr,sw,iTypppArr;
2076 std::vector<int> stdvecTyyppArr;
2077 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2078 int nbOfDepthPeelingPerformed=0;
2079 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2080 PyObject *res=PyTuple_New(2);
2081 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2082 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2086 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2088 DataArrayInt *v0=0,*v1=0;
2089 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2090 PyObject *res = PyList_New(2);
2091 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2092 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2096 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2100 DataArrayDoubleTuple *aa;
2101 std::vector<double> bb;
2103 int nbOfCompo=self->getSpaceDimension();
2104 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2107 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2108 PyObject *ret=PyTuple_New(2);
2109 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2110 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2114 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2116 DataArrayInt *ret1=0;
2117 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2118 PyObject *ret=PyTuple_New(2);
2119 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2120 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2124 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2127 DataArrayInt *ret1(0);
2128 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2129 PyObject *ret=PyTuple_New(3);
2130 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2131 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2132 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2136 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2138 std::vector<int> cells;
2139 self->checkButterflyCells(cells,eps);
2140 DataArrayInt *ret=DataArrayInt::New();
2141 ret->alloc((int)cells.size(),1);
2142 std::copy(cells.begin(),cells.end(),ret->getPointer());
2143 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2146 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2148 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2150 PyObject *ret = PyList_New(sz);
2151 for(int i=0;i<sz;i++)
2152 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2156 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2158 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2159 int sz=retCpp.size();
2160 PyObject *ret=PyList_New(sz);
2161 for(int i=0;i<sz;i++)
2162 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2166 static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2168 std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2169 int sz=retCpp.size();
2170 PyObject *ret=PyList_New(sz);
2171 for(int i=0;i<sz;i++)
2172 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2176 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2179 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2180 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2181 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2184 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2187 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2188 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2192 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2195 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2196 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2200 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2202 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2203 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2204 PyObject *ret=PyTuple_New(3);
2205 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2206 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2207 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2211 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2213 DataArrayInt *tmp0=0,*tmp1=0;
2214 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2215 PyObject *ret=PyTuple_New(2);
2216 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2217 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2221 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2225 std::vector<int> multiVal;
2226 std::pair<int, std::pair<int,int> > slic;
2227 MEDCoupling::DataArrayInt *daIntTyypp=0;
2228 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2232 return self->duplicateNodes(&singleVal,&singleVal+1);
2234 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2236 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2238 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2242 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2246 std::vector<int> multiVal;
2247 std::pair<int, std::pair<int,int> > slic;
2248 MEDCoupling::DataArrayInt *daIntTyypp=0;
2249 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2253 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2255 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2257 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2259 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2263 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2266 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2267 DataArrayInt *tmp0,*tmp1=0;
2268 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2269 PyObject *ret=PyTuple_New(2);
2270 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2271 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2275 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2277 DataArrayInt *ret0=0,*ret1=0;
2278 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2279 PyObject *ret=PyTuple_New(2);
2280 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2281 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2285 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2287 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2288 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2289 DataArrayInt *ret1=0,*ret2=0;
2290 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2291 PyObject *ret=PyTuple_New(3);
2292 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2293 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2294 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2298 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2300 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2301 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2302 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2303 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2306 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2309 std::vector<const MEDCouplingUMesh *> meshes;
2310 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2311 std::vector<DataArrayInt *> corr;
2312 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2314 PyObject *ret1=PyList_New(sz);
2315 for(int i=0;i<sz;i++)
2316 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2317 PyObject *ret=PyList_New(2);
2318 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2319 PyList_SetItem(ret,1,ret1);
2323 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2325 std::vector<MEDCouplingUMesh *> meshes;
2326 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2327 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2330 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2332 std::vector<MEDCouplingUMesh *> meshes;
2333 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2334 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2337 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2341 std::vector<int> multiVal;
2342 std::pair<int, std::pair<int,int> > slic;
2343 MEDCoupling::DataArrayInt *daIntTyypp=0;
2345 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2346 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2350 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2352 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2354 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2356 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2360 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2362 DataArrayInt *arrOut=0,*arrIndexOut=0;
2365 std::vector<int> multiVal;
2366 std::pair<int, std::pair<int,int> > slic;
2367 MEDCoupling::DataArrayInt *daIntTyypp=0;
2369 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2370 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2375 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2380 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2385 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2389 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2391 PyObject *ret=PyTuple_New(2);
2392 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2393 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2397 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2399 DataArrayInt *arrOut=0,*arrIndexOut=0;
2400 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2401 PyObject *ret=PyTuple_New(2);
2402 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2403 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2407 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2409 if(!PySlice_Check(slic))
2410 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2411 Py_ssize_t strt=2,stp=2,step=2;
2412 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2414 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2415 arrIndxIn->checkAllocated();
2416 if(arrIndxIn->getNumberOfComponents()!=1)
2417 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2418 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2419 DataArrayInt *arrOut=0,*arrIndexOut=0;
2420 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2421 PyObject *ret=PyTuple_New(2);
2422 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2423 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2427 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2428 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2429 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2431 DataArrayInt *arrOut=0,*arrIndexOut=0;
2434 std::vector<int> multiVal;
2435 std::pair<int, std::pair<int,int> > slic;
2436 MEDCoupling::DataArrayInt *daIntTyypp=0;
2438 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2439 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2444 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2449 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2454 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2458 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2460 PyObject *ret=PyTuple_New(2);
2461 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2462 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2466 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2467 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2471 std::vector<int> multiVal;
2472 std::pair<int, std::pair<int,int> > slic;
2473 MEDCoupling::DataArrayInt *daIntTyypp=0;
2475 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2476 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2481 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2486 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2491 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2495 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2499 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2503 DataArrayDoubleTuple *aa;
2504 std::vector<double> bb;
2506 int spaceDim=self->getSpaceDimension();
2507 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2508 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2510 std::vector<int> cells;
2511 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2512 DataArrayInt *ret=DataArrayInt::New();
2513 ret->alloc((int)cells.size(),1);
2514 std::copy(cells.begin(),cells.end(),ret->getPointer());
2515 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2518 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2522 DataArrayDoubleTuple *aa;
2523 std::vector<double> bb;
2525 int spaceDim=self->getSpaceDimension();
2526 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2527 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2528 self->orientCorrectly2DCells(v,polyOnly);
2531 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2533 std::vector<int> cells;
2534 self->arePolyhedronsNotCorrectlyOriented(cells);
2535 DataArrayInt *ret=DataArrayInt::New();
2536 ret->alloc((int)cells.size(),1);
2537 std::copy(cells.begin(),cells.end(),ret->getPointer());
2538 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2541 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2545 self->getFastAveragePlaneOfThis(vec,pos);
2547 std::copy(vec,vec+3,vals);
2548 std::copy(pos,pos+3,vals+3);
2549 return convertDblArrToPyListOfTuple(vals,3,2);
2552 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2554 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2555 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2556 return MEDCouplingUMesh::MergeUMeshes(tmp);
2559 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2562 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2563 PyObject *ret=PyTuple_New(2);
2564 PyObject *ret0Py=ret0?Py_True:Py_False;
2566 PyTuple_SetItem(ret,0,ret0Py);
2567 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2571 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2574 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2575 PyObject *ret=PyTuple_New(2);
2576 PyObject *ret0Py=ret0?Py_True:Py_False;
2578 PyTuple_SetItem(ret,0,ret0Py);
2579 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2583 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2585 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2586 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2587 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2588 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2589 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2590 PyObject *ret=PyTuple_New(5);
2591 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2592 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2593 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2594 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2595 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2599 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2601 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2602 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2603 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2604 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2605 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2606 PyObject *ret=PyTuple_New(5);
2607 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2608 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2609 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2610 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2611 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2615 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2617 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2618 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2619 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2620 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2621 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2622 PyObject *ret=PyTuple_New(5);
2623 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2624 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2625 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2626 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2627 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2631 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2633 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2634 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2635 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2636 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2637 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2638 PyObject *ret=PyTuple_New(5);
2639 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2640 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2641 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2642 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2643 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2647 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2649 DataArrayInt *neighbors=0,*neighborsIdx=0;
2650 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2651 PyObject *ret=PyTuple_New(2);
2652 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2653 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2657 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2659 DataArrayInt *neighbors=0,*neighborsIdx=0;
2660 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2661 PyObject *ret=PyTuple_New(2);
2662 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2663 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2667 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const throw(INTERP_KERNEL::Exception)
2669 MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
2670 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2671 PyObject *ret=PyTuple_New(2);
2672 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2673 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2677 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2679 DataArrayInt *neighbors=0,*neighborsIdx=0;
2680 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2681 PyObject *ret=PyTuple_New(2);
2682 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2683 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2687 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2689 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2690 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2691 DataArrayInt *d2,*d3,*d4,*dd5;
2692 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2693 PyObject *ret=PyTuple_New(7);
2694 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2695 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2696 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2697 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2698 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2699 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2700 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2704 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2707 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2708 da->checkAllocated();
2709 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2712 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2715 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2716 da->checkAllocated();
2717 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2720 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2723 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2724 da->checkAllocated();
2725 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2728 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2731 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2732 da->checkAllocated();
2733 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2734 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2735 PyObject *res = PyList_New(result.size());
2736 for (int i=0;iL!=result.end(); i++, iL++)
2737 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2741 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2744 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2745 da->checkAllocated();
2746 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2747 ret->setName(da->getName().c_str());
2751 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2753 DataArrayInt *cellNb1=0,*cellNb2=0;
2754 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2755 PyObject *ret=PyTuple_New(3);
2756 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2757 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2758 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2762 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2764 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2765 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2766 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2767 PyObject *ret(PyTuple_New(4));
2768 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2769 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2770 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2771 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2775 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2777 int spaceDim=self->getSpaceDimension();
2779 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2781 DataArrayDouble *a,*a2;
2782 DataArrayDoubleTuple *aa,*aa2;
2783 std::vector<double> bb,bb2;
2785 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2786 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2787 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2788 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2790 DataArrayInt *cellIds=0;
2791 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2792 PyObject *ret=PyTuple_New(2);
2793 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2794 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2798 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2800 int spaceDim=self->getSpaceDimension();
2802 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2804 DataArrayDouble *a,*a2;
2805 DataArrayDoubleTuple *aa,*aa2;
2806 std::vector<double> bb,bb2;
2808 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2809 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2810 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2811 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2813 DataArrayInt *cellIds=0;
2814 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2815 PyObject *ret=PyTuple_New(2);
2816 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2817 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2821 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2824 DataArrayDouble *a,*a2;
2825 DataArrayDoubleTuple *aa,*aa2;
2826 std::vector<double> bb,bb2;
2828 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st paramater for origin.";
2829 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd paramater for vector.";
2830 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2831 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2832 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2836 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2838 int spaceDim=self->getSpaceDimension();
2840 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2842 DataArrayDouble *a,*a2;
2843 DataArrayDoubleTuple *aa,*aa2;
2844 std::vector<double> bb,bb2;
2846 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2847 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2848 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2849 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2850 return self->getCellIdsCrossingPlane(orig,vect,eps);
2853 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2857 std::vector<int> pos2;
2858 DataArrayInt *pos3=0;
2859 DataArrayIntTuple *pos4=0;
2860 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2865 self->convertToPolyTypes(&pos1,&pos1+1);
2872 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2877 self->convertToPolyTypes(pos3->begin(),pos3->end());
2881 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2885 void convertAllToPoly();
2886 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2887 bool unPolyze() throw(INTERP_KERNEL::Exception);
2888 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2889 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2890 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2893 //== MEDCouplingUMesh End
2895 //== MEDCouplingMappedExtrudedMesh
2897 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
2900 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2901 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
2902 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2903 int get2DCellIdForExtrusion() const;
2905 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2907 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2910 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
2912 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
2915 MEDCouplingMappedExtrudedMesh()
2917 return MEDCouplingMappedExtrudedMesh::New();
2920 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2922 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
2925 std::string __str__() const throw(INTERP_KERNEL::Exception)
2927 return self->simpleRepr();
2930 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2932 std::ostringstream oss;
2933 self->reprQuickOverview(oss);
2937 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2939 MEDCouplingUMesh *ret=self->getMesh2D();
2942 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2944 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2946 MEDCouplingUMesh *ret=self->getMesh1D();
2949 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2951 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2953 DataArrayInt *ret=self->getMesh3DIds();
2956 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2961 //== MEDCouplingMappedExtrudedMesh End
2963 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
2966 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2967 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2968 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2969 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2970 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2971 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2974 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2976 int szArr,sw,iTypppArr;
2977 std::vector<int> stdvecTyyppArr;
2978 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2979 self->insertNextCell(tmp,tmp+szArr);
2982 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2984 DataArrayInt *ret=self->getNodalConnectivity();
2985 if(ret) ret->incrRef();
2989 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2991 std::vector< const MEDCoupling1GTUMesh *> parts;
2992 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2993 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2998 //== MEDCoupling1SGTUMesh
3000 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3003 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3004 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3005 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
3006 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
3007 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
3008 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3009 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
3010 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
3011 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
3014 MEDCoupling1SGTUMesh()
3016 return MEDCoupling1SGTUMesh::New();
3019 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3021 return MEDCoupling1SGTUMesh::New(name,type);
3024 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3026 return MEDCoupling1SGTUMesh::New(m);
3029 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3031 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
3034 std::string __str__() const throw(INTERP_KERNEL::Exception)
3036 return self->simpleRepr();
3039 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3041 std::ostringstream oss;
3042 self->reprQuickOverview(oss);
3046 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3048 DataArrayInt *cellPerm(0),*nodePerm(0);
3049 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3050 PyObject *ret(PyTuple_New(3));
3051 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3052 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3053 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3057 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(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::Merge1SGTUMeshes(tmp);
3064 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3066 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3067 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3068 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3073 //== MEDCoupling1SGTUMesh End
3075 //== MEDCoupling1DGTUMesh
3077 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3080 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3081 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3082 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3083 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3084 bool isPacked() const throw(INTERP_KERNEL::Exception);
3087 MEDCoupling1DGTUMesh()
3089 return MEDCoupling1DGTUMesh::New();
3091 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3093 return MEDCoupling1DGTUMesh::New(name,type);
3096 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3098 return MEDCoupling1DGTUMesh::New(m);
3101 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3103 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3106 std::string __str__() const throw(INTERP_KERNEL::Exception)
3108 return self->simpleRepr();
3111 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3113 std::ostringstream oss;
3114 self->reprQuickOverview(oss);
3118 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3120 DataArrayInt *ret=self->getNodalConnectivityIndex();
3121 if(ret) ret->incrRef();
3125 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3127 DataArrayInt *ret1=0,*ret2=0;
3128 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3129 PyObject *ret0Py=ret0?Py_True:Py_False;
3131 PyObject *ret=PyTuple_New(3);
3132 PyTuple_SetItem(ret,0,ret0Py);
3133 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3134 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3138 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3141 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3142 PyObject *ret=PyTuple_New(2);
3143 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3144 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3145 PyTuple_SetItem(ret,1,ret1Py);
3149 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(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::Merge1DGTUMeshes(tmp);
3156 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3158 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3159 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3160 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3163 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3165 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3166 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3167 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3172 //== MEDCoupling1DGTUMeshEnd
3174 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3177 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3178 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3179 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3180 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3181 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3182 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3183 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3184 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3185 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3186 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3187 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3188 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3189 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3190 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3191 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3194 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3196 int tmpp1=-1,tmpp2=-1;
3197 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3198 std::vector< std::pair<int,int> > inp;
3202 for(int i=0;i<tmpp1;i++)
3203 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3208 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3209 inp.resize(tmpp1/2);
3210 for(int i=0;i<tmpp1/2;i++)
3211 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3214 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3215 return self->buildStructuredSubPart(inp);
3218 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3220 std::vector< std::pair<int,int> > inp;
3221 convertPyToVectorPairInt(part,inp);
3223 int szArr,sw,iTypppArr;
3224 std::vector<int> stdvecTyyppArr;
3225 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3226 std::vector<int> tmp5(tmp4,tmp4+szArr);
3228 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3231 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3233 std::vector< std::pair<int,int> > inp;
3234 convertPyToVectorPairInt(part,inp);
3235 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3238 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3240 std::vector< std::pair<int,int> > inp;
3241 convertPyToVectorPairInt(part,inp);
3242 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3245 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3247 std::vector< std::pair<int,int> > inp;
3248 convertPyToVectorPairInt(part,inp);
3249 std::vector<int> stWithGhost;
3250 std::vector< std::pair<int,int> > partWithGhost;
3251 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3252 PyObject *ret(PyTuple_New(2));
3253 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3254 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3258 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3260 std::vector< std::pair<int,int> > inp;
3261 convertPyToVectorPairInt(partCompactFormat,inp);
3262 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3265 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3267 std::vector< std::pair<int,int> > inp;
3268 convertPyToVectorPairInt(partCompactFormat,inp);
3269 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3272 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3274 std::vector< std::pair<int,int> > inp;
3275 convertPyToVectorPairInt(part,inp);
3276 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3279 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3281 int szArr,sw,iTypppArr;
3282 std::vector<int> stdvecTyyppArr;
3283 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3284 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3287 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3289 int szArr,sw,iTypppArr;
3290 std::vector<int> stdvecTyyppArr;
3291 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3292 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3295 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3297 std::vector< std::pair<int,int> > inp;
3298 convertPyToVectorPairInt(partCompactFormat,inp);
3299 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3302 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3304 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3305 PyObject *retPy=PyList_New(ret.size());
3306 for(std::size_t i=0;i<ret.size();i++)
3308 PyObject *tmp=PyTuple_New(2);
3309 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3310 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3311 PyList_SetItem(retPy,i,tmp);
3316 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3318 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3319 convertPyToVectorPairInt(r1,r1Cpp);
3320 convertPyToVectorPairInt(r2,r2Cpp);
3321 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3322 PyObject *retPy=PyList_New(ret.size());
3323 for(std::size_t i=0;i<ret.size();i++)
3325 PyObject *tmp=PyTuple_New(2);
3326 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3327 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3328 PyList_SetItem(retPy,i,tmp);
3333 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3335 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3336 convertPyToVectorPairInt(r1,r1Cpp);
3337 convertPyToVectorPairInt(r2,r2Cpp);
3338 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3341 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3343 int szArr,sw,iTypppArr;
3344 std::vector<int> stdvecTyyppArr;
3345 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3346 int szArr2,sw2,iTypppArr2;
3347 std::vector<int> stdvecTyyppArr2;
3348 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3349 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3350 std::vector< std::pair<int,int> > partCompactFormat;
3351 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3352 PyObject *ret=PyTuple_New(2);
3353 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3354 PyTuple_SetItem(ret,0,ret0Py);
3355 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3356 for(std::size_t i=0;i<partCompactFormat.size();i++)
3358 PyObject *tmp4=PyTuple_New(2);
3359 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3360 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3361 PyList_SetItem(ret1Py,i,tmp4);
3363 PyTuple_SetItem(ret,1,ret1Py);
3367 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3369 std::vector< std::pair<int,int> > param0,param1,ret;
3370 convertPyToVectorPairInt(bigInAbs,param0);
3371 convertPyToVectorPairInt(partOfBigInAbs,param1);
3372 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3373 PyObject *retPy(PyList_New(ret.size()));
3374 for(std::size_t i=0;i<ret.size();i++)
3376 PyObject *tmp(PyTuple_New(2));
3377 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3378 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3379 PyList_SetItem(retPy,i,tmp);
3384 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3386 std::vector< std::pair<int,int> > param0;
3387 convertPyToVectorPairInt(part,param0);
3388 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3389 PyObject *retPy(PyList_New(ret.size()));
3390 for(std::size_t i=0;i<ret.size();i++)
3392 PyObject *tmp(PyTuple_New(2));
3393 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3394 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3395 PyList_SetItem(retPy,i,tmp);
3400 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3402 std::vector< std::pair<int,int> > param0,param1;
3403 convertPyToVectorPairInt(startingFrom,param0);
3404 convertPyToVectorPairInt(goingTo,param1);
3405 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3408 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3410 std::vector< std::pair<int,int> > param0,param1,ret;
3411 convertPyToVectorPairInt(bigInAbs,param0);
3412 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3413 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3414 PyObject *retPy(PyList_New(ret.size()));
3415 for(std::size_t i=0;i<ret.size();i++)
3417 PyObject *tmp(PyTuple_New(2));
3418 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3419 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3420 PyList_SetItem(retPy,i,tmp);
3427 class MEDCouplingCurveLinearMesh;
3429 //== MEDCouplingCMesh
3431 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3434 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3435 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3436 void setCoords(const DataArrayDouble *coordsX,
3437 const DataArrayDouble *coordsY=0,
3438 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3439 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3440 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3442 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3444 return MEDCouplingCMesh::New();
3446 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3448 return MEDCouplingCMesh::New(meshName);
3451 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3453 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3455 std::string __str__() const throw(INTERP_KERNEL::Exception)
3457 return self->simpleRepr();
3459 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3461 std::ostringstream oss;
3462 self->reprQuickOverview(oss);
3465 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3467 DataArrayDouble *ret=self->getCoordsAt(i);
3475 //== MEDCouplingCMesh End
3477 //== MEDCouplingCurveLinearMesh
3479 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3482 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3483 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3484 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3486 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3488 return MEDCouplingCurveLinearMesh::New();
3490 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3492 return MEDCouplingCurveLinearMesh::New(meshName);
3494 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3496 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3498 std::string __str__() const throw(INTERP_KERNEL::Exception)
3500 return self->simpleRepr();
3502 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3504 std::ostringstream oss;
3505 self->reprQuickOverview(oss);
3508 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3510 DataArrayDouble *ret=self->getCoords();
3515 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3517 int szArr,sw,iTypppArr;
3518 std::vector<int> stdvecTyyppArr;
3519 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3520 self->setNodeGridStructure(tmp,tmp+szArr);
3525 //== MEDCouplingCurveLinearMesh End
3527 //== MEDCouplingIMesh
3529 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3532 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3534 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3535 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3536 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3537 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3538 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3539 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3540 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3541 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3542 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3543 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3544 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3549 return MEDCouplingIMesh::New();
3551 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3553 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3554 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3555 const int *nodeStrctPtr(0);
3556 const double *originPtr(0),*dxyzPtr(0);
3558 std::vector<int> bb0;
3559 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3562 std::vector<double> bb,bb2;
3564 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3565 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3567 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3570 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3572 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3575 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3577 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3580 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3583 std::vector<int> bb0;
3584 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3585 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3588 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3590 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3593 DataArrayDoubleTuple *aa;
3594 std::vector<double> bb;
3596 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3597 self->setOrigin(originPtr,originPtr+nbTuples);
3600 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3602 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3605 DataArrayDoubleTuple *aa;
3606 std::vector<double> bb;
3608 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3609 self->setDXYZ(originPtr,originPtr+nbTuples);
3612 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3614 std::vector< std::pair<int,int> > inp;
3615 convertPyToVectorPairInt(fineLocInCoarse,inp);
3616 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3619 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)
3621 std::vector< std::pair<int,int> > inp;
3622 convertPyToVectorPairInt(fineLocInCoarse,inp);
3623 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3626 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3628 std::vector< std::pair<int,int> > inp;
3629 convertPyToVectorPairInt(fineLocInCoarse,inp);
3630 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3633 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)
3635 std::vector< std::pair<int,int> > inp;
3636 convertPyToVectorPairInt(fineLocInCoarse,inp);
3637 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3640 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)
3642 std::vector< std::pair<int,int> > inp;
3643 convertPyToVectorPairInt(fineLocInCoarse,inp);
3644 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3647 std::string __str__() const throw(INTERP_KERNEL::Exception)
3649 return self->simpleRepr();
3651 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3653 std::ostringstream oss;
3654 self->reprQuickOverview(oss);
3660 //== MEDCouplingIMesh End
3664 namespace MEDCoupling
3666 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3669 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3670 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3671 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3672 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3673 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3674 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3675 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3676 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3677 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3678 std::string getName() const throw(INTERP_KERNEL::Exception);
3679 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3680 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3681 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3682 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3683 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3684 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3685 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3686 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3687 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3688 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3689 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3690 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3691 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3692 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3693 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3694 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3696 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3698 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3701 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3704 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3706 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3709 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3712 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3714 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3715 return convertIntArrToPyList3(ret);
3718 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3721 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3722 PyObject *ret=PyTuple_New(2);
3723 PyObject *ret0Py=ret0?Py_True:Py_False;
3725 PyTuple_SetItem(ret,0,ret0Py);
3726 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3730 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3732 DataArrayInt *ret1=0;
3733 MEDCouplingMesh *ret0=0;
3735 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3736 if (!SWIG_IsOK(res1))
3739 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3740 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3744 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3746 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3747 da2->checkAllocated();
3748 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3750 PyObject *res = PyList_New(2);
3751 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3752 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3756 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3758 DataArrayInt *ret1=0;
3760 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3761 PyObject *res=PyTuple_New(2);
3762 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3764 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3767 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3768 PyTuple_SetItem(res,1,res1);
3773 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3776 int v0; std::vector<int> v1;
3777 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3778 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3781 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3782 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3785 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3786 if (!SWIG_IsOK(res1))
3789 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3790 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3794 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3796 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3797 da2->checkAllocated();
3798 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3802 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3804 std::vector<int> tmp;
3805 self->getCellIdsHavingGaussLocalization(locId,tmp);
3806 DataArrayInt *ret=DataArrayInt::New();
3807 ret->alloc((int)tmp.size(),1);
3808 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3809 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3812 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3814 std::vector<int> inp0;
3815 convertPyToNewIntArr4(code,1,3,inp0);
3816 std::vector<const DataArrayInt *> inp1;
3817 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3818 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3823 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3826 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3827 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3828 static MEDCouplingFieldTemplate *New(TypeOfField type);
3829 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3830 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3833 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3835 return MEDCouplingFieldTemplate::New(f);
3838 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3840 return MEDCouplingFieldTemplate::New(f);
3843 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3845 return MEDCouplingFieldTemplate::New(type);
3848 std::string __str__() const throw(INTERP_KERNEL::Exception)
3850 return self->simpleRepr();
3853 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3855 std::ostringstream oss;
3856 self->reprQuickOverview(oss);
3862 class MEDCouplingFieldInt;
3864 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3867 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3868 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3869 void setTimeUnit(const std::string& unit);
3870 std::string getTimeUnit() const;
3871 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3872 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3873 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3874 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3875 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3876 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3877 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
3878 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3879 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3880 MEDCouplingFieldDouble *deepCopy() const;
3881 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
3882 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3883 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3884 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3885 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3886 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3887 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3888 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3889 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3890 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3891 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3892 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3893 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3894 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3895 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3896 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3897 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3898 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3899 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3900 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3901 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3902 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3903 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3904 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3905 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3906 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3907 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3908 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3909 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3910 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3911 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3912 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3913 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3914 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3915 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3916 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3917 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3918 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3919 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3920 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3921 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3922 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3923 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3924 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3925 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3926 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3927 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3928 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3929 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3930 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3931 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3932 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3933 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3934 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3935 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3936 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3937 double getMinValue() const throw(INTERP_KERNEL::Exception);
3938 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3939 double norm2() const throw(INTERP_KERNEL::Exception);
3940 double normMax() const throw(INTERP_KERNEL::Exception);
3941 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3942 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3943 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3944 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3945 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3946 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3947 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3948 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3949 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3950 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3951 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3952 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3953 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3954 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3955 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3956 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3957 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3958 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3959 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3960 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3961 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3962 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3964 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3966 return MEDCouplingFieldDouble::New(type,td);
3969 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3971 return MEDCouplingFieldDouble::New(ft,td);
3974 std::string __str__() const throw(INTERP_KERNEL::Exception)
3976 return self->simpleRepr();
3979 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3981 std::ostringstream oss;
3982 self->reprQuickOverview(oss);
3986 MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
3988 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
3992 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
3994 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
3998 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4000 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4002 DataArrayDouble *a,*a2;
4003 DataArrayDoubleTuple *aa,*aa2;
4004 std::vector<double> bb,bb2;
4006 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4007 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4008 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4011 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
4013 DataArrayDouble *ret=self->getArray();
4019 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4021 std::vector<DataArrayDouble *> arrs=self->getArrays();
4022 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4026 PyObject *ret=PyTuple_New(sz);
4027 for(int i=0;i<sz;i++)
4030 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4032 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4037 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4039 std::vector<const DataArrayDouble *> tmp;
4040 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4042 std::vector<DataArrayDouble *> arrs(sz);
4043 for(int i=0;i<sz;i++)
4044 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4045 self->setArrays(arrs);
4048 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4050 DataArrayDouble *ret=self->getEndArray();
4056 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4060 DataArrayDoubleTuple *aa;
4061 std::vector<double> bb;
4063 const MEDCouplingMesh *mesh=self->getMesh();
4065 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4066 int spaceDim=mesh->getSpaceDimension();
4067 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4068 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4070 int sz=self->getNumberOfComponents();
4071 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4072 self->getValueOn(spaceLoc,res);
4073 return convertDblArrToPyList(res,sz);
4076 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4078 int sz=self->getNumberOfComponents();
4079 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4080 self->getValueOnPos(i,j,k,res);
4081 return convertDblArrToPyList(res,sz);
4084 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4086 const MEDCouplingMesh *mesh(self->getMesh());
4088 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4091 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4092 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4093 mesh->getSpaceDimension(),true,nbPts);
4094 return self->getValueOnMulti(inp,nbPts);
4097 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4101 DataArrayDoubleTuple *aa;
4102 std::vector<double> bb;
4104 const MEDCouplingMesh *mesh=self->getMesh();
4106 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4107 int spaceDim=mesh->getSpaceDimension();
4108 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4109 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4112 int sz=self->getNumberOfComponents();
4113 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4114 self->getValueOn(spaceLoc,time,res);
4115 return convertDblArrToPyList(res,sz);
4118 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4120 if(self->getArray()!=0)
4121 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4124 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4125 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4126 self->setArray(arr);
4130 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4133 double tmp0=self->getTime(tmp1,tmp2);
4134 PyObject *res = PyList_New(3);
4135 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4136 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4137 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4141 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4144 double tmp0=self->getStartTime(tmp1,tmp2);
4145 PyObject *res = PyList_New(3);
4146 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4147 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4148 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4152 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4155 double tmp0=self->getEndTime(tmp1,tmp2);
4156 PyObject *res = PyList_New(3);
4157 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4158 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4159 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4162 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4164 int sz=self->getNumberOfComponents();
4165 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4166 self->accumulate(tmp);
4167 return convertDblArrToPyList(tmp,sz);
4169 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4171 int sz=self->getNumberOfComponents();
4172 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4173 self->integral(isWAbs,tmp);
4174 return convertDblArrToPyList(tmp,sz);
4176 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4178 int sz=self->getNumberOfComponents();
4179 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4180 self->getWeightedAverageValue(tmp,isWAbs);
4181 return convertDblArrToPyList(tmp,sz);
4183 PyObject *normL1() 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 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4192 int sz=self->getNumberOfComponents();
4193 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4195 return convertDblArrToPyList(tmp,sz);
4197 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4199 int szArr,sw,iTypppArr;
4200 std::vector<int> stdvecTyyppArr;
4201 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4202 self->renumberCells(tmp,check);
4205 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4207 int szArr,sw,iTypppArr;
4208 std::vector<int> stdvecTyyppArr;
4209 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4210 self->renumberCellsWithoutMesh(tmp,check);
4213 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4215 int szArr,sw,iTypppArr;
4216 std::vector<int> stdvecTyyppArr;
4217 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4218 self->renumberNodes(tmp,eps);
4221 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4223 int szArr,sw,iTypppArr;
4224 std::vector<int> stdvecTyyppArr;
4225 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4226 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4229 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4233 std::vector<int> multiVal;
4234 std::pair<int, std::pair<int,int> > slic;
4235 MEDCoupling::DataArrayInt *daIntTyypp=0;
4236 const MEDCouplingMesh *mesh=self->getMesh();
4238 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4239 int nbc=mesh->getNumberOfCells();
4240 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4247 std::ostringstream oss;
4248 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4249 throw INTERP_KERNEL::Exception(oss.str().c_str());
4252 return self->buildSubPart(&singleVal,&singleVal+1);
4257 int tmp=nbc+singleVal;
4258 return self->buildSubPart(&tmp,&tmp+1);
4262 std::ostringstream oss;
4263 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4264 throw INTERP_KERNEL::Exception(oss.str().c_str());
4270 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4274 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4279 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4280 daIntTyypp->checkAllocated();
4281 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4284 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4288 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4290 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";
4291 if(PyTuple_Check(li))
4293 Py_ssize_t sz=PyTuple_Size(li);
4295 throw INTERP_KERNEL::Exception(msg);
4296 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4299 std::vector<int> multiVal;
4300 std::pair<int, std::pair<int,int> > slic;
4301 MEDCoupling::DataArrayInt *daIntTyypp=0;
4302 if(!self->getArray())
4303 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4305 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4306 catch(INTERP_KERNEL::Exception& e)
4307 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4308 MCAuto<MEDCouplingFieldDouble> ret0=MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4309 DataArrayDouble *ret0Arr=ret0->getArray();
4311 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4316 std::vector<int> v2(1,singleVal);
4317 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4318 ret0->setArray(aarr);
4323 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4324 ret0->setArray(aarr);
4329 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4330 std::vector<int> v2(nbOfComp);
4331 for(int i=0;i<nbOfComp;i++)
4332 v2[i]=slic.first+i*slic.second.second;
4333 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4334 ret0->setArray(aarr);
4338 throw INTERP_KERNEL::Exception(msg);
4343 return MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,li);
4346 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4349 double r1=self->getMaxValue2(tmp);
4350 PyObject *ret=PyTuple_New(2);
4351 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4352 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4356 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4359 double r1=self->getMinValue2(tmp);
4360 PyObject *ret=PyTuple_New(2);
4361 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4362 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4366 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4368 std::vector<int> tmp;
4369 convertPyToNewIntArr3(li,tmp);
4370 return self->keepSelectedComponents(tmp);
4373 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4375 std::vector<int> tmp;
4376 convertPyToNewIntArr3(li,tmp);
4377 self->setSelectedComponents(f,tmp);
4380 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4383 DataArrayDouble *a,*a2;
4384 DataArrayDoubleTuple *aa,*aa2;
4385 std::vector<double> bb,bb2;
4388 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4389 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4390 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4391 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4393 return self->extractSlice3D(orig,vect,eps);
4396 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4398 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4401 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4403 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4406 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4408 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.";
4409 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4412 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4414 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4416 return (*self)-(*other);
4418 throw INTERP_KERNEL::Exception(msg);
4423 DataArrayDoubleTuple *aa;
4424 std::vector<double> bb;
4426 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4431 if(!self->getArray())
4432 throw INTERP_KERNEL::Exception(msg2);
4433 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4434 ret->applyLin(1.,-val);
4435 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4436 ret2->setArray(ret);
4441 if(!self->getArray())
4442 throw INTERP_KERNEL::Exception(msg2);
4443 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4444 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4445 ret2->setArray(ret);
4450 if(!self->getArray())
4451 throw INTERP_KERNEL::Exception(msg2);
4452 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4453 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4454 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4455 ret2->setArray(ret);
4460 if(!self->getArray())
4461 throw INTERP_KERNEL::Exception(msg2);
4462 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4463 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4464 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4465 ret2->setArray(ret);
4469 { throw INTERP_KERNEL::Exception(msg); }
4473 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4475 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4478 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4480 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4483 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4485 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4488 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4490 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.";
4491 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4494 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4496 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4498 return (*self)/(*other);
4500 throw INTERP_KERNEL::Exception(msg);
4505 DataArrayDoubleTuple *aa;
4506 std::vector<double> bb;
4508 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4514 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4515 if(!self->getArray())
4516 throw INTERP_KERNEL::Exception(msg2);
4517 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4518 ret->applyLin(1./val,0);
4519 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4520 ret2->setArray(ret);
4525 if(!self->getArray())
4526 throw INTERP_KERNEL::Exception(msg2);
4527 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4528 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4529 ret2->setArray(ret);
4534 if(!self->getArray())
4535 throw INTERP_KERNEL::Exception(msg2);
4536 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4537 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4538 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4539 ret2->setArray(ret);
4544 if(!self->getArray())
4545 throw INTERP_KERNEL::Exception(msg2);
4546 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4547 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4548 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4549 ret2->setArray(ret);
4553 { throw INTERP_KERNEL::Exception(msg); }
4557 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4559 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4562 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4564 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.";
4565 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4568 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4570 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4572 return (*self)^(*other);
4574 throw INTERP_KERNEL::Exception(msg);
4579 DataArrayDoubleTuple *aa;
4580 std::vector<double> bb;
4582 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4587 if(!self->getArray())
4588 throw INTERP_KERNEL::Exception(msg2);
4589 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4591 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4592 ret2->setArray(ret);
4597 if(!self->getArray())
4598 throw INTERP_KERNEL::Exception(msg2);
4599 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4600 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4601 ret2->setArray(ret);
4606 if(!self->getArray())
4607 throw INTERP_KERNEL::Exception(msg2);
4608 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4609 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4610 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4611 ret2->setArray(ret);
4616 if(!self->getArray())
4617 throw INTERP_KERNEL::Exception(msg2);
4618 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4619 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4620 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4621 ret2->setArray(ret);
4625 { throw INTERP_KERNEL::Exception(msg); }
4629 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4631 return self->negate();
4634 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4636 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.";
4637 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4640 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4642 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4646 Py_XINCREF(trueSelf);
4650 throw INTERP_KERNEL::Exception(msg);
4655 DataArrayDoubleTuple *aa;
4656 std::vector<double> bb;
4658 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4663 if(!self->getArray())
4664 throw INTERP_KERNEL::Exception(msg2);
4665 self->getArray()->applyLin(1.,val);
4666 Py_XINCREF(trueSelf);
4671 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4674 Py_XINCREF(trueSelf);
4679 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4680 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4681 ret2->setArray(aaa);
4683 Py_XINCREF(trueSelf);
4688 if(!self->getArray())
4689 throw INTERP_KERNEL::Exception(msg2);
4690 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4691 self->getArray()->addEqual(aaa);
4692 Py_XINCREF(trueSelf);
4696 { throw INTERP_KERNEL::Exception(msg); }
4700 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4702 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.";
4703 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4706 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4708 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4712 Py_XINCREF(trueSelf);
4716 throw INTERP_KERNEL::Exception(msg);
4721 DataArrayDoubleTuple *aa;
4722 std::vector<double> bb;
4724 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4729 if(!self->getArray())
4730 throw INTERP_KERNEL::Exception(msg2);
4731 self->getArray()->applyLin(1.,-val);
4732 Py_XINCREF(trueSelf);
4737 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4740 Py_XINCREF(trueSelf);
4745 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4746 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4747 ret2->setArray(aaa);
4749 Py_XINCREF(trueSelf);
4754 if(!self->getArray())
4755 throw INTERP_KERNEL::Exception(msg2);
4756 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4757 self->getArray()->substractEqual(aaa);
4758 Py_XINCREF(trueSelf);
4762 { throw INTERP_KERNEL::Exception(msg); }
4766 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4768 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.";
4769 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4772 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4774 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4778 Py_XINCREF(trueSelf);
4782 throw INTERP_KERNEL::Exception(msg);
4787 DataArrayDoubleTuple *aa;
4788 std::vector<double> bb;
4790 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4795 if(!self->getArray())
4796 throw INTERP_KERNEL::Exception(msg2);
4797 self->getArray()->applyLin(val,0);
4798 Py_XINCREF(trueSelf);
4803 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4806 Py_XINCREF(trueSelf);
4811 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4812 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4813 ret2->setArray(aaa);
4815 Py_XINCREF(trueSelf);
4820 if(!self->getArray())
4821 throw INTERP_KERNEL::Exception(msg2);
4822 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4823 self->getArray()->multiplyEqual(aaa);
4824 Py_XINCREF(trueSelf);
4828 { throw INTERP_KERNEL::Exception(msg); }
4832 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4834 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.";
4835 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4838 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4840 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4844 Py_XINCREF(trueSelf);
4848 throw INTERP_KERNEL::Exception(msg);
4853 DataArrayDoubleTuple *aa;
4854 std::vector<double> bb;
4856 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4862 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4863 if(!self->getArray())
4864 throw INTERP_KERNEL::Exception(msg2);
4865 self->getArray()->applyLin(1./val,0);
4866 Py_XINCREF(trueSelf);
4871 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4874 Py_XINCREF(trueSelf);
4879 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4880 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4881 ret2->setArray(aaa);
4883 Py_XINCREF(trueSelf);
4888 if(!self->getArray())
4889 throw INTERP_KERNEL::Exception(msg2);
4890 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4891 self->getArray()->divideEqual(aaa);
4892 Py_XINCREF(trueSelf);
4896 { throw INTERP_KERNEL::Exception(msg); }
4900 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4902 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.";
4903 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4906 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4908 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4912 Py_XINCREF(trueSelf);
4916 throw INTERP_KERNEL::Exception(msg);
4921 DataArrayDoubleTuple *aa;
4922 std::vector<double> bb;
4924 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4929 if(!self->getArray())
4930 throw INTERP_KERNEL::Exception(msg2);
4931 self->getArray()->applyPow(val);
4932 Py_XINCREF(trueSelf);
4937 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4940 Py_XINCREF(trueSelf);
4945 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4946 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4947 ret2->setArray(aaa);
4949 Py_XINCREF(trueSelf);
4954 if(!self->getArray())
4955 throw INTERP_KERNEL::Exception(msg2);
4956 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4957 self->getArray()->powEqual(aaa);
4958 Py_XINCREF(trueSelf);
4962 { throw INTERP_KERNEL::Exception(msg); }
4966 static MEDCouplingFieldDouble *MergeFields(PyObject *li) 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::MergeFields(tmp);
4973 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4975 std::vector<const MEDCouplingFieldDouble *> tmp;
4976 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4977 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4980 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4982 std::vector<double> a0;
4983 std::vector<int> a1;
4984 std::vector<std::string> a2;
4985 self->getTinySerializationDbleInformation(a0);
4986 self->getTinySerializationIntInformation(a1);
4987 self->getTinySerializationStrInformation(a2);
4989 PyObject *ret(PyTuple_New(3));
4990 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4991 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
4993 PyObject *ret2(PyList_New(sz));
4995 for(int i=0;i<sz;i++)
4996 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
4998 PyTuple_SetItem(ret,2,ret2);
5002 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5004 DataArrayInt *ret0(0);
5005 std::vector<DataArrayDouble *> ret1;
5006 self->serialize(ret0,ret1);
5009 std::size_t sz(ret1.size());
5010 PyObject *ret(PyTuple_New(2));
5011 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
5012 PyObject *ret1Py(PyList_New(sz));
5013 for(std::size_t i=0;i<sz;i++)
5017 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5019 PyTuple_SetItem(ret,1,ret1Py);
5023 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
5025 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
5026 if(!PyTuple_Check(args))
5027 throw INTERP_KERNEL::Exception(MSG);
5028 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
5029 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
5030 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
5032 PyObject *tmp0(PyTuple_New(1));
5033 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
5034 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
5036 Py_DECREF(selfMeth);
5037 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
5038 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
5039 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
5041 PyObject *a(PyInt_FromLong(0));
5042 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
5045 throw INTERP_KERNEL::Exception(MSG);
5046 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
5047 throw INTERP_KERNEL::Exception(MSG);
5048 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
5051 Py_DECREF(initMeth);
5056 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
5057 {// put an empty dict in input to say to __new__ to call __init__...
5058 self->checkConsistencyLight();
5059 PyObject *ret(PyTuple_New(1));
5060 PyObject *ret0(PyDict_New());
5062 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
5063 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
5064 PyDict_SetItem(ret0,a,d);
5065 Py_DECREF(a); Py_DECREF(d);
5067 PyTuple_SetItem(ret,0,ret0);
5071 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5073 self->checkConsistencyLight();
5074 PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
5075 PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
5076 const MEDCouplingMesh *mesh(self->getMesh());
5079 PyObject *ret(PyTuple_New(3));
5080 PyTuple_SetItem(ret,0,ret0);
5081 PyTuple_SetItem(ret,1,ret1);
5082 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
5086 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5088 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
5089 if(!PyTuple_Check(inp))
5090 throw INTERP_KERNEL::Exception(MSG);
5091 int sz(PyTuple_Size(inp));
5093 throw INTERP_KERNEL::Exception(MSG);
5095 PyObject *elt2(PyTuple_GetItem(inp,2));
5097 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
5098 if(!SWIG_IsOK(status))
5099 throw INTERP_KERNEL::Exception(MSG);
5100 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
5102 PyObject *elt0(PyTuple_GetItem(inp,0));
5103 PyObject *elt1(PyTuple_GetItem(inp,1));
5104 std::vector<double> a0;
5105 std::vector<int> a1;
5106 std::vector<std::string> a2;
5107 DataArrayInt *b0(0);
5108 std::vector<DataArrayDouble *>b1;
5110 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5111 throw INTERP_KERNEL::Exception(MSG);
5112 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5114 fillArrayWithPyListDbl3(a0py,tmp,a0);
5115 convertPyToNewIntArr3(a1py,a1);
5116 fillStringVector(a2py,a2);
5119 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5120 throw INTERP_KERNEL::Exception(MSG);
5121 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5123 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5124 if(!SWIG_IsOK(status))
5125 throw INTERP_KERNEL::Exception(MSG);
5126 b0=reinterpret_cast<DataArrayInt *>(argp);
5127 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5129 self->checkForUnserialization(a1,b0,b1);
5130 // useless here to call resizeForUnserialization because arrays are well resized.
5131 self->finishUnserialization(a1,a0,a2);
5136 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5139 int getNumberOfFields() const;
5140 MEDCouplingMultiFields *deepCopy() const;
5141 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5142 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5143 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5144 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5145 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5148 std::string __str__() const throw(INTERP_KERNEL::Exception)
5150 return self->simpleRepr();
5152 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5154 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5155 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5157 std::vector<MEDCouplingFieldDouble *> fs(sz);
5158 for(int i=0;i<sz;i++)
5159 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5160 return MEDCouplingMultiFields::New(fs);
5162 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5164 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5165 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5167 std::vector<MEDCouplingFieldDouble *> fs(sz);
5168 for(int i=0;i<sz;i++)
5169 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5170 return MEDCouplingMultiFields::New(fs);
5172 PyObject *getFields() const
5174 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5175 int sz=fields.size();
5176 PyObject *res = PyList_New(sz);
5177 for(int i=0;i<sz;i++)
5181 fields[i]->incrRef();
5182 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5186 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5191 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5193 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5197 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5200 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5202 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5204 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5206 PyObject *res = PyList_New(sz);
5207 for(int i=0;i<sz;i++)
5212 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5216 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5221 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5223 std::vector<int> refs;
5224 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5226 PyObject *res = PyList_New(sz);
5227 for(int i=0;i<sz;i++)
5232 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5236 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5240 PyObject *ret=PyTuple_New(2);
5241 PyTuple_SetItem(ret,0,res);
5242 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5245 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5247 std::vector<DataArrayDouble *> ms=self->getArrays();
5249 PyObject *res = PyList_New(sz);
5250 for(int i=0;i<sz;i++)
5255 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5259 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5264 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5266 std::vector< std::vector<int> > refs;
5267 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5269 PyObject *res = PyList_New(sz);
5270 PyObject *res2 = PyList_New(sz);
5271 for(int i=0;i<sz;i++)
5276 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5280 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5282 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5285 PyObject *ret=PyTuple_New(2);
5286 PyTuple_SetItem(ret,0,res);
5287 PyTuple_SetItem(ret,1,res2);
5293 class MEDCouplingFieldInt : public MEDCouplingField
5296 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5297 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5298 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5299 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5300 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5301 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5302 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5303 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5304 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5305 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5307 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5309 return MEDCouplingFieldInt::New(type,td);
5312 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5314 return MEDCouplingFieldInt::New(ft,td);
5317 std::string __str__() const throw(INTERP_KERNEL::Exception)
5319 return self->simpleRepr();
5322 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5324 std::ostringstream oss;
5325 self->reprQuickOverview(oss);
5329 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5331 DataArrayInt *ret=self->getArray();
5337 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5340 double tmp0=self->getTime(tmp1,tmp2);
5341 PyObject *res = PyList_New(3);
5342 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5343 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5344 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5350 class MEDCouplingDefinitionTime
5353 MEDCouplingDefinitionTime();
5354 void assign(const MEDCouplingDefinitionTime& other);
5355 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5356 double getTimeResolution() const;
5357 std::vector<double> getHotSpotsTime() const;
5360 std::string __str__() const throw(INTERP_KERNEL::Exception)
5362 std::ostringstream oss;
5363 self->appendRepr(oss);
5367 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5369 int meshId,arrId,arrIdInField,fieldId;
5370 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5371 PyObject *res=PyList_New(4);
5372 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5373 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5374 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5375 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5379 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5381 int meshId,arrId,arrIdInField,fieldId;
5382 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5383 PyObject *res=PyList_New(4);
5384 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5385 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5386 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5387 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5393 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5396 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5397 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5401 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5403 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5404 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5406 std::vector<MEDCouplingFieldDouble *> fs(sz);
5407 for(int i=0;i<sz;i++)
5408 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5409 return MEDCouplingFieldOverTime::New(fs);
5411 std::string __str__() const throw(INTERP_KERNEL::Exception)
5413 return self->simpleRepr();
5415 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5417 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5418 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5420 std::vector<MEDCouplingFieldDouble *> fs(sz);
5421 for(int i=0;i<sz;i++)
5422 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5423 return MEDCouplingFieldOverTime::New(fs);
5428 class MEDCouplingCartesianAMRMesh;
5430 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5433 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5434 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5435 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5438 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5440 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5448 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5451 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5452 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5453 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5456 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5458 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5459 return convertFromVectorPairInt(ret);
5462 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5464 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5465 return convertFromVectorPairInt(ret);
5468 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5470 std::vector< std::pair<int,int> > inp;
5471 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5472 self->addPatch(inp,factors);
5475 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5477 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5479 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5480 if(patchId==mesh->getNumberOfPatches())
5482 std::ostringstream oss;
5483 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5484 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5487 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5493 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5495 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5497 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5498 mesh->removePatch(patchId);
5501 int __len__() const throw(INTERP_KERNEL::Exception)
5503 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5505 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5506 return mesh->getNumberOfPatches();
5511 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5515 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5518 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5519 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5520 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5521 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5522 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5523 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5524 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5525 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5526 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5527 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5528 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5529 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5530 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5532 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5533 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5534 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5535 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5536 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5537 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5538 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5539 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5540 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5541 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5542 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5543 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5544 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5545 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5546 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5547 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5548 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5549 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5550 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5551 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5554 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5556 std::vector< std::pair<int,int> > inp;
5557 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5558 self->addPatch(inp,factors);
5561 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5563 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5565 PyObject *ret = PyList_New(sz);
5566 for(int i=0;i<sz;i++)
5568 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5571 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5576 // agy : don't know why typemap fails here ??? let it in the extend section
5577 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5579 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5582 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5584 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5585 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5591 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5593 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5594 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5600 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5602 std::vector<int> out1;
5603 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5604 PyObject *ret(PyTuple_New(2));
5605 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5606 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5610 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5612 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5614 PyObject *ret = PyList_New(sz);
5615 for(int i=0;i<sz;i++)
5616 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5620 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5622 std::vector<const DataArrayDouble *> inp;
5623 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5624 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5627 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5629 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5635 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5637 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5643 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5645 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5651 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5653 const MEDCouplingIMesh *ret(self->getImageMesh());
5656 return const_cast<MEDCouplingIMesh *>(ret);
5659 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5661 if(patchId==self->getNumberOfPatches())
5663 std::ostringstream oss;
5664 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5665 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5668 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5674 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5676 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5677 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5678 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5681 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5683 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5684 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5685 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5688 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5690 self->removePatch(patchId);
5693 int __len__() const throw(INTERP_KERNEL::Exception)
5695 return self->getNumberOfPatches();
5700 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5704 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5707 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5710 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5712 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5713 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5714 const int *nodeStrctPtr(0);
5715 const double *originPtr(0),*dxyzPtr(0);
5717 std::vector<int> bb0;
5718 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5721 std::vector<double> bb,bb2;
5723 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5724 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5726 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5729 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5731 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5732 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5733 std::vector< std::vector<int> > inp2;
5734 convertPyToVectorOfVectorOfInt(factors,inp2);
5735 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5738 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5740 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5743 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5745 return MEDCouplingCartesianAMRMesh::New(mesh);
5750 class MEDCouplingDataForGodFather : public RefCountObject
5753 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5754 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5755 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5756 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5757 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5758 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5759 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5760 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5761 virtual void alloc() throw(INTERP_KERNEL::Exception);
5762 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5765 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5767 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5775 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5778 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5779 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5780 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5781 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5782 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5783 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5784 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5785 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5786 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5789 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5791 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5792 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5793 MEDCouplingAMRAttribute *ret(0);
5796 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5797 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5799 catch(INTERP_KERNEL::Exception&)
5801 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5802 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5807 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5809 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5812 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5814 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5815 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5821 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5823 std::vector< std::vector<std::string> > compNamesCpp;
5824 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5825 self->spillInfoOnComponents(compNamesCpp);
5828 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5830 std::vector<int> inp0;
5831 if(!fillIntVector(nfs,inp0))
5832 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5833 std::size_t sz(inp0.size());
5834 std::vector<NatureOfField> inp00(sz);
5835 for(std::size_t i=0;i<sz;i++)
5836 inp00[i]=(NatureOfField)inp0[i];
5837 self->spillNatures(inp00);
5840 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5842 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5843 int sz((int)ret.size());
5844 PyObject *retPy(PyList_New(sz));
5845 for(int i=0;i<sz;i++)
5846 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5852 class DenseMatrix : public RefCountObject, public TimeLabel
5855 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5856 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5857 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5858 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5860 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5861 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5862 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5863 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5864 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5865 void transpose() throw(INTERP_KERNEL::Exception);
5867 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5868 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5869 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5872 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5874 return DenseMatrix::New(nbRows,nbCols);
5877 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5879 return DenseMatrix::New(array,nbRows,nbCols);
5882 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5885 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5886 PyObject *ret=PyTuple_New(2);
5887 PyObject *ret0Py=ret0?Py_True:Py_False;
5889 PyTuple_SetItem(ret,0,ret0Py);
5890 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5894 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5896 DataArrayDouble *ret(self->getData());
5902 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5904 return MEDCoupling::DenseMatrix::Add(self,other);
5907 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5909 return MEDCoupling::DenseMatrix::Substract(self,other);
5912 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5914 return MEDCoupling::DenseMatrix::Multiply(self,other);
5917 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5919 return MEDCoupling::DenseMatrix::Multiply(self,other);
5922 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5924 self->addEqual(other);
5925 Py_XINCREF(trueSelf);
5929 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5931 self->substractEqual(other);
5932 Py_XINCREF(trueSelf);
5936 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5938 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5945 class PartDefinition : public RefCountObject, public TimeLabel
5948 static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5949 static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5950 virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
5951 virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
5952 virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
5953 virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
5954 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5955 virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
5958 virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
5960 return (*self)+other;
5963 virtual PyObject *isEqual(const PartDefinition *other) const throw(INTERP_KERNEL::Exception)
5966 bool ret0(self->isEqual(other,ret1));
5967 PyObject *ret=PyTuple_New(2);
5968 PyObject *ret0Py=ret0?Py_True:Py_False;
5970 PyTuple_SetItem(ret,0,ret0Py);
5971 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5975 virtual PyObject *deepCopy() const throw(INTERP_KERNEL::Exception)
5977 return convertPartDefinition(self->deepCopy(),SWIG_POINTER_OWN | 0);
5981 virtual ~PartDefinition();
5984 class DataArrayPartDefinition : public PartDefinition
5987 static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5990 DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
5992 return DataArrayPartDefinition::New(listOfIds);
5995 std::string __str__() const throw(INTERP_KERNEL::Exception)
5997 return self->getRepr();
6000 std::string __repr__() const throw(INTERP_KERNEL::Exception)
6002 std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
6003 oss << self->getRepr();
6008 virtual ~DataArrayPartDefinition();
6011 class SlicePartDefinition : public PartDefinition
6014 static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
6015 int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
6018 SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
6020 return SlicePartDefinition::New(start,stop,step);
6023 PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
6026 self->getSlice(a,b,c);
6027 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
6030 std::string __str__() const throw(INTERP_KERNEL::Exception)
6032 return self->getRepr();
6035 std::string __repr__() const throw(INTERP_KERNEL::Exception)
6037 std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
6038 oss << self->getRepr();
6043 virtual ~SlicePartDefinition();
6049 __filename=os.environ.get('PYTHONSTARTUP')
6050 if __filename and os.path.isfile(__filename):
6051 execfile(__filename)