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::MEDCouplingFieldInt::buildSubPart;
243 %newobject MEDCoupling::MEDCouplingFieldInt::buildSubPartRange;
244 %newobject MEDCoupling::MEDCouplingFieldInt::__getitem__;
245 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
246 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
247 %newobject MEDCoupling::MEDCouplingMesh::clone;
248 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
249 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
250 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
251 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
252 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
253 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
254 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
255 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
256 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
257 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
258 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
259 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
260 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
261 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
262 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
263 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
264 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
265 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
266 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
267 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
268 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
269 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
270 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
271 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
272 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
273 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
274 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
275 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
276 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
277 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
278 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
279 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
280 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
281 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
282 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
283 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
284 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
285 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
286 %newobject MEDCoupling::MEDCouplingUMesh::New;
287 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
288 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
289 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
290 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
291 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
292 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
293 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
294 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
295 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
296 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
297 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
298 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
299 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
300 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
301 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
302 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
303 %newobject MEDCoupling::MEDCouplingUMesh::conformize3D;
304 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
305 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
306 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
307 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
308 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
309 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
310 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
311 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
312 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
313 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
314 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
315 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
316 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
317 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
318 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
319 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
320 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
321 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
322 %newobject MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords;
323 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
324 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
325 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
326 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
327 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
328 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
329 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
330 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
331 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
332 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
333 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
334 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
335 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
336 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
337 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
338 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
339 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
340 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
341 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
342 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
343 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
344 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
345 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
346 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
347 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
348 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
349 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
350 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
351 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
352 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
353 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
354 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
355 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
356 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
357 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
358 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
359 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
360 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
361 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
362 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
363 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
364 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
365 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
366 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
367 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
368 %newobject MEDCoupling::MEDCouplingCMesh::New;
369 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
370 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
371 %newobject MEDCoupling::MEDCouplingIMesh::New;
372 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
373 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
374 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
375 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
376 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
377 %newobject MEDCoupling::MEDCouplingMultiFields::New;
378 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
379 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
380 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
381 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
382 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
383 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
384 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
385 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
386 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
387 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
388 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
389 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
390 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
391 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
392 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
393 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
394 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
395 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
396 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
397 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
398 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
399 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
400 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
401 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
402 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
403 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
404 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
405 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
406 %newobject MEDCoupling::DenseMatrix::New;
407 %newobject MEDCoupling::DenseMatrix::deepCopy;
408 %newobject MEDCoupling::DenseMatrix::shallowCpy;
409 %newobject MEDCoupling::DenseMatrix::getData;
410 %newobject MEDCoupling::DenseMatrix::matVecMult;
411 %newobject MEDCoupling::DenseMatrix::MatVecMult;
412 %newobject MEDCoupling::DenseMatrix::__add__;
413 %newobject MEDCoupling::DenseMatrix::__sub__;
414 %newobject MEDCoupling::DenseMatrix::__mul__;
415 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
416 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
417 %newobject MEDCoupling::MEDCouplingSkyLineArray::BuildFromPolyhedronConn;
419 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
420 %feature("unref") MEDCouplingMesh "$this->decrRef();"
421 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
422 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
423 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
424 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
425 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
426 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
427 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
428 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
429 %feature("unref") MEDCouplingField "$this->decrRef();"
430 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
431 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
432 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
433 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
434 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
435 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
436 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
437 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
438 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
439 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
440 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
441 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
442 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
443 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
444 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
445 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
446 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
447 %feature("unref") DenseMatrix "$this->decrRef();"
448 %feature("unref") MEDCouplingSkyLineArray "$this->decrRef();"
450 %rename(assign) *::operator=;
451 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
452 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
453 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
454 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
458 %rename (InterpKernelException) INTERP_KERNEL::Exception;
460 %include "MEDCouplingRefCountObject.i"
461 %include "MEDCouplingMemArray.i"
463 namespace INTERP_KERNEL
466 * \class BoxSplittingOptions
467 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
469 class BoxSplittingOptions
472 BoxSplittingOptions();
473 void init() throw(INTERP_KERNEL::Exception);
474 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
475 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
476 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
477 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
478 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
479 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
480 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
481 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
482 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
483 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
484 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
485 std::string printOptions() const throw(INTERP_KERNEL::Exception);
488 std::string __str__() const throw(INTERP_KERNEL::Exception)
490 return self->printOptions();
496 namespace MEDCoupling
512 CONST_ON_TIME_INTERVAL = 7
513 } TypeOfTimeDiscretization;
521 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
522 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
524 } MEDCouplingMeshType;
527 class DataArrayDouble;
528 class MEDCouplingUMesh;
529 class MEDCouplingCMesh;
530 class MEDCouplingFieldDouble;
532 %extend RefCountObject
534 std::string getHiddenCppPointer() const
536 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
541 %extend MEDCouplingGaussLocalization
543 std::string __str__() const throw(INTERP_KERNEL::Exception)
545 return self->getStringRepr();
548 std::string __repr__() const throw(INTERP_KERNEL::Exception)
550 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
551 oss << self->getStringRepr();
558 class MEDCouplingMesh : public RefCountObject, public TimeLabel
561 void setName(const std::string& name);
562 std::string getName() const;
563 void setDescription(const std::string& descr);
564 std::string getDescription() const;
565 void setTime(double val, int iteration, int order);
566 void setTimeUnit(const std::string& unit);
567 std::string getTimeUnit() const;
568 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
569 bool isStructured() const throw(INTERP_KERNEL::Exception);
570 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
571 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
572 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
573 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
574 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
575 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
576 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
577 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
578 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
579 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
580 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
581 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
582 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
583 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
584 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
585 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
586 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
587 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
588 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
589 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
590 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
591 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
592 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
593 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
594 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
595 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
596 virtual std::string getVTKFileExtension() const;
597 std::string getVTKFileNameOf(const std::string& fileName) const;
599 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
600 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
601 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
602 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
603 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
604 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
605 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
606 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
607 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
608 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
609 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);
610 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
611 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
612 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
613 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
614 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
615 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
616 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
619 std::string __str__() const throw(INTERP_KERNEL::Exception)
621 return self->simpleRepr();
624 PyObject *getTime() throw(INTERP_KERNEL::Exception)
627 double tmp0=self->getTime(tmp1,tmp2);
628 PyObject *res = PyList_New(3);
629 PyList_SetItem(res,0,SWIG_From_double(tmp0));
630 PyList_SetItem(res,1,SWIG_From_int(tmp1));
631 PyList_SetItem(res,2,SWIG_From_int(tmp2));
635 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
637 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
638 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
644 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
648 DataArrayDoubleTuple *aa;
649 std::vector<double> bb;
651 int spaceDim=self->getSpaceDimension();
652 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
653 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
654 return self->getCellContainingPoint(pos,eps);
657 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
661 DataArrayDoubleTuple *aa;
662 std::vector<double> bb;
664 int spaceDim=self->getSpaceDimension();
665 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
666 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
667 MCAuto<DataArrayInt> elts,eltsIndex;
668 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
669 PyObject *ret=PyTuple_New(2);
670 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
671 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
675 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
677 MCAuto<DataArrayInt> elts,eltsIndex;
678 int spaceDim=self->getSpaceDimension();
680 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
681 if (!SWIG_IsOK(res1))
684 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
685 int nbOfPoints=size/spaceDim;
688 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
690 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
694 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
696 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
697 da2->checkAllocated();
698 int size=da2->getNumberOfTuples();
699 int nbOfCompo=da2->getNumberOfComponents();
700 if(nbOfCompo!=spaceDim)
702 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
704 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
706 PyObject *ret=PyTuple_New(2);
707 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
708 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
712 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
716 DataArrayDoubleTuple *aa;
717 std::vector<double> bb;
719 int spaceDim=self->getSpaceDimension();
720 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
721 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
722 std::vector<int> elts;
723 self->getCellsContainingPoint(pos,eps,elts);
724 DataArrayInt *ret=DataArrayInt::New();
725 ret->alloc((int)elts.size(),1);
726 std::copy(elts.begin(),elts.end(),ret->getPointer());
727 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
730 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
732 MCAuto<DataArrayInt> d0=DataArrayInt::New();
733 MCAuto<DataArrayInt> d1=DataArrayInt::New();
734 self->getReverseNodalConnectivity(d0,d1);
735 PyObject *ret=PyTuple_New(2);
736 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
737 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
741 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
744 int v0; std::vector<int> v1;
745 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
746 self->renumberCells(ids,check);
749 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
751 DataArrayInt *cellCor, *nodeCor;
752 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
753 PyObject *res = PyList_New(2);
754 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
755 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
759 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
761 DataArrayInt *cellCor=0,*nodeCor=0;
762 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
763 PyObject *res = PyList_New(2);
764 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
765 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
769 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
771 DataArrayInt *cellCor=0;
772 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
776 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
779 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
780 if (!SWIG_IsOK(res1))
783 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
784 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
788 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
790 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
791 da2->checkAllocated();
792 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
795 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
797 std::vector<int> conn;
798 self->getNodeIdsOfCell(cellId,conn);
799 return convertIntArrToPyList2(conn);
802 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
804 std::vector<double> coo;
805 self->getCoordinatesOfNode(nodeId,coo);
806 return convertDblArrToPyList2(coo);
809 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
813 DataArrayDoubleTuple *aa;
814 std::vector<double> bb;
816 int spaceDim=self->getSpaceDimension();
817 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
818 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
819 self->scale(pointPtr,factor);
822 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
824 int spaceDim=self->getSpaceDimension();
825 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
826 self->getBoundingBox(tmp);
827 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
831 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
834 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
835 PyObject *ret=PyTuple_New(2);
836 PyObject *ret0Py=ret0?Py_True:Py_False;
838 PyTuple_SetItem(ret,0,ret0Py);
839 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
843 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
845 int szArr,sw,iTypppArr;
846 std::vector<int> stdvecTyyppArr;
847 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
848 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
849 if(sw==3)//DataArrayInt
851 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
852 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
853 std::string name=argpt->getName();
855 ret->setName(name.c_str());
857 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
860 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
862 int szArr,sw,iTypppArr;
863 std::vector<int> stdvecTyyppArr;
865 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
866 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
867 if(sw==3)//DataArrayInt
869 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
870 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
871 std::string name=argpt->getName();
873 ret->setName(name.c_str());
876 PyObject *res = PyList_New(2);
877 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
878 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
879 PyList_SetItem(res,0,obj0);
880 PyList_SetItem(res,1,obj1);
884 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
888 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
889 PyObject *res = PyTuple_New(2);
890 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
893 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
895 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
896 PyTuple_SetItem(res,0,obj0);
897 PyTuple_SetItem(res,1,obj1);
901 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
903 std::vector<int> vals=self->getDistributionOfTypes();
905 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
906 PyObject *ret=PyList_New((int)vals.size()/3);
907 for(int j=0;j<(int)vals.size()/3;j++)
909 PyObject *ret1=PyList_New(3);
910 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
911 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
912 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
913 PyList_SetItem(ret,j,ret1);
918 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
920 std::vector<int> code;
921 std::vector<const DataArrayInt *> idsPerType;
922 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
923 convertPyToNewIntArr4(li,1,3,code);
924 return self->checkTypeConsistencyAndContig(code,idsPerType);
927 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
929 std::vector<int> code;
930 std::vector<DataArrayInt *> idsInPflPerType;
931 std::vector<DataArrayInt *> idsPerType;
932 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
933 PyObject *ret=PyTuple_New(3);
936 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
937 PyObject *ret0=PyList_New((int)code.size()/3);
938 for(int j=0;j<(int)code.size()/3;j++)
940 PyObject *ret00=PyList_New(3);
941 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
942 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
943 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
944 PyList_SetItem(ret0,j,ret00);
946 PyTuple_SetItem(ret,0,ret0);
948 PyObject *ret1=PyList_New(idsInPflPerType.size());
949 for(std::size_t j=0;j<idsInPflPerType.size();j++)
950 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
951 PyTuple_SetItem(ret,1,ret1);
952 int n=idsPerType.size();
953 PyObject *ret2=PyList_New(n);
955 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
956 PyTuple_SetItem(ret,2,ret2);
960 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
964 DataArrayDoubleTuple *aa;
965 std::vector<double> bb;
967 int spaceDim=self->getSpaceDimension();
968 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
969 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
970 self->translate(vectorPtr);
973 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
975 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
978 DataArrayDoubleTuple *aa;
979 std::vector<double> bb;
981 int spaceDim=self->getSpaceDimension();
982 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
983 self->rotate(centerPtr,0,alpha);
986 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
988 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
990 DataArrayDouble *a,*a2;
991 DataArrayDoubleTuple *aa,*aa2;
992 std::vector<double> bb,bb2;
994 int spaceDim=self->getSpaceDimension();
995 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
996 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
997 self->rotate(centerPtr,vectorPtr,alpha);
1000 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1002 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1003 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1004 PyObject *res=PyList_New(result.size());
1005 for(int i=0;iL!=result.end(); i++, iL++)
1006 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1010 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
1012 std::vector<double> a0;
1013 std::vector<int> a1;
1014 std::vector<std::string> a2;
1015 self->getTinySerializationInformation(a0,a1,a2);
1016 PyObject *ret(PyTuple_New(3));
1017 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1018 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1020 PyObject *ret2(PyList_New(sz));
1022 for(int i=0;i<sz;i++)
1023 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1025 PyTuple_SetItem(ret,2,ret2);
1029 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1031 DataArrayInt *a0Tmp(0);
1032 DataArrayDouble *a1Tmp(0);
1033 self->serialize(a0Tmp,a1Tmp);
1034 PyObject *ret(PyTuple_New(2));
1035 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1036 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1040 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1042 std::vector<std::string> littleStrings;
1043 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1046 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1047 {// put an empty dict in input to say to __new__ to call __init__...
1048 PyObject *ret(PyTuple_New(1));
1049 PyObject *ret0(PyDict_New());
1050 PyTuple_SetItem(ret,0,ret0);
1054 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1056 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1057 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1058 PyObject *ret(PyTuple_New(2));
1059 PyTuple_SetItem(ret,0,ret0);
1060 PyTuple_SetItem(ret,1,ret1);
1064 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1066 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1067 if(!PyTuple_Check(inp))
1068 throw INTERP_KERNEL::Exception(MSG);
1069 int sz(PyTuple_Size(inp));
1071 throw INTERP_KERNEL::Exception(MSG);
1072 PyObject *elt0(PyTuple_GetItem(inp,0));
1073 PyObject *elt1(PyTuple_GetItem(inp,1));
1074 std::vector<double> a0;
1075 std::vector<int> a1;
1076 std::vector<std::string> a2;
1077 DataArrayInt *b0(0);
1078 DataArrayDouble *b1(0);
1080 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1081 throw INTERP_KERNEL::Exception(MSG);
1082 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1084 fillArrayWithPyListDbl3(a0py,tmp,a0);
1085 convertPyToNewIntArr3(a1py,a1);
1086 fillStringVector(a2py,a2);
1089 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1090 throw INTERP_KERNEL::Exception(MSG);
1091 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1093 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1094 if(!SWIG_IsOK(status))
1095 throw INTERP_KERNEL::Exception(MSG);
1096 b0=reinterpret_cast<DataArrayInt *>(argp);
1097 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1098 if(!SWIG_IsOK(status))
1099 throw INTERP_KERNEL::Exception(MSG);
1100 b1=reinterpret_cast<DataArrayDouble *>(argp);
1102 // useless here to call resizeForUnserialization because arrays are well resized.
1103 self->unserialization(a0,a1,b0,b1,a2);
1106 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1108 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1109 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1110 return MEDCouplingMesh::MergeMeshes(tmp);
1116 //== MEDCouplingMesh End
1118 %include "NormalizedGeometricTypes"
1119 %include "MEDCouplingNatureOfFieldEnum"
1121 namespace MEDCoupling
1123 class MEDCouplingNatureOfField
1126 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1127 static std::string GetReprNoThrow(NatureOfField nat);
1128 static std::string GetAllPossibilitiesStr();
1132 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1133 // include "MEDCouplingTimeDiscretization.i"
1135 namespace MEDCoupling
1137 class MEDCouplingGaussLocalization
1140 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1141 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1142 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1143 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1144 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1145 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1146 int getDimension() const throw(INTERP_KERNEL::Exception);
1147 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1148 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1149 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1150 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1152 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1153 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1154 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1155 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1156 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1157 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1158 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1159 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1160 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1161 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1162 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1163 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1165 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1169 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const throw(INTERP_KERNEL::Exception)
1171 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1175 MEDCouplingUMesh *buildRefCell() const throw(INTERP_KERNEL::Exception)
1177 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1183 class MEDCouplingSkyLineArray
1186 static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayInt* c, const DataArrayInt* cI ) throw(INTERP_KERNEL::Exception);
1188 void set( DataArrayInt* index, DataArrayInt* value );
1189 void set3( DataArrayInt* superIndex, DataArrayInt* index, DataArrayInt* value );
1191 int getSuperNumberOf() const;
1192 int getNumberOf() const;
1193 int getLength() const;
1195 DataArrayInt* getSuperIndexArray() const;
1196 DataArrayInt* getIndexArray() const;
1197 DataArrayInt* getValuesArray() const;
1199 void deletePack(const int i, const int j) throw(INTERP_KERNEL::Exception);
1203 MEDCouplingSkyLineArray() throw(INTERP_KERNEL::Exception)
1205 return MEDCouplingSkyLineArray::New();
1208 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value) throw(INTERP_KERNEL::Exception)
1210 return MEDCouplingSkyLineArray::New(index, value);
1213 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value ) throw(INTERP_KERNEL::Exception)
1215 return MEDCouplingSkyLineArray::New(index, value);
1218 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other ) throw(INTERP_KERNEL::Exception)
1220 return MEDCouplingSkyLineArray::New(other);
1223 std::string __str__() const throw(INTERP_KERNEL::Exception)
1225 return self->simpleRepr();
1228 PyObject *getSimplePackSafe(int absolutePackId) const throw(INTERP_KERNEL::Exception)
1230 std::vector<int> ret;
1231 self->getSimplePackSafe(absolutePackId,ret);
1232 return convertIntArrToPyList2(ret);
1235 PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const throw(INTERP_KERNEL::Exception)
1237 std::vector<int> vpack, vspIdx, out;
1239 convertPyToNewIntArr3(superPackIndices,vspIdx);
1240 convertPyToNewIntArr3(pack,vpack);
1242 self->findPackIds(vspIdx, vpack.data(), vpack.data()+vpack.size(), out);
1243 return convertIntArrToPyList2(out);
1246 void pushBackPack(const int i, PyObject *pack) throw(INTERP_KERNEL::Exception)
1248 std::vector<int> vpack;
1249 convertPyToNewIntArr3(pack,vpack);
1250 self->pushBackPack(i,vpack.data(), vpack.data()+vpack.size());
1253 void replaceSimplePack(const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1255 std::vector<int> vpack;
1256 convertPyToNewIntArr3(pack,vpack);
1257 self->replaceSimplePack(idx, vpack.data(), vpack.data()+vpack.size());
1260 void replacePack(const int superIdx, const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1262 std::vector<int> vpack;
1263 convertPyToNewIntArr3(pack,vpack);
1264 self->replacePack(superIdx, idx, vpack.data(), vpack.data()+vpack.size());
1267 PyObject *convertToPolyhedronConn() const throw(INTERP_KERNEL::Exception)
1269 MCAuto<DataArrayInt> d0=DataArrayInt::New();
1270 MCAuto<DataArrayInt> d1=DataArrayInt::New();
1271 self->convertToPolyhedronConn(d0,d1);
1272 PyObject *ret=PyTuple_New(2);
1273 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1274 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1281 %include "MEDCouplingFieldDiscretization.i"
1283 //== MEDCouplingPointSet
1285 namespace MEDCoupling
1287 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1290 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1291 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1292 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1293 void zipCoords() throw(INTERP_KERNEL::Exception);
1294 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1295 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1296 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1297 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1298 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1299 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1300 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1301 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1302 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1303 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1304 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1305 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1306 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1307 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1308 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1309 virtual DataArrayInt *findBoundaryNodes() const;
1310 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1311 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1312 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1313 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1314 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1315 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1316 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1317 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1318 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1321 std::string __str__() const throw(INTERP_KERNEL::Exception)
1323 return self->simpleRepr();
1326 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1329 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1330 PyObject *res = PyList_New(2);
1331 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1332 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1336 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1338 DataArrayInt *comm, *commIndex;
1339 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1340 PyObject *res = PyList_New(2);
1341 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1342 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1346 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1348 DataArrayDouble *ret1=self->getCoords();
1351 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1354 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1356 int szArr,sw,iTypppArr;
1357 std::vector<int> stdvecTyyppArr;
1358 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1359 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1360 if(sw==3)//DataArrayInt
1362 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1363 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1364 std::string name=argpt->getName();
1366 ret->setName(name.c_str());
1368 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1371 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1373 int szArr,sw,iTypppArr;
1374 std::vector<int> stdvecTyyppArr;
1375 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1376 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1377 if(sw==3)//DataArrayInt
1379 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1380 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1381 std::string name=argpt->getName();
1383 ret->setName(name.c_str());
1385 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1388 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1390 int szArr,sw,iTypppArr;
1391 std::vector<int> stdvecTyyppArr;
1392 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1393 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1394 if(sw==3)//DataArrayInt
1396 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1397 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1398 std::string name=argpt->getName();
1400 ret->setName(name.c_str());
1402 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1405 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1407 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1408 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1411 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1413 int szArr,sw,iTypppArr;
1414 std::vector<int> stdvecTyyppArr;
1415 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1416 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1417 if(sw==3)//DataArrayInt
1419 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1420 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1421 std::string name=argpt->getName();
1423 ret->setName(name.c_str());
1425 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1428 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1430 int szArr,sw,iTypppArr;
1431 std::vector<int> stdvecTyyppArr;
1432 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1433 self->renumberNodes(tmp,newNbOfNodes);
1436 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1438 int szArr,sw,iTypppArr;
1439 std::vector<int> stdvecTyyppArr;
1440 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1441 self->renumberNodesCenter(tmp,newNbOfNodes);
1444 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1446 int spaceDim=self->getSpaceDimension();
1448 DataArrayDouble *a,*a2;
1449 DataArrayDoubleTuple *aa,*aa2;
1450 std::vector<double> bb,bb2;
1452 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1453 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1454 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1455 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1456 std::vector<int> nodes;
1457 self->findNodesOnLine(p,v,eps,nodes);
1458 DataArrayInt *ret=DataArrayInt::New();
1459 ret->alloc((int)nodes.size(),1);
1460 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1461 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1463 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1465 int spaceDim=self->getSpaceDimension();
1467 DataArrayDouble *a,*a2;
1468 DataArrayDoubleTuple *aa,*aa2;
1469 std::vector<double> bb,bb2;
1471 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1472 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1473 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1474 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1475 std::vector<int> nodes;
1476 self->findNodesOnPlane(p,v,eps,nodes);
1477 DataArrayInt *ret=DataArrayInt::New();
1478 ret->alloc((int)nodes.size(),1);
1479 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1480 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1483 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1487 DataArrayDoubleTuple *aa;
1488 std::vector<double> bb;
1490 int spaceDim=self->getSpaceDimension();
1491 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1492 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1493 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1494 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1497 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1499 DataArrayInt *c=0,*cI=0;
1503 DataArrayDoubleTuple *aa;
1504 std::vector<double> bb;
1506 int spaceDim=self->getSpaceDimension();
1507 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1508 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1509 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1510 PyObject *ret=PyTuple_New(2);
1511 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1512 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1516 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1518 DataArrayInt *c=0,*cI=0;
1519 int spaceDim=self->getSpaceDimension();
1522 DataArrayDoubleTuple *aa;
1523 std::vector<double> bb;
1526 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1527 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1529 PyObject *ret=PyTuple_New(2);
1530 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1531 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1535 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1539 DataArrayDoubleTuple *aa;
1540 std::vector<double> bb;
1542 int spaceDim=self->getSpaceDimension();
1543 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1544 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1546 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1547 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1550 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1554 std::vector<int> multiVal;
1555 std::pair<int, std::pair<int,int> > slic;
1556 MEDCoupling::DataArrayInt *daIntTyypp=0;
1557 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1561 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1563 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1565 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1567 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1571 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1573 DataArrayInt *v0=0,*v1=0;
1574 self->findCommonCells(compType,startCellId,v0,v1);
1575 PyObject *res = PyList_New(2);
1576 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1577 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1582 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1585 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1586 if (!SWIG_IsOK(res1))
1589 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1590 self->renumberNodesInConn(tmp);
1594 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1596 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1597 da2->checkAllocated();
1598 self->renumberNodesInConn(da2->getConstPointer());
1602 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1605 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1606 PyObject *ret=PyTuple_New(2);
1607 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1608 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1612 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1614 DataArrayInt *ret=0;
1616 int szArr,sw,iTypppArr;
1617 std::vector<int> stdvecTyyppArr;
1618 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1619 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1623 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1627 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1628 PyObject *res = PyList_New(3);
1629 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1630 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1631 PyList_SetItem(res,2,SWIG_From_int(ret2));
1635 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1639 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1640 PyObject *res = PyList_New(3);
1641 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1642 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1643 PyList_SetItem(res,2,SWIG_From_int(ret2));
1647 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1650 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1651 if (!SWIG_IsOK(res1))
1654 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1655 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1659 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1661 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1662 da2->checkAllocated();
1663 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1667 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1671 std::vector<int> multiVal;
1672 std::pair<int, std::pair<int,int> > slic;
1673 MEDCoupling::DataArrayInt *daIntTyypp=0;
1674 int nbc=self->getNumberOfCells();
1675 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1682 std::ostringstream oss;
1683 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1684 throw INTERP_KERNEL::Exception(oss.str().c_str());
1687 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1692 int tmp=nbc+singleVal;
1693 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1697 std::ostringstream oss;
1698 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1699 throw INTERP_KERNEL::Exception(oss.str().c_str());
1705 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1709 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1714 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1715 daIntTyypp->checkAllocated();
1716 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1719 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1723 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1726 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1727 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1728 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1729 for(int i=0;i<sz;i++)
1730 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1733 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1736 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1738 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1739 std::vector<double> val3;
1740 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1741 "Rotate2DAlg",2,true,nbNodes);
1743 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1744 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1747 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1750 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1751 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1752 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1753 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1754 for(int i=0;i<sz;i++)
1755 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1758 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1761 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1763 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1764 std::vector<double> val3;
1765 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1766 "Rotate3DAlg",3,true,nbNodes);
1768 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1769 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1770 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1775 //== MEDCouplingPointSet End
1777 class MEDCouplingUMeshCell
1780 INTERP_KERNEL::NormalizedCellType getType() const;
1783 std::string __str__() const throw(INTERP_KERNEL::Exception)
1785 return self->repr();
1788 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1791 const int *r=self->getAllConn(ret2);
1792 PyObject *ret=PyTuple_New(ret2);
1793 for(int i=0;i<ret2;i++)
1794 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1800 class MEDCouplingUMeshCellIterator
1807 MEDCouplingUMeshCell *ret=self->nextt();
1809 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1812 PyErr_SetString(PyExc_StopIteration,"No more data.");
1819 class MEDCouplingUMeshCellByTypeIterator
1822 ~MEDCouplingUMeshCellByTypeIterator();
1827 MEDCouplingUMeshCellEntry *ret=self->nextt();
1829 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1832 PyErr_SetString(PyExc_StopIteration,"No more data.");
1839 class MEDCouplingUMeshCellByTypeEntry
1842 ~MEDCouplingUMeshCellByTypeEntry();
1845 MEDCouplingUMeshCellByTypeIterator *__iter__()
1847 return self->iterator();
1852 class MEDCouplingUMeshCellEntry
1855 INTERP_KERNEL::NormalizedCellType getType() const;
1856 int getNumberOfElems() const;
1859 MEDCouplingUMeshCellIterator *__iter__()
1861 return self->iterator();
1866 //== MEDCouplingUMesh
1868 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1871 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1872 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1873 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1874 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1875 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1876 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1877 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1878 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1879 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1880 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1881 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1882 void computeTypes() throw(INTERP_KERNEL::Exception);
1883 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1884 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1886 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1887 DataArrayInt *conformize3D(double eps) throw(INTERP_KERNEL::Exception);
1888 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1889 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1890 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1891 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1892 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1893 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1894 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1895 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1896 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1897 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1898 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1899 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1900 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1901 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1902 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1903 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1904 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1905 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1906 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1907 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1908 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1909 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1910 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1911 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1912 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1913 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1914 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1915 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1916 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1917 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1918 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1919 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1920 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1921 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1922 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1923 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1924 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1925 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1926 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1927 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1928 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1929 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1930 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1931 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1932 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);
1933 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1934 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1935 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1936 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1937 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1939 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1941 return MEDCouplingUMesh::New();
1944 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1946 return MEDCouplingUMesh::New(meshName,meshDim);
1950 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1952 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1955 std::string __str__() const throw(INTERP_KERNEL::Exception)
1957 return self->simpleRepr();
1960 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1962 std::ostringstream oss;
1963 self->reprQuickOverview(oss);
1967 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1969 return self->cellIterator();
1972 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
1974 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
1978 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1980 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1981 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1982 PyObject *res=PyList_New(result.size());
1983 for(int i=0;iL!=result.end(); i++, iL++)
1984 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1988 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1992 std::vector<int> multiVal;
1993 std::pair<int, std::pair<int,int> > slic;
1994 MEDCoupling::DataArrayInt *daIntTyypp=0;
1995 int nbc=self->getNumberOfCells();
1996 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2003 std::ostringstream oss;
2004 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2005 throw INTERP_KERNEL::Exception(oss.str().c_str());
2009 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2016 int tmp=nbc+singleVal;
2017 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2022 std::ostringstream oss;
2023 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2024 throw INTERP_KERNEL::Exception(oss.str().c_str());
2030 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2036 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2037 daIntTyypp->checkAllocated();
2038 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2042 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
2046 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2050 std::vector<int> multiVal;
2051 std::pair<int, std::pair<int,int> > slic;
2052 MEDCoupling::DataArrayInt *daIntTyypp=0;
2053 int nbc=self->getNumberOfCells();
2054 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2061 std::ostringstream oss;
2062 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2063 throw INTERP_KERNEL::Exception(oss.str().c_str());
2067 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2074 int tmp=nbc+singleVal;
2075 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2080 std::ostringstream oss;
2081 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2082 throw INTERP_KERNEL::Exception(oss.str().c_str());
2088 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2093 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2099 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2100 daIntTyypp->checkAllocated();
2101 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2105 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2109 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2111 int szArr,sw,iTypppArr;
2112 std::vector<int> stdvecTyyppArr;
2113 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2116 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2117 throw INTERP_KERNEL::Exception(oss.str().c_str());
2119 self->insertNextCell(type,size,tmp);
2122 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2124 int szArr,sw,iTypppArr;
2125 std::vector<int> stdvecTyyppArr;
2126 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2127 self->insertNextCell(type,szArr,tmp);
2130 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2132 DataArrayInt *ret=self->getNodalConnectivity();
2137 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2139 DataArrayInt *ret=self->getNodalConnectivityIndex();
2145 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2147 int szArr,sw,iTypppArr;
2148 std::vector<int> stdvecTyyppArr;
2149 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2150 int nbOfDepthPeelingPerformed=0;
2151 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2152 PyObject *res=PyTuple_New(2);
2153 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2154 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2158 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2160 DataArrayInt *v0=0,*v1=0;
2161 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2162 PyObject *res = PyList_New(2);
2163 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2164 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2168 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2172 DataArrayDoubleTuple *aa;
2173 std::vector<double> bb;
2175 int nbOfCompo=self->getSpaceDimension();
2176 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2179 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2180 PyObject *ret=PyTuple_New(2);
2181 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2182 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2186 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2188 DataArrayInt *ret1=0;
2189 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2190 PyObject *ret=PyTuple_New(2);
2191 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2192 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2196 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2199 DataArrayInt *ret1(0);
2200 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2201 PyObject *ret=PyTuple_New(3);
2202 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2203 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2204 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2208 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2210 std::vector<int> cells;
2211 self->checkButterflyCells(cells,eps);
2212 DataArrayInt *ret=DataArrayInt::New();
2213 ret->alloc((int)cells.size(),1);
2214 std::copy(cells.begin(),cells.end(),ret->getPointer());
2215 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2218 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2220 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2222 PyObject *ret = PyList_New(sz);
2223 for(int i=0;i<sz;i++)
2224 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2228 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2230 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2231 int sz=retCpp.size();
2232 PyObject *ret=PyList_New(sz);
2233 for(int i=0;i<sz;i++)
2234 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2238 static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2240 std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2241 int sz=retCpp.size();
2242 PyObject *ret=PyList_New(sz);
2243 for(int i=0;i<sz;i++)
2244 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2248 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2251 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2252 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2253 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2256 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2259 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2260 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2264 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2267 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2268 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2272 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2274 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2275 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2276 PyObject *ret=PyTuple_New(3);
2277 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2278 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2279 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2283 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2285 DataArrayInt *tmp0=0,*tmp1=0;
2286 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2287 PyObject *ret=PyTuple_New(2);
2288 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2289 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2293 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2297 std::vector<int> multiVal;
2298 std::pair<int, std::pair<int,int> > slic;
2299 MEDCoupling::DataArrayInt *daIntTyypp=0;
2300 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2304 return self->duplicateNodes(&singleVal,&singleVal+1);
2306 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2308 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2310 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2314 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2318 std::vector<int> multiVal;
2319 std::pair<int, std::pair<int,int> > slic;
2320 MEDCoupling::DataArrayInt *daIntTyypp=0;
2321 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2325 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2327 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2329 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2331 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2335 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2338 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2339 DataArrayInt *tmp0,*tmp1=0;
2340 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2341 PyObject *ret=PyTuple_New(2);
2342 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2343 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2347 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2349 DataArrayInt *ret0=0,*ret1=0;
2350 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2351 PyObject *ret=PyTuple_New(2);
2352 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2353 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2357 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2359 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2360 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2361 DataArrayInt *ret1=0,*ret2=0;
2362 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2363 PyObject *ret=PyTuple_New(3);
2364 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2365 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2366 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2370 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2372 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2373 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2374 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2375 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2378 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2381 std::vector<const MEDCouplingUMesh *> meshes;
2382 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2383 std::vector<DataArrayInt *> corr;
2384 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2386 PyObject *ret1=PyList_New(sz);
2387 for(int i=0;i<sz;i++)
2388 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2389 PyObject *ret=PyList_New(2);
2390 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2391 PyList_SetItem(ret,1,ret1);
2395 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2397 std::vector<MEDCouplingUMesh *> meshes;
2398 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2399 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2402 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2404 std::vector<MEDCouplingUMesh *> meshes;
2405 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2406 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2409 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2413 std::vector<int> multiVal;
2414 std::pair<int, std::pair<int,int> > slic;
2415 MEDCoupling::DataArrayInt *daIntTyypp=0;
2417 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2418 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2422 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2424 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2426 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2428 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2432 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2434 DataArrayInt *arrOut=0,*arrIndexOut=0;
2437 std::vector<int> multiVal;
2438 std::pair<int, std::pair<int,int> > slic;
2439 MEDCoupling::DataArrayInt *daIntTyypp=0;
2441 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2442 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2447 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2452 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2457 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2461 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2463 PyObject *ret=PyTuple_New(2);
2464 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2465 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2469 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2471 DataArrayInt *arrOut=0,*arrIndexOut=0;
2472 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2473 PyObject *ret=PyTuple_New(2);
2474 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2475 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2479 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2481 if(!PySlice_Check(slic))
2482 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2483 Py_ssize_t strt=2,stp=2,step=2;
2484 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2486 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2487 arrIndxIn->checkAllocated();
2488 if(arrIndxIn->getNumberOfComponents()!=1)
2489 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2490 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2491 DataArrayInt *arrOut=0,*arrIndexOut=0;
2492 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2493 PyObject *ret=PyTuple_New(2);
2494 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2495 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2499 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2500 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2501 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2503 DataArrayInt *arrOut=0,*arrIndexOut=0;
2506 std::vector<int> multiVal;
2507 std::pair<int, std::pair<int,int> > slic;
2508 MEDCoupling::DataArrayInt *daIntTyypp=0;
2510 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2511 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2516 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2521 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2526 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2530 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2532 PyObject *ret=PyTuple_New(2);
2533 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2534 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2538 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2539 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2543 std::vector<int> multiVal;
2544 std::pair<int, std::pair<int,int> > slic;
2545 MEDCoupling::DataArrayInt *daIntTyypp=0;
2547 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2548 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2553 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2558 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2563 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2567 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2571 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2575 DataArrayDoubleTuple *aa;
2576 std::vector<double> bb;
2578 int spaceDim=self->getSpaceDimension();
2579 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2580 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2582 std::vector<int> cells;
2583 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2584 DataArrayInt *ret=DataArrayInt::New();
2585 ret->alloc((int)cells.size(),1);
2586 std::copy(cells.begin(),cells.end(),ret->getPointer());
2587 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2590 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2594 DataArrayDoubleTuple *aa;
2595 std::vector<double> bb;
2597 int spaceDim=self->getSpaceDimension();
2598 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2599 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2600 self->orientCorrectly2DCells(v,polyOnly);
2603 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2605 std::vector<int> cells;
2606 self->arePolyhedronsNotCorrectlyOriented(cells);
2607 DataArrayInt *ret=DataArrayInt::New();
2608 ret->alloc((int)cells.size(),1);
2609 std::copy(cells.begin(),cells.end(),ret->getPointer());
2610 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2613 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2617 self->getFastAveragePlaneOfThis(vec,pos);
2619 std::copy(vec,vec+3,vals);
2620 std::copy(pos,pos+3,vals+3);
2621 return convertDblArrToPyListOfTuple(vals,3,2);
2624 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2626 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2627 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2628 return MEDCouplingUMesh::MergeUMeshes(tmp);
2631 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2634 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2635 PyObject *ret=PyTuple_New(2);
2636 PyObject *ret0Py=ret0?Py_True:Py_False;
2638 PyTuple_SetItem(ret,0,ret0Py);
2639 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2643 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2646 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2647 PyObject *ret=PyTuple_New(2);
2648 PyObject *ret0Py=ret0?Py_True:Py_False;
2650 PyTuple_SetItem(ret,0,ret0Py);
2651 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2655 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2657 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2658 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2659 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2660 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2661 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2662 PyObject *ret=PyTuple_New(5);
2663 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2664 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2665 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2666 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2667 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2671 PyObject *explodeIntoEdges() const throw(INTERP_KERNEL::Exception)
2673 MCAuto<DataArrayInt> desc,descIndex,revDesc,revDescIndx;
2674 MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2675 PyObject *ret=PyTuple_New(5);
2676 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2677 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2678 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2679 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2680 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2684 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2686 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2687 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2688 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2689 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2690 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2691 PyObject *ret=PyTuple_New(5);
2692 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2693 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2694 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2695 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2696 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2700 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2702 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2703 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2704 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2705 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2706 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2707 PyObject *ret=PyTuple_New(5);
2708 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2709 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2710 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2711 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2712 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2716 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2718 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2719 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2720 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2721 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2722 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2723 PyObject *ret=PyTuple_New(5);
2724 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2725 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2726 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2727 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2728 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2732 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2734 DataArrayInt *neighbors=0,*neighborsIdx=0;
2735 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2736 PyObject *ret=PyTuple_New(2);
2737 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2738 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2742 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2744 DataArrayInt *neighbors=0,*neighborsIdx=0;
2745 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2746 PyObject *ret=PyTuple_New(2);
2747 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2748 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2752 PyObject *computeEnlargedNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2754 MCAuto<DataArrayInt> neighbors,neighborsIdx;
2755 self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2756 PyObject *ret=PyTuple_New(2);
2757 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2758 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2762 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const throw(INTERP_KERNEL::Exception)
2764 MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
2765 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2766 PyObject *ret=PyTuple_New(2);
2767 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2768 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2772 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2774 DataArrayInt *neighbors=0,*neighborsIdx=0;
2775 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2776 PyObject *ret=PyTuple_New(2);
2777 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2778 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2782 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2784 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2785 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2786 DataArrayInt *d2,*d3,*d4,*dd5;
2787 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2788 PyObject *ret=PyTuple_New(7);
2789 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2790 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2791 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2792 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2793 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2794 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2795 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2799 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2802 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2803 da->checkAllocated();
2804 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2807 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2810 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2811 da->checkAllocated();
2812 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2815 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2818 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2819 da->checkAllocated();
2820 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2823 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2826 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2827 da->checkAllocated();
2828 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2829 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2830 PyObject *res = PyList_New(result.size());
2831 for (int i=0;iL!=result.end(); i++, iL++)
2832 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2836 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2839 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2840 da->checkAllocated();
2841 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2842 ret->setName(da->getName().c_str());
2846 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2848 DataArrayInt *cellNb1=0,*cellNb2=0;
2849 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2850 PyObject *ret=PyTuple_New(3);
2851 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2852 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2853 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2857 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2859 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2860 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2861 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2862 PyObject *ret(PyTuple_New(4));
2863 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2864 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2865 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2866 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2870 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2872 int spaceDim=self->getSpaceDimension();
2874 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2876 DataArrayDouble *a,*a2;
2877 DataArrayDoubleTuple *aa,*aa2;
2878 std::vector<double> bb,bb2;
2880 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2881 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2882 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2883 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2885 DataArrayInt *cellIds=0;
2886 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2887 PyObject *ret=PyTuple_New(2);
2888 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2889 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2893 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2895 int spaceDim=self->getSpaceDimension();
2897 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2899 DataArrayDouble *a,*a2;
2900 DataArrayDoubleTuple *aa,*aa2;
2901 std::vector<double> bb,bb2;
2903 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2904 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2905 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2906 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2908 DataArrayInt *cellIds=0;
2909 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2910 PyObject *ret=PyTuple_New(2);
2911 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2912 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2916 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2919 DataArrayDouble *a,*a2;
2920 DataArrayDoubleTuple *aa,*aa2;
2921 std::vector<double> bb,bb2;
2923 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st paramater for origin.";
2924 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd paramater for vector.";
2925 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2926 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2927 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2931 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2933 int spaceDim=self->getSpaceDimension();
2935 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2937 DataArrayDouble *a,*a2;
2938 DataArrayDoubleTuple *aa,*aa2;
2939 std::vector<double> bb,bb2;
2941 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2942 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2943 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2944 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2945 return self->getCellIdsCrossingPlane(orig,vect,eps);
2948 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2952 std::vector<int> pos2;
2953 DataArrayInt *pos3=0;
2954 DataArrayIntTuple *pos4=0;
2955 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2960 self->convertToPolyTypes(&pos1,&pos1+1);
2967 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2972 self->convertToPolyTypes(pos3->begin(),pos3->end());
2976 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2980 void convertAllToPoly();
2981 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2982 bool unPolyze() throw(INTERP_KERNEL::Exception);
2983 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2984 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2985 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2988 //== MEDCouplingUMesh End
2990 //== MEDCouplingMappedExtrudedMesh
2992 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
2995 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2996 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
2997 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2998 int get2DCellIdForExtrusion() const;
3000 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
3002 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3005 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
3007 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3010 MEDCouplingMappedExtrudedMesh()
3012 return MEDCouplingMappedExtrudedMesh::New();
3015 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3017 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
3020 std::string __str__() const throw(INTERP_KERNEL::Exception)
3022 return self->simpleRepr();
3025 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3027 std::ostringstream oss;
3028 self->reprQuickOverview(oss);
3032 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
3034 MEDCouplingUMesh *ret=self->getMesh2D();
3037 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3039 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
3041 MEDCouplingUMesh *ret=self->getMesh1D();
3044 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3046 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
3048 DataArrayInt *ret=self->getMesh3DIds();
3051 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3056 //== MEDCouplingMappedExtrudedMesh End
3058 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3061 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3062 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3063 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
3064 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
3065 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
3066 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
3069 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
3071 int szArr,sw,iTypppArr;
3072 std::vector<int> stdvecTyyppArr;
3073 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3074 self->insertNextCell(tmp,tmp+szArr);
3077 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3079 DataArrayInt *ret=self->getNodalConnectivity();
3080 if(ret) ret->incrRef();
3084 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3086 std::vector< const MEDCoupling1GTUMesh *> parts;
3087 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3088 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3093 //== MEDCoupling1SGTUMesh
3095 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3098 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3099 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3100 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
3101 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
3102 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
3103 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3104 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
3105 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
3106 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
3109 MEDCoupling1SGTUMesh()
3111 return MEDCoupling1SGTUMesh::New();
3114 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3116 return MEDCoupling1SGTUMesh::New(name,type);
3119 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3121 return MEDCoupling1SGTUMesh::New(m);
3124 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3126 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
3129 std::string __str__() const throw(INTERP_KERNEL::Exception)
3131 return self->simpleRepr();
3134 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3136 std::ostringstream oss;
3137 self->reprQuickOverview(oss);
3141 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3143 DataArrayInt *cellPerm(0),*nodePerm(0);
3144 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3145 PyObject *ret(PyTuple_New(3));
3146 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3147 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3148 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3152 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3154 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3155 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3156 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3159 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3161 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3162 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3163 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3168 //== MEDCoupling1SGTUMesh End
3170 //== MEDCoupling1DGTUMesh
3172 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3175 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3176 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3177 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3178 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3179 bool isPacked() const throw(INTERP_KERNEL::Exception);
3182 MEDCoupling1DGTUMesh()
3184 return MEDCoupling1DGTUMesh::New();
3186 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3188 return MEDCoupling1DGTUMesh::New(name,type);
3191 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3193 return MEDCoupling1DGTUMesh::New(m);
3196 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3198 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3201 std::string __str__() const throw(INTERP_KERNEL::Exception)
3203 return self->simpleRepr();
3206 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3208 std::ostringstream oss;
3209 self->reprQuickOverview(oss);
3213 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3215 DataArrayInt *ret=self->getNodalConnectivityIndex();
3216 if(ret) ret->incrRef();
3220 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3222 DataArrayInt *ret1=0,*ret2=0;
3223 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3224 PyObject *ret0Py=ret0?Py_True:Py_False;
3226 PyObject *ret=PyTuple_New(3);
3227 PyTuple_SetItem(ret,0,ret0Py);
3228 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3229 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3233 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3236 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3237 PyObject *ret=PyTuple_New(2);
3238 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3239 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3240 PyTuple_SetItem(ret,1,ret1Py);
3244 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3246 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3247 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3248 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3251 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3253 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3254 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3255 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3258 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3260 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3261 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3262 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3267 //== MEDCoupling1DGTUMeshEnd
3269 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3272 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3273 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3274 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3275 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3276 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3277 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3278 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3279 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3280 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3281 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3282 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3283 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3284 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3285 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3286 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3289 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3291 int tmpp1=-1,tmpp2=-1;
3292 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3293 std::vector< std::pair<int,int> > inp;
3297 for(int i=0;i<tmpp1;i++)
3298 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3303 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3304 inp.resize(tmpp1/2);
3305 for(int i=0;i<tmpp1/2;i++)
3306 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3309 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3310 return self->buildStructuredSubPart(inp);
3313 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3315 std::vector< std::pair<int,int> > inp;
3316 convertPyToVectorPairInt(part,inp);
3318 int szArr,sw,iTypppArr;
3319 std::vector<int> stdvecTyyppArr;
3320 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3321 std::vector<int> tmp5(tmp4,tmp4+szArr);
3323 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3326 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3328 std::vector< std::pair<int,int> > inp;
3329 convertPyToVectorPairInt(part,inp);
3330 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3333 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3335 std::vector< std::pair<int,int> > inp;
3336 convertPyToVectorPairInt(part,inp);
3337 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3340 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3342 std::vector< std::pair<int,int> > inp;
3343 convertPyToVectorPairInt(part,inp);
3344 std::vector<int> stWithGhost;
3345 std::vector< std::pair<int,int> > partWithGhost;
3346 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3347 PyObject *ret(PyTuple_New(2));
3348 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3349 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3353 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3355 std::vector< std::pair<int,int> > inp;
3356 convertPyToVectorPairInt(partCompactFormat,inp);
3357 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3360 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3362 std::vector< std::pair<int,int> > inp;
3363 convertPyToVectorPairInt(partCompactFormat,inp);
3364 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3367 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3369 std::vector< std::pair<int,int> > inp;
3370 convertPyToVectorPairInt(part,inp);
3371 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3374 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3376 int szArr,sw,iTypppArr;
3377 std::vector<int> stdvecTyyppArr;
3378 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3379 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3382 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3384 int szArr,sw,iTypppArr;
3385 std::vector<int> stdvecTyyppArr;
3386 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3387 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3390 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3392 std::vector< std::pair<int,int> > inp;
3393 convertPyToVectorPairInt(partCompactFormat,inp);
3394 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3397 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3399 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3400 PyObject *retPy=PyList_New(ret.size());
3401 for(std::size_t i=0;i<ret.size();i++)
3403 PyObject *tmp=PyTuple_New(2);
3404 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3405 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3406 PyList_SetItem(retPy,i,tmp);
3411 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3413 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3414 convertPyToVectorPairInt(r1,r1Cpp);
3415 convertPyToVectorPairInt(r2,r2Cpp);
3416 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3417 PyObject *retPy=PyList_New(ret.size());
3418 for(std::size_t i=0;i<ret.size();i++)
3420 PyObject *tmp=PyTuple_New(2);
3421 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3422 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3423 PyList_SetItem(retPy,i,tmp);
3428 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3430 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3431 convertPyToVectorPairInt(r1,r1Cpp);
3432 convertPyToVectorPairInt(r2,r2Cpp);
3433 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3436 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3438 int szArr,sw,iTypppArr;
3439 std::vector<int> stdvecTyyppArr;
3440 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3441 int szArr2,sw2,iTypppArr2;
3442 std::vector<int> stdvecTyyppArr2;
3443 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3444 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3445 std::vector< std::pair<int,int> > partCompactFormat;
3446 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3447 PyObject *ret=PyTuple_New(2);
3448 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3449 PyTuple_SetItem(ret,0,ret0Py);
3450 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3451 for(std::size_t i=0;i<partCompactFormat.size();i++)
3453 PyObject *tmp4=PyTuple_New(2);
3454 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3455 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3456 PyList_SetItem(ret1Py,i,tmp4);
3458 PyTuple_SetItem(ret,1,ret1Py);
3462 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3464 std::vector< std::pair<int,int> > param0,param1,ret;
3465 convertPyToVectorPairInt(bigInAbs,param0);
3466 convertPyToVectorPairInt(partOfBigInAbs,param1);
3467 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3468 PyObject *retPy(PyList_New(ret.size()));
3469 for(std::size_t i=0;i<ret.size();i++)
3471 PyObject *tmp(PyTuple_New(2));
3472 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3473 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3474 PyList_SetItem(retPy,i,tmp);
3479 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3481 std::vector< std::pair<int,int> > param0;
3482 convertPyToVectorPairInt(part,param0);
3483 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3484 PyObject *retPy(PyList_New(ret.size()));
3485 for(std::size_t i=0;i<ret.size();i++)
3487 PyObject *tmp(PyTuple_New(2));
3488 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3489 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3490 PyList_SetItem(retPy,i,tmp);
3495 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3497 std::vector< std::pair<int,int> > param0,param1;
3498 convertPyToVectorPairInt(startingFrom,param0);
3499 convertPyToVectorPairInt(goingTo,param1);
3500 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3503 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3505 std::vector< std::pair<int,int> > param0,param1,ret;
3506 convertPyToVectorPairInt(bigInAbs,param0);
3507 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3508 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3509 PyObject *retPy(PyList_New(ret.size()));
3510 for(std::size_t i=0;i<ret.size();i++)
3512 PyObject *tmp(PyTuple_New(2));
3513 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3514 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3515 PyList_SetItem(retPy,i,tmp);
3522 class MEDCouplingCurveLinearMesh;
3524 //== MEDCouplingCMesh
3526 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3529 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3530 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3531 void setCoords(const DataArrayDouble *coordsX,
3532 const DataArrayDouble *coordsY=0,
3533 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3534 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3535 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3537 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3539 return MEDCouplingCMesh::New();
3541 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3543 return MEDCouplingCMesh::New(meshName);
3546 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3548 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3550 std::string __str__() const throw(INTERP_KERNEL::Exception)
3552 return self->simpleRepr();
3554 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3556 std::ostringstream oss;
3557 self->reprQuickOverview(oss);
3560 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3562 DataArrayDouble *ret=self->getCoordsAt(i);
3570 //== MEDCouplingCMesh End
3572 //== MEDCouplingCurveLinearMesh
3574 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3577 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3578 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3579 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3581 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3583 return MEDCouplingCurveLinearMesh::New();
3585 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3587 return MEDCouplingCurveLinearMesh::New(meshName);
3589 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3591 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3593 std::string __str__() const throw(INTERP_KERNEL::Exception)
3595 return self->simpleRepr();
3597 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3599 std::ostringstream oss;
3600 self->reprQuickOverview(oss);
3603 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3605 DataArrayDouble *ret=self->getCoords();
3610 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3612 int szArr,sw,iTypppArr;
3613 std::vector<int> stdvecTyyppArr;
3614 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3615 self->setNodeGridStructure(tmp,tmp+szArr);
3620 //== MEDCouplingCurveLinearMesh End
3622 //== MEDCouplingIMesh
3624 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3627 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3629 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3630 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3631 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3632 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3633 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3634 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3635 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3636 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3637 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3638 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3639 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3644 return MEDCouplingIMesh::New();
3646 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3648 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3649 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3650 const int *nodeStrctPtr(0);
3651 const double *originPtr(0),*dxyzPtr(0);
3653 std::vector<int> bb0;
3654 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3657 std::vector<double> bb,bb2;
3659 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3660 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3662 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3665 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3667 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3670 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3672 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3675 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3678 std::vector<int> bb0;
3679 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3680 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3683 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3685 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3688 DataArrayDoubleTuple *aa;
3689 std::vector<double> bb;
3691 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3692 self->setOrigin(originPtr,originPtr+nbTuples);
3695 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3697 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3700 DataArrayDoubleTuple *aa;
3701 std::vector<double> bb;
3703 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3704 self->setDXYZ(originPtr,originPtr+nbTuples);
3707 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3709 std::vector< std::pair<int,int> > inp;
3710 convertPyToVectorPairInt(fineLocInCoarse,inp);
3711 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3714 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)
3716 std::vector< std::pair<int,int> > inp;
3717 convertPyToVectorPairInt(fineLocInCoarse,inp);
3718 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3721 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3723 std::vector< std::pair<int,int> > inp;
3724 convertPyToVectorPairInt(fineLocInCoarse,inp);
3725 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3728 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)
3730 std::vector< std::pair<int,int> > inp;
3731 convertPyToVectorPairInt(fineLocInCoarse,inp);
3732 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3735 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)
3737 std::vector< std::pair<int,int> > inp;
3738 convertPyToVectorPairInt(fineLocInCoarse,inp);
3739 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3742 std::string __str__() const throw(INTERP_KERNEL::Exception)
3744 return self->simpleRepr();
3746 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3748 std::ostringstream oss;
3749 self->reprQuickOverview(oss);
3755 //== MEDCouplingIMesh End
3759 namespace MEDCoupling
3761 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3764 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3765 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3766 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3767 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3768 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3769 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3770 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3771 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3772 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3773 std::string getName() const throw(INTERP_KERNEL::Exception);
3774 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3775 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3776 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3777 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3778 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3779 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3780 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3781 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3782 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3783 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3784 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3785 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3786 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3787 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3788 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3789 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3791 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3793 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3796 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3799 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3801 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3804 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3807 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3809 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3810 return convertIntArrToPyList3(ret);
3813 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3816 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3817 PyObject *ret=PyTuple_New(2);
3818 PyObject *ret0Py=ret0?Py_True:Py_False;
3820 PyTuple_SetItem(ret,0,ret0Py);
3821 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3825 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3827 DataArrayInt *ret1=0;
3828 MEDCouplingMesh *ret0=0;
3830 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3831 if (!SWIG_IsOK(res1))
3834 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3835 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3839 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3841 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3842 da2->checkAllocated();
3843 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3845 PyObject *res = PyList_New(2);
3846 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3847 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3851 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3853 DataArrayInt *ret1=0;
3855 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3856 PyObject *res=PyTuple_New(2);
3857 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3859 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3862 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3863 PyTuple_SetItem(res,1,res1);
3868 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3871 int v0; std::vector<int> v1;
3872 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3873 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3876 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3877 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3880 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3881 if (!SWIG_IsOK(res1))
3884 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3885 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3889 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3891 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3892 da2->checkAllocated();
3893 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3897 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3899 std::vector<int> tmp;
3900 self->getCellIdsHavingGaussLocalization(locId,tmp);
3901 DataArrayInt *ret=DataArrayInt::New();
3902 ret->alloc((int)tmp.size(),1);
3903 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3904 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3907 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3909 std::vector<int> inp0;
3910 convertPyToNewIntArr4(code,1,3,inp0);
3911 std::vector<const DataArrayInt *> inp1;
3912 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3913 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3918 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3921 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3922 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3923 static MEDCouplingFieldTemplate *New(TypeOfField type);
3924 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3925 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3928 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3930 return MEDCouplingFieldTemplate::New(f);
3933 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3935 return MEDCouplingFieldTemplate::New(f);
3938 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3940 return MEDCouplingFieldTemplate::New(type);
3943 std::string __str__() const throw(INTERP_KERNEL::Exception)
3945 return self->simpleRepr();
3948 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3950 std::ostringstream oss;
3951 self->reprQuickOverview(oss);
3957 class MEDCouplingFieldInt;
3959 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3962 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3963 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3964 void setTimeUnit(const std::string& unit);
3965 std::string getTimeUnit() const;
3966 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3967 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3968 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3969 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3970 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3971 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3972 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
3973 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3974 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3975 MEDCouplingFieldDouble *deepCopy() const;
3976 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
3977 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3978 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3979 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3980 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3981 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3982 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3983 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3984 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3985 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3986 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3987 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3988 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3989 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3990 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3991 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3992 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3993 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3994 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3995 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3996 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3997 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3998 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3999 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
4000 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
4001 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4002 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4003 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4004 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4005 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4006 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4007 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
4008 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
4009 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
4010 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
4011 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
4012 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
4013 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
4014 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
4015 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
4016 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
4017 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
4018 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
4019 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
4020 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4021 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4022 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4023 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4024 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4025 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4026 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
4027 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
4028 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
4029 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
4030 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
4031 double getMaxValue() const throw(INTERP_KERNEL::Exception);
4032 double getMinValue() const throw(INTERP_KERNEL::Exception);
4033 double getAverageValue() const throw(INTERP_KERNEL::Exception);
4034 double norm2() const throw(INTERP_KERNEL::Exception);
4035 double normMax() const throw(INTERP_KERNEL::Exception);
4036 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4037 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4038 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4039 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
4040 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
4041 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
4042 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
4043 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4044 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4045 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4046 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4047 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4048 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4049 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4050 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4051 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4052 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4053 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4054 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4055 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4056 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4057 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
4059 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4061 return MEDCouplingFieldDouble::New(type,td);
4064 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4066 return MEDCouplingFieldDouble::New(ft,td);
4069 std::string __str__() const throw(INTERP_KERNEL::Exception)
4071 return self->simpleRepr();
4074 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4076 std::ostringstream oss;
4077 self->reprQuickOverview(oss);
4081 MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
4083 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4087 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
4089 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4093 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4095 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4097 DataArrayDouble *a,*a2;
4098 DataArrayDoubleTuple *aa,*aa2;
4099 std::vector<double> bb,bb2;
4101 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4102 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4103 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4106 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
4108 DataArrayDouble *ret=self->getArray();
4114 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4116 std::vector<DataArrayDouble *> arrs=self->getArrays();
4117 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4121 PyObject *ret=PyTuple_New(sz);
4122 for(int i=0;i<sz;i++)
4125 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4127 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4132 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4134 std::vector<const DataArrayDouble *> tmp;
4135 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4137 std::vector<DataArrayDouble *> arrs(sz);
4138 for(int i=0;i<sz;i++)
4139 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4140 self->setArrays(arrs);
4143 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4145 DataArrayDouble *ret=self->getEndArray();
4151 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4155 DataArrayDoubleTuple *aa;
4156 std::vector<double> bb;
4158 const MEDCouplingMesh *mesh=self->getMesh();
4160 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4161 int spaceDim=mesh->getSpaceDimension();
4162 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4163 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4165 int sz=self->getNumberOfComponents();
4166 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4167 self->getValueOn(spaceLoc,res);
4168 return convertDblArrToPyList(res,sz);
4171 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4173 int sz=self->getNumberOfComponents();
4174 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4175 self->getValueOnPos(i,j,k,res);
4176 return convertDblArrToPyList(res,sz);
4179 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4181 const MEDCouplingMesh *mesh(self->getMesh());
4183 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4186 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4187 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4188 mesh->getSpaceDimension(),true,nbPts);
4189 return self->getValueOnMulti(inp,nbPts);
4192 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4196 DataArrayDoubleTuple *aa;
4197 std::vector<double> bb;
4199 const MEDCouplingMesh *mesh=self->getMesh();
4201 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4202 int spaceDim=mesh->getSpaceDimension();
4203 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4204 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4207 int sz=self->getNumberOfComponents();
4208 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4209 self->getValueOn(spaceLoc,time,res);
4210 return convertDblArrToPyList(res,sz);
4213 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4215 if(self->getArray()!=0)
4216 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4219 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4220 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4221 self->setArray(arr);
4225 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4228 double tmp0=self->getTime(tmp1,tmp2);
4229 PyObject *res = PyList_New(3);
4230 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4231 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4232 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4236 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4239 double tmp0=self->getStartTime(tmp1,tmp2);
4240 PyObject *res = PyList_New(3);
4241 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4242 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4243 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4247 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4250 double tmp0=self->getEndTime(tmp1,tmp2);
4251 PyObject *res = PyList_New(3);
4252 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4253 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4254 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4257 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4259 int sz=self->getNumberOfComponents();
4260 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4261 self->accumulate(tmp);
4262 return convertDblArrToPyList(tmp,sz);
4264 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4266 int sz=self->getNumberOfComponents();
4267 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4268 self->integral(isWAbs,tmp);
4269 return convertDblArrToPyList(tmp,sz);
4271 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4273 int sz=self->getNumberOfComponents();
4274 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4275 self->getWeightedAverageValue(tmp,isWAbs);
4276 return convertDblArrToPyList(tmp,sz);
4278 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4280 int sz=self->getNumberOfComponents();
4281 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4283 return convertDblArrToPyList(tmp,sz);
4285 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4287 int sz=self->getNumberOfComponents();
4288 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4290 return convertDblArrToPyList(tmp,sz);
4292 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4294 int szArr,sw,iTypppArr;
4295 std::vector<int> stdvecTyyppArr;
4296 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4297 self->renumberCells(tmp,check);
4300 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4302 int szArr,sw,iTypppArr;
4303 std::vector<int> stdvecTyyppArr;
4304 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4305 self->renumberCellsWithoutMesh(tmp,check);
4308 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4310 int szArr,sw,iTypppArr;
4311 std::vector<int> stdvecTyyppArr;
4312 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4313 self->renumberNodes(tmp,eps);
4316 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4318 int szArr,sw,iTypppArr;
4319 std::vector<int> stdvecTyyppArr;
4320 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4321 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4324 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4326 return fieldT_buildSubPart(self,li);
4329 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4331 return fieldT__getitem__(self,li);
4334 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4337 double r1=self->getMaxValue2(tmp);
4338 PyObject *ret=PyTuple_New(2);
4339 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4340 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4344 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4347 double r1=self->getMinValue2(tmp);
4348 PyObject *ret=PyTuple_New(2);
4349 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4350 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4354 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4356 std::vector<int> tmp;
4357 convertPyToNewIntArr3(li,tmp);
4358 return self->keepSelectedComponents(tmp);
4361 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4363 std::vector<int> tmp;
4364 convertPyToNewIntArr3(li,tmp);
4365 self->setSelectedComponents(f,tmp);
4368 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4371 DataArrayDouble *a,*a2;
4372 DataArrayDoubleTuple *aa,*aa2;
4373 std::vector<double> bb,bb2;
4376 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4377 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4378 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4379 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4381 return self->extractSlice3D(orig,vect,eps);
4384 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4386 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4389 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4391 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4394 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4396 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.";
4397 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4400 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4402 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4404 return (*self)-(*other);
4406 throw INTERP_KERNEL::Exception(msg);
4411 DataArrayDoubleTuple *aa;
4412 std::vector<double> bb;
4414 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4419 if(!self->getArray())
4420 throw INTERP_KERNEL::Exception(msg2);
4421 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4422 ret->applyLin(1.,-val);
4423 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4424 ret2->setArray(ret);
4429 if(!self->getArray())
4430 throw INTERP_KERNEL::Exception(msg2);
4431 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4432 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4433 ret2->setArray(ret);
4438 if(!self->getArray())
4439 throw INTERP_KERNEL::Exception(msg2);
4440 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4441 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4442 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4443 ret2->setArray(ret);
4448 if(!self->getArray())
4449 throw INTERP_KERNEL::Exception(msg2);
4450 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4451 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4452 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4453 ret2->setArray(ret);
4457 { throw INTERP_KERNEL::Exception(msg); }
4461 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4463 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4466 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4468 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4471 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4473 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4476 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4478 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.";
4479 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4482 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4484 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4486 return (*self)/(*other);
4488 throw INTERP_KERNEL::Exception(msg);
4493 DataArrayDoubleTuple *aa;
4494 std::vector<double> bb;
4496 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4502 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4503 if(!self->getArray())
4504 throw INTERP_KERNEL::Exception(msg2);
4505 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4506 ret->applyLin(1./val,0);
4507 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4508 ret2->setArray(ret);
4513 if(!self->getArray())
4514 throw INTERP_KERNEL::Exception(msg2);
4515 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4516 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4517 ret2->setArray(ret);
4522 if(!self->getArray())
4523 throw INTERP_KERNEL::Exception(msg2);
4524 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4525 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4526 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4527 ret2->setArray(ret);
4532 if(!self->getArray())
4533 throw INTERP_KERNEL::Exception(msg2);
4534 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4535 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4536 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4537 ret2->setArray(ret);
4541 { throw INTERP_KERNEL::Exception(msg); }
4545 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4547 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4550 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4552 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.";
4553 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4556 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4558 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4560 return (*self)^(*other);
4562 throw INTERP_KERNEL::Exception(msg);
4567 DataArrayDoubleTuple *aa;
4568 std::vector<double> bb;
4570 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4575 if(!self->getArray())
4576 throw INTERP_KERNEL::Exception(msg2);
4577 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4579 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4580 ret2->setArray(ret);
4585 if(!self->getArray())
4586 throw INTERP_KERNEL::Exception(msg2);
4587 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4588 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4589 ret2->setArray(ret);
4594 if(!self->getArray())
4595 throw INTERP_KERNEL::Exception(msg2);
4596 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4597 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4598 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4599 ret2->setArray(ret);
4604 if(!self->getArray())
4605 throw INTERP_KERNEL::Exception(msg2);
4606 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4607 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4608 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4609 ret2->setArray(ret);
4613 { throw INTERP_KERNEL::Exception(msg); }
4617 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4619 return self->negate();
4622 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4624 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.";
4625 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4628 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4630 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4634 Py_XINCREF(trueSelf);
4638 throw INTERP_KERNEL::Exception(msg);
4643 DataArrayDoubleTuple *aa;
4644 std::vector<double> bb;
4646 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4651 if(!self->getArray())
4652 throw INTERP_KERNEL::Exception(msg2);
4653 self->getArray()->applyLin(1.,val);
4654 Py_XINCREF(trueSelf);
4659 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4662 Py_XINCREF(trueSelf);
4667 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4668 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4669 ret2->setArray(aaa);
4671 Py_XINCREF(trueSelf);
4676 if(!self->getArray())
4677 throw INTERP_KERNEL::Exception(msg2);
4678 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4679 self->getArray()->addEqual(aaa);
4680 Py_XINCREF(trueSelf);
4684 { throw INTERP_KERNEL::Exception(msg); }
4688 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4690 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.";
4691 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4694 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4696 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4700 Py_XINCREF(trueSelf);
4704 throw INTERP_KERNEL::Exception(msg);
4709 DataArrayDoubleTuple *aa;
4710 std::vector<double> bb;
4712 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4717 if(!self->getArray())
4718 throw INTERP_KERNEL::Exception(msg2);
4719 self->getArray()->applyLin(1.,-val);
4720 Py_XINCREF(trueSelf);
4725 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4728 Py_XINCREF(trueSelf);
4733 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4734 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4735 ret2->setArray(aaa);
4737 Py_XINCREF(trueSelf);
4742 if(!self->getArray())
4743 throw INTERP_KERNEL::Exception(msg2);
4744 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4745 self->getArray()->substractEqual(aaa);
4746 Py_XINCREF(trueSelf);
4750 { throw INTERP_KERNEL::Exception(msg); }
4754 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4756 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.";
4757 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4760 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4762 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4766 Py_XINCREF(trueSelf);
4770 throw INTERP_KERNEL::Exception(msg);
4775 DataArrayDoubleTuple *aa;
4776 std::vector<double> bb;
4778 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4783 if(!self->getArray())
4784 throw INTERP_KERNEL::Exception(msg2);
4785 self->getArray()->applyLin(val,0);
4786 Py_XINCREF(trueSelf);
4791 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4794 Py_XINCREF(trueSelf);
4799 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4800 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4801 ret2->setArray(aaa);
4803 Py_XINCREF(trueSelf);
4808 if(!self->getArray())
4809 throw INTERP_KERNEL::Exception(msg2);
4810 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4811 self->getArray()->multiplyEqual(aaa);
4812 Py_XINCREF(trueSelf);
4816 { throw INTERP_KERNEL::Exception(msg); }
4820 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4822 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.";
4823 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4826 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4828 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4832 Py_XINCREF(trueSelf);
4836 throw INTERP_KERNEL::Exception(msg);
4841 DataArrayDoubleTuple *aa;
4842 std::vector<double> bb;
4844 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4850 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4851 if(!self->getArray())
4852 throw INTERP_KERNEL::Exception(msg2);
4853 self->getArray()->applyLin(1./val,0);
4854 Py_XINCREF(trueSelf);
4859 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4862 Py_XINCREF(trueSelf);
4867 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4868 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4869 ret2->setArray(aaa);
4871 Py_XINCREF(trueSelf);
4876 if(!self->getArray())
4877 throw INTERP_KERNEL::Exception(msg2);
4878 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4879 self->getArray()->divideEqual(aaa);
4880 Py_XINCREF(trueSelf);
4884 { throw INTERP_KERNEL::Exception(msg); }
4888 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4890 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.";
4891 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4894 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4896 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4900 Py_XINCREF(trueSelf);
4904 throw INTERP_KERNEL::Exception(msg);
4909 DataArrayDoubleTuple *aa;
4910 std::vector<double> bb;
4912 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4917 if(!self->getArray())
4918 throw INTERP_KERNEL::Exception(msg2);
4919 self->getArray()->applyPow(val);
4920 Py_XINCREF(trueSelf);
4925 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4928 Py_XINCREF(trueSelf);
4933 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4934 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4935 ret2->setArray(aaa);
4937 Py_XINCREF(trueSelf);
4942 if(!self->getArray())
4943 throw INTERP_KERNEL::Exception(msg2);
4944 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4945 self->getArray()->powEqual(aaa);
4946 Py_XINCREF(trueSelf);
4950 { throw INTERP_KERNEL::Exception(msg); }
4954 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4956 std::vector<const MEDCouplingFieldDouble *> tmp;
4957 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4958 return MEDCouplingFieldDouble::MergeFields(tmp);
4961 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4963 std::vector<const MEDCouplingFieldDouble *> tmp;
4964 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4965 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4968 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4970 std::vector<double> a0;
4971 std::vector<int> a1;
4972 std::vector<std::string> a2;
4973 self->getTinySerializationDbleInformation(a0);
4974 self->getTinySerializationIntInformation(a1);
4975 self->getTinySerializationStrInformation(a2);
4977 PyObject *ret(PyTuple_New(3));
4978 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4979 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
4981 PyObject *ret2(PyList_New(sz));
4983 for(int i=0;i<sz;i++)
4984 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
4986 PyTuple_SetItem(ret,2,ret2);
4990 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
4992 DataArrayInt *ret0(0);
4993 std::vector<DataArrayDouble *> ret1;
4994 self->serialize(ret0,ret1);
4997 std::size_t sz(ret1.size());
4998 PyObject *ret(PyTuple_New(2));
4999 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
5000 PyObject *ret1Py(PyList_New(sz));
5001 for(std::size_t i=0;i<sz;i++)
5005 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5007 PyTuple_SetItem(ret,1,ret1Py);
5011 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
5013 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
5014 if(!PyTuple_Check(args))
5015 throw INTERP_KERNEL::Exception(MSG);
5016 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
5017 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
5018 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
5020 PyObject *tmp0(PyTuple_New(1));
5021 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
5022 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
5024 Py_DECREF(selfMeth);
5025 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
5026 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
5027 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
5029 PyObject *a(PyInt_FromLong(0));
5030 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
5033 throw INTERP_KERNEL::Exception(MSG);
5034 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
5035 throw INTERP_KERNEL::Exception(MSG);
5036 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
5039 Py_DECREF(initMeth);
5044 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
5045 {// put an empty dict in input to say to __new__ to call __init__...
5046 self->checkConsistencyLight();
5047 PyObject *ret(PyTuple_New(1));
5048 PyObject *ret0(PyDict_New());
5050 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
5051 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
5052 PyDict_SetItem(ret0,a,d);
5053 Py_DECREF(a); Py_DECREF(d);
5055 PyTuple_SetItem(ret,0,ret0);
5059 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5061 self->checkConsistencyLight();
5062 PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
5063 PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
5064 const MEDCouplingMesh *mesh(self->getMesh());
5067 PyObject *ret(PyTuple_New(3));
5068 PyTuple_SetItem(ret,0,ret0);
5069 PyTuple_SetItem(ret,1,ret1);
5070 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
5074 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5076 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
5077 if(!PyTuple_Check(inp))
5078 throw INTERP_KERNEL::Exception(MSG);
5079 int sz(PyTuple_Size(inp));
5081 throw INTERP_KERNEL::Exception(MSG);
5083 PyObject *elt2(PyTuple_GetItem(inp,2));
5085 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
5086 if(!SWIG_IsOK(status))
5087 throw INTERP_KERNEL::Exception(MSG);
5088 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
5090 PyObject *elt0(PyTuple_GetItem(inp,0));
5091 PyObject *elt1(PyTuple_GetItem(inp,1));
5092 std::vector<double> a0;
5093 std::vector<int> a1;
5094 std::vector<std::string> a2;
5095 DataArrayInt *b0(0);
5096 std::vector<DataArrayDouble *>b1;
5098 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5099 throw INTERP_KERNEL::Exception(MSG);
5100 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5102 fillArrayWithPyListDbl3(a0py,tmp,a0);
5103 convertPyToNewIntArr3(a1py,a1);
5104 fillStringVector(a2py,a2);
5107 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5108 throw INTERP_KERNEL::Exception(MSG);
5109 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5111 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5112 if(!SWIG_IsOK(status))
5113 throw INTERP_KERNEL::Exception(MSG);
5114 b0=reinterpret_cast<DataArrayInt *>(argp);
5115 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5117 self->checkForUnserialization(a1,b0,b1);
5118 // useless here to call resizeForUnserialization because arrays are well resized.
5119 self->finishUnserialization(a1,a0,a2);
5124 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5127 int getNumberOfFields() const;
5128 MEDCouplingMultiFields *deepCopy() const;
5129 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5130 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5131 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5132 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5133 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5136 std::string __str__() const throw(INTERP_KERNEL::Exception)
5138 return self->simpleRepr();
5140 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5142 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5143 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5145 std::vector<MEDCouplingFieldDouble *> fs(sz);
5146 for(int i=0;i<sz;i++)
5147 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5148 return MEDCouplingMultiFields::New(fs);
5150 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5152 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5153 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5155 std::vector<MEDCouplingFieldDouble *> fs(sz);
5156 for(int i=0;i<sz;i++)
5157 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5158 return MEDCouplingMultiFields::New(fs);
5160 PyObject *getFields() const
5162 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5163 int sz=fields.size();
5164 PyObject *res = PyList_New(sz);
5165 for(int i=0;i<sz;i++)
5169 fields[i]->incrRef();
5170 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5174 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5179 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5181 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5185 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5188 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5190 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5192 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5194 PyObject *res = PyList_New(sz);
5195 for(int i=0;i<sz;i++)
5200 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5204 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5209 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5211 std::vector<int> refs;
5212 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5214 PyObject *res = PyList_New(sz);
5215 for(int i=0;i<sz;i++)
5220 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5224 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5228 PyObject *ret=PyTuple_New(2);
5229 PyTuple_SetItem(ret,0,res);
5230 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5233 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5235 std::vector<DataArrayDouble *> ms=self->getArrays();
5237 PyObject *res = PyList_New(sz);
5238 for(int i=0;i<sz;i++)
5243 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5247 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5252 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5254 std::vector< std::vector<int> > refs;
5255 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5257 PyObject *res = PyList_New(sz);
5258 PyObject *res2 = PyList_New(sz);
5259 for(int i=0;i<sz;i++)
5264 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5268 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5270 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5273 PyObject *ret=PyTuple_New(2);
5274 PyTuple_SetItem(ret,0,res);
5275 PyTuple_SetItem(ret,1,res2);
5281 class MEDCouplingFieldInt : public MEDCouplingField
5284 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5285 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5286 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5287 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5288 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5289 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5290 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5291 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5292 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5293 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5294 MEDCouplingFieldInt *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
5296 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5298 return MEDCouplingFieldInt::New(type,td);
5301 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5303 return MEDCouplingFieldInt::New(ft,td);
5306 std::string __str__() const throw(INTERP_KERNEL::Exception)
5308 return self->simpleRepr();
5311 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5313 std::ostringstream oss;
5314 self->reprQuickOverview(oss);
5318 MEDCouplingFieldInt *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
5320 return fieldT_buildSubPart(self,li);
5323 MEDCouplingFieldInt *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
5325 return fieldT__getitem__(self,li);
5328 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5330 DataArrayInt *ret=self->getArray();
5336 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5339 double tmp0=self->getTime(tmp1,tmp2);
5340 PyObject *res = PyList_New(3);
5341 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5342 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5343 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5349 class MEDCouplingDefinitionTime
5352 MEDCouplingDefinitionTime();
5353 void assign(const MEDCouplingDefinitionTime& other);
5354 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5355 double getTimeResolution() const;
5356 std::vector<double> getHotSpotsTime() const;
5359 std::string __str__() const throw(INTERP_KERNEL::Exception)
5361 std::ostringstream oss;
5362 self->appendRepr(oss);
5366 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5368 int meshId,arrId,arrIdInField,fieldId;
5369 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5370 PyObject *res=PyList_New(4);
5371 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5372 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5373 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5374 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5378 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5380 int meshId,arrId,arrIdInField,fieldId;
5381 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5382 PyObject *res=PyList_New(4);
5383 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5384 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5385 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5386 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5392 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5395 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5396 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5400 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5402 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5403 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5405 std::vector<MEDCouplingFieldDouble *> fs(sz);
5406 for(int i=0;i<sz;i++)
5407 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5408 return MEDCouplingFieldOverTime::New(fs);
5410 std::string __str__() const throw(INTERP_KERNEL::Exception)
5412 return self->simpleRepr();
5414 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5416 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5417 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5419 std::vector<MEDCouplingFieldDouble *> fs(sz);
5420 for(int i=0;i<sz;i++)
5421 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5422 return MEDCouplingFieldOverTime::New(fs);
5427 class MEDCouplingCartesianAMRMesh;
5429 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5432 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5433 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5434 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5437 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5439 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5447 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5450 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5451 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5452 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5455 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5457 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5458 return convertFromVectorPairInt(ret);
5461 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5463 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5464 return convertFromVectorPairInt(ret);
5467 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5469 std::vector< std::pair<int,int> > inp;
5470 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5471 self->addPatch(inp,factors);
5474 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5476 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5478 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5479 if(patchId==mesh->getNumberOfPatches())
5481 std::ostringstream oss;
5482 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5483 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5486 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5492 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5494 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5496 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5497 mesh->removePatch(patchId);
5500 int __len__() const throw(INTERP_KERNEL::Exception)
5502 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5504 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5505 return mesh->getNumberOfPatches();
5510 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5514 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5517 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5518 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5519 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5520 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5521 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5522 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5523 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5524 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5525 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5526 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5527 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5528 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5529 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5531 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5532 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5533 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5534 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5535 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5536 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5537 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5538 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5539 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5540 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5541 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5542 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5543 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5544 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5545 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5546 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5547 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5548 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5549 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5550 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5553 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5555 std::vector< std::pair<int,int> > inp;
5556 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5557 self->addPatch(inp,factors);
5560 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5562 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5564 PyObject *ret = PyList_New(sz);
5565 for(int i=0;i<sz;i++)
5567 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5570 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5575 // agy : don't know why typemap fails here ??? let it in the extend section
5576 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5578 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5581 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5583 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5584 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5590 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5592 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5593 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5599 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5601 std::vector<int> out1;
5602 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5603 PyObject *ret(PyTuple_New(2));
5604 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5605 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5609 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5611 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5613 PyObject *ret = PyList_New(sz);
5614 for(int i=0;i<sz;i++)
5615 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5619 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5621 std::vector<const DataArrayDouble *> inp;
5622 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5623 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5626 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5628 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5634 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5636 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5642 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5644 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5650 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5652 const MEDCouplingIMesh *ret(self->getImageMesh());
5655 return const_cast<MEDCouplingIMesh *>(ret);
5658 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5660 if(patchId==self->getNumberOfPatches())
5662 std::ostringstream oss;
5663 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5664 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5667 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5673 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5675 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5676 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5677 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5680 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5682 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5683 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5684 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5687 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5689 self->removePatch(patchId);
5692 int __len__() const throw(INTERP_KERNEL::Exception)
5694 return self->getNumberOfPatches();
5699 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5703 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5706 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5709 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5711 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5712 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5713 const int *nodeStrctPtr(0);
5714 const double *originPtr(0),*dxyzPtr(0);
5716 std::vector<int> bb0;
5717 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5720 std::vector<double> bb,bb2;
5722 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5723 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5725 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5728 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5730 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5731 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5732 std::vector< std::vector<int> > inp2;
5733 convertPyToVectorOfVectorOfInt(factors,inp2);
5734 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5737 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5739 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5742 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5744 return MEDCouplingCartesianAMRMesh::New(mesh);
5749 class MEDCouplingDataForGodFather : public RefCountObject
5752 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5753 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5754 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5755 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5756 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5757 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5758 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5759 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5760 virtual void alloc() throw(INTERP_KERNEL::Exception);
5761 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5764 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5766 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5774 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5777 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5778 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5779 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5780 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5781 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5782 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5783 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5784 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5785 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5788 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5790 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5791 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5792 MEDCouplingAMRAttribute *ret(0);
5795 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5796 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5798 catch(INTERP_KERNEL::Exception&)
5800 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5801 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5806 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5808 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5811 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5813 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5814 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5820 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5822 std::vector< std::vector<std::string> > compNamesCpp;
5823 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5824 self->spillInfoOnComponents(compNamesCpp);
5827 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5829 std::vector<int> inp0;
5830 if(!fillIntVector(nfs,inp0))
5831 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5832 std::size_t sz(inp0.size());
5833 std::vector<NatureOfField> inp00(sz);
5834 for(std::size_t i=0;i<sz;i++)
5835 inp00[i]=(NatureOfField)inp0[i];
5836 self->spillNatures(inp00);
5839 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5841 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5842 int sz((int)ret.size());
5843 PyObject *retPy(PyList_New(sz));
5844 for(int i=0;i<sz;i++)
5845 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5851 class DenseMatrix : public RefCountObject, public TimeLabel
5854 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5855 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5856 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5857 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5859 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5860 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5861 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5862 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5863 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5864 void transpose() throw(INTERP_KERNEL::Exception);
5866 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5867 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5868 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5871 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5873 return DenseMatrix::New(nbRows,nbCols);
5876 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5878 return DenseMatrix::New(array,nbRows,nbCols);
5881 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5884 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5885 PyObject *ret=PyTuple_New(2);
5886 PyObject *ret0Py=ret0?Py_True:Py_False;
5888 PyTuple_SetItem(ret,0,ret0Py);
5889 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5893 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5895 DataArrayDouble *ret(self->getData());
5901 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5903 return MEDCoupling::DenseMatrix::Add(self,other);
5906 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5908 return MEDCoupling::DenseMatrix::Substract(self,other);
5911 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5913 return MEDCoupling::DenseMatrix::Multiply(self,other);
5916 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5918 return MEDCoupling::DenseMatrix::Multiply(self,other);
5921 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5923 self->addEqual(other);
5924 Py_XINCREF(trueSelf);
5928 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5930 self->substractEqual(other);
5931 Py_XINCREF(trueSelf);
5935 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5937 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5947 __filename=os.environ.get('PYTHONSTARTUP')
5948 if __filename and os.path.isfile(__filename):
5949 execfile(__filename)