1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #ifdef WITH_DOCSTRINGS
24 %include MEDCoupling_doc.i
31 #include "MEDCouplingMemArray.hxx"
32 #include "MEDCouplingUMesh.hxx"
33 #include "MEDCouplingMappedExtrudedMesh.hxx"
34 #include "MEDCouplingCMesh.hxx"
35 #include "MEDCouplingIMesh.hxx"
36 #include "MEDCouplingCurveLinearMesh.hxx"
37 #include "MEDCoupling1GTUMesh.hxx"
38 #include "MEDCouplingField.hxx"
39 #include "MEDCouplingFieldDouble.hxx"
40 #include "MEDCouplingFieldInt.hxx"
41 #include "MEDCouplingFieldTemplate.hxx"
42 #include "MEDCouplingGaussLocalization.hxx"
44 #include "MEDCouplingMultiFields.hxx"
45 #include "MEDCouplingFieldOverTime.hxx"
46 #include "MEDCouplingDefinitionTime.hxx"
47 #include "MEDCouplingFieldDiscretization.hxx"
48 #include "MEDCouplingCartesianAMRMesh.hxx"
49 #include "MEDCouplingAMRAttribute.hxx"
50 #include "MEDCouplingMatrix.hxx"
51 #include "MEDCouplingPartDefinition.hxx"
52 #include "MEDCouplingSkyLineArray.hxx"
53 #include "MEDCouplingTypemaps.i"
55 #include "InterpKernelAutoPtr.hxx"
56 #include "BoxSplittingOptions.hxx"
58 using namespace MEDCoupling;
59 using namespace INTERP_KERNEL;
63 %template(ivec) std::vector<int>;
64 %template(dvec) std::vector<double>;
65 %template(svec) std::vector<std::string>;
68 %typemap(out) MEDCoupling::MEDCouplingMesh*
70 $result=convertMesh($1,$owner);
73 %typemap(out) MEDCouplingMesh*
75 $result=convertMesh($1,$owner);
80 %typemap(out) MEDCoupling::MEDCouplingPointSet*
82 $result=convertMesh($1,$owner);
85 %typemap(out) MEDCouplingPointSet*
87 $result=convertMesh($1,$owner);
92 %typemap(out) MEDCouplingCartesianAMRPatchGen*
94 $result=convertCartesianAMRPatch($1,$owner);
99 %typemap(out) MEDCouplingCartesianAMRMeshGen*
101 $result=convertCartesianAMRMesh($1,$owner);
106 %typemap(out) MEDCouplingDataForGodFather*
108 $result=convertDataForGodFather($1,$owner);
113 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
115 $result=convertMesh($1,$owner);
118 %typemap(out) MEDCoupling1GTUMesh*
120 $result=convertMesh($1,$owner);
125 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
127 $result=convertMesh($1,$owner);
130 %typemap(out) MEDCouplingStructuredMesh*
132 $result=convertMesh($1,$owner);
137 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
139 $result=convertFieldDiscretization($1,$owner);
142 %typemap(out) MEDCouplingFieldDiscretization*
144 $result=convertFieldDiscretization($1,$owner);
149 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
151 $result=convertMultiFields($1,$owner);
154 %typemap(out) MEDCouplingMultiFields*
156 $result=convertMultiFields($1,$owner);
161 %typemap(out) MEDCoupling::PartDefinition*
163 $result=convertPartDefinition($1,$owner);
166 %typemap(out) PartDefinition*
168 $result=convertPartDefinition($1,$owner);
173 %init %{ import_array(); %}
176 %feature("autodoc", "1");
177 %feature("docstring");
179 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
180 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
181 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
182 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
183 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
184 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
185 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
186 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
187 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
188 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
189 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
190 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
191 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
192 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
193 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
194 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
195 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
196 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
197 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
198 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
199 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
200 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
201 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
202 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
203 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
204 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
205 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
206 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
207 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
208 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
209 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
210 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
211 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
212 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
213 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
214 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
215 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
216 %newobject MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear;
217 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
218 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
235 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
236 %newobject MEDCoupling::MEDCouplingFieldInt::New;
237 %newobject MEDCoupling::MEDCouplingFieldInt::convertToDblField;
238 %newobject MEDCoupling::MEDCouplingFieldInt::getArray;
239 %newobject MEDCoupling::MEDCouplingFieldInt::deepCopy;
240 %newobject MEDCoupling::MEDCouplingFieldInt::clone;
241 %newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh;
242 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
243 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
244 %newobject MEDCoupling::MEDCouplingMesh::clone;
245 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
246 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
247 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
248 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
249 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
250 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
251 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
252 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
253 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
254 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
255 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
256 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
257 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
258 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
259 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
260 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
261 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
262 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
263 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
264 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
265 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
266 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
267 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
268 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
269 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
270 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
271 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
272 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
273 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
274 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
275 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
276 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
277 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
278 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
279 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
280 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
281 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
282 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
283 %newobject MEDCoupling::MEDCouplingUMesh::New;
284 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
285 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
286 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
287 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
288 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
289 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
290 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
291 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
292 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
293 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
294 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
295 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
296 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
297 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
298 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
299 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
300 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
301 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
302 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
303 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
304 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
305 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
306 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
307 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
308 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
309 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
310 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
311 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
312 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
313 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
314 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
315 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
316 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
317 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
318 %newobject MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords;
319 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
320 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
321 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
322 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
323 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
324 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
325 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
326 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
327 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
328 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
329 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
330 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
331 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
332 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
333 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
334 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
335 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
336 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
337 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
338 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
339 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
340 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
341 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
342 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
343 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
344 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
345 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
346 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
347 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
348 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
349 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
350 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
351 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
352 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
353 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
354 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
355 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
356 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
357 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
358 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
359 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
360 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
361 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
362 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
363 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
364 %newobject MEDCoupling::MEDCouplingCMesh::New;
365 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
366 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
367 %newobject MEDCoupling::MEDCouplingIMesh::New;
368 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
369 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
370 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
371 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
372 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
373 %newobject MEDCoupling::MEDCouplingMultiFields::New;
374 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
375 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
376 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
377 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
378 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
379 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
380 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
381 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
382 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
383 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
384 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
385 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
386 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
387 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
388 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
389 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
390 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
391 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
392 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
393 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
394 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
395 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
396 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
397 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
398 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
399 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
400 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
401 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
402 %newobject MEDCoupling::DenseMatrix::New;
403 %newobject MEDCoupling::DenseMatrix::deepCopy;
404 %newobject MEDCoupling::DenseMatrix::shallowCpy;
405 %newobject MEDCoupling::DenseMatrix::getData;
406 %newobject MEDCoupling::DenseMatrix::matVecMult;
407 %newobject MEDCoupling::DenseMatrix::MatVecMult;
408 %newobject MEDCoupling::DenseMatrix::__add__;
409 %newobject MEDCoupling::DenseMatrix::__sub__;
410 %newobject MEDCoupling::DenseMatrix::__mul__;
411 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
412 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
414 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
415 %feature("unref") MEDCouplingMesh "$this->decrRef();"
416 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
417 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
418 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
419 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
420 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
421 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
422 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
423 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
424 %feature("unref") MEDCouplingField "$this->decrRef();"
425 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
426 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
427 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
428 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
429 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
430 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
431 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
432 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
433 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
434 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
435 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
436 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
437 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
438 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
439 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
440 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
441 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
442 %feature("unref") DenseMatrix "$this->decrRef();"
443 %feature("unref") MEDCouplingSkyLineArray "$this->decrRef();"
445 %rename(assign) *::operator=;
446 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
447 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
448 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
449 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
453 %rename (InterpKernelException) INTERP_KERNEL::Exception;
455 %include "MEDCouplingRefCountObject.i"
456 %include "MEDCouplingMemArray.i"
458 namespace INTERP_KERNEL
461 * \class BoxSplittingOptions
462 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
464 class BoxSplittingOptions
467 BoxSplittingOptions();
468 void init() throw(INTERP_KERNEL::Exception);
469 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
470 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
471 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
472 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
473 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
474 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
475 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
476 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
477 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
478 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
479 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
480 std::string printOptions() const throw(INTERP_KERNEL::Exception);
483 std::string __str__() const throw(INTERP_KERNEL::Exception)
485 return self->printOptions();
491 namespace MEDCoupling
507 CONST_ON_TIME_INTERVAL = 7
508 } TypeOfTimeDiscretization;
516 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
517 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
519 } MEDCouplingMeshType;
522 class DataArrayDouble;
523 class MEDCouplingUMesh;
524 class MEDCouplingCMesh;
525 class MEDCouplingFieldDouble;
527 %extend RefCountObject
529 std::string getHiddenCppPointer() const
531 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
536 %extend MEDCouplingGaussLocalization
538 std::string __str__() const throw(INTERP_KERNEL::Exception)
540 return self->getStringRepr();
543 std::string __repr__() const throw(INTERP_KERNEL::Exception)
545 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
546 oss << self->getStringRepr();
553 class MEDCouplingMesh : public RefCountObject, public TimeLabel
556 void setName(const std::string& name);
557 std::string getName() const;
558 void setDescription(const std::string& descr);
559 std::string getDescription() const;
560 void setTime(double val, int iteration, int order);
561 void setTimeUnit(const std::string& unit);
562 std::string getTimeUnit() const;
563 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
564 bool isStructured() const throw(INTERP_KERNEL::Exception);
565 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
566 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
567 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
568 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
569 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
570 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
571 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
572 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
573 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
574 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
575 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
576 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
577 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
578 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
579 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
580 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
581 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
582 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
583 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
584 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
585 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
586 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
587 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
588 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
589 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
590 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
591 virtual std::string getVTKFileExtension() const;
592 std::string getVTKFileNameOf(const std::string& fileName) const;
594 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
595 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
596 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
597 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
598 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
599 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
600 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
601 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
602 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
603 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
604 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);
605 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
606 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
607 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
608 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
609 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
610 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
611 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
614 std::string __str__() const throw(INTERP_KERNEL::Exception)
616 return self->simpleRepr();
619 PyObject *getTime() throw(INTERP_KERNEL::Exception)
622 double tmp0=self->getTime(tmp1,tmp2);
623 PyObject *res = PyList_New(3);
624 PyList_SetItem(res,0,SWIG_From_double(tmp0));
625 PyList_SetItem(res,1,SWIG_From_int(tmp1));
626 PyList_SetItem(res,2,SWIG_From_int(tmp2));
630 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
632 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
633 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
639 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
643 DataArrayDoubleTuple *aa;
644 std::vector<double> bb;
646 int spaceDim=self->getSpaceDimension();
647 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
648 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
649 return self->getCellContainingPoint(pos,eps);
652 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
656 DataArrayDoubleTuple *aa;
657 std::vector<double> bb;
659 int spaceDim=self->getSpaceDimension();
660 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
661 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
662 MCAuto<DataArrayInt> elts,eltsIndex;
663 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
664 PyObject *ret=PyTuple_New(2);
665 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
666 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
670 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
672 MCAuto<DataArrayInt> elts,eltsIndex;
673 int spaceDim=self->getSpaceDimension();
675 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
676 if (!SWIG_IsOK(res1))
679 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
680 int nbOfPoints=size/spaceDim;
683 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
685 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
689 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
691 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
692 da2->checkAllocated();
693 int size=da2->getNumberOfTuples();
694 int nbOfCompo=da2->getNumberOfComponents();
695 if(nbOfCompo!=spaceDim)
697 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
699 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
701 PyObject *ret=PyTuple_New(2);
702 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
703 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
707 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
711 DataArrayDoubleTuple *aa;
712 std::vector<double> bb;
714 int spaceDim=self->getSpaceDimension();
715 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
716 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
717 std::vector<int> elts;
718 self->getCellsContainingPoint(pos,eps,elts);
719 DataArrayInt *ret=DataArrayInt::New();
720 ret->alloc((int)elts.size(),1);
721 std::copy(elts.begin(),elts.end(),ret->getPointer());
722 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
725 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
727 MCAuto<DataArrayInt> d0=DataArrayInt::New();
728 MCAuto<DataArrayInt> d1=DataArrayInt::New();
729 self->getReverseNodalConnectivity(d0,d1);
730 PyObject *ret=PyTuple_New(2);
731 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
732 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
736 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
739 int v0; std::vector<int> v1;
740 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
741 self->renumberCells(ids,check);
744 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
746 DataArrayInt *cellCor, *nodeCor;
747 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
748 PyObject *res = PyList_New(2);
749 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
750 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
754 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
756 DataArrayInt *cellCor=0,*nodeCor=0;
757 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
758 PyObject *res = PyList_New(2);
759 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
760 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
764 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
766 DataArrayInt *cellCor=0;
767 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
771 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
774 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
775 if (!SWIG_IsOK(res1))
778 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
779 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
783 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
785 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
786 da2->checkAllocated();
787 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
790 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
792 std::vector<int> conn;
793 self->getNodeIdsOfCell(cellId,conn);
794 return convertIntArrToPyList2(conn);
797 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
799 std::vector<double> coo;
800 self->getCoordinatesOfNode(nodeId,coo);
801 return convertDblArrToPyList2(coo);
804 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
808 DataArrayDoubleTuple *aa;
809 std::vector<double> bb;
811 int spaceDim=self->getSpaceDimension();
812 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
813 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
814 self->scale(pointPtr,factor);
817 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
819 int spaceDim=self->getSpaceDimension();
820 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
821 self->getBoundingBox(tmp);
822 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
826 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
829 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
830 PyObject *ret=PyTuple_New(2);
831 PyObject *ret0Py=ret0?Py_True:Py_False;
833 PyTuple_SetItem(ret,0,ret0Py);
834 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
838 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
840 int szArr,sw,iTypppArr;
841 std::vector<int> stdvecTyyppArr;
842 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
843 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
844 if(sw==3)//DataArrayInt
846 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
847 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
848 std::string name=argpt->getName();
850 ret->setName(name.c_str());
852 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
855 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
857 int szArr,sw,iTypppArr;
858 std::vector<int> stdvecTyyppArr;
860 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
861 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
862 if(sw==3)//DataArrayInt
864 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
865 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
866 std::string name=argpt->getName();
868 ret->setName(name.c_str());
871 PyObject *res = PyList_New(2);
872 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
873 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
874 PyList_SetItem(res,0,obj0);
875 PyList_SetItem(res,1,obj1);
879 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
883 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
884 PyObject *res = PyTuple_New(2);
885 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
888 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
890 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
891 PyTuple_SetItem(res,0,obj0);
892 PyTuple_SetItem(res,1,obj1);
896 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
898 std::vector<int> vals=self->getDistributionOfTypes();
900 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
901 PyObject *ret=PyList_New((int)vals.size()/3);
902 for(int j=0;j<(int)vals.size()/3;j++)
904 PyObject *ret1=PyList_New(3);
905 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
906 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
907 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
908 PyList_SetItem(ret,j,ret1);
913 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
915 std::vector<int> code;
916 std::vector<const DataArrayInt *> idsPerType;
917 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
918 convertPyToNewIntArr4(li,1,3,code);
919 return self->checkTypeConsistencyAndContig(code,idsPerType);
922 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
924 std::vector<int> code;
925 std::vector<DataArrayInt *> idsInPflPerType;
926 std::vector<DataArrayInt *> idsPerType;
927 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
928 PyObject *ret=PyTuple_New(3);
931 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
932 PyObject *ret0=PyList_New((int)code.size()/3);
933 for(int j=0;j<(int)code.size()/3;j++)
935 PyObject *ret00=PyList_New(3);
936 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
937 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
938 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
939 PyList_SetItem(ret0,j,ret00);
941 PyTuple_SetItem(ret,0,ret0);
943 PyObject *ret1=PyList_New(idsInPflPerType.size());
944 for(std::size_t j=0;j<idsInPflPerType.size();j++)
945 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
946 PyTuple_SetItem(ret,1,ret1);
947 int n=idsPerType.size();
948 PyObject *ret2=PyList_New(n);
950 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
951 PyTuple_SetItem(ret,2,ret2);
955 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
959 DataArrayDoubleTuple *aa;
960 std::vector<double> bb;
962 int spaceDim=self->getSpaceDimension();
963 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
964 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
965 self->translate(vectorPtr);
968 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
970 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
973 DataArrayDoubleTuple *aa;
974 std::vector<double> bb;
976 int spaceDim=self->getSpaceDimension();
977 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
978 self->rotate(centerPtr,0,alpha);
981 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
983 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
985 DataArrayDouble *a,*a2;
986 DataArrayDoubleTuple *aa,*aa2;
987 std::vector<double> bb,bb2;
989 int spaceDim=self->getSpaceDimension();
990 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
991 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
992 self->rotate(centerPtr,vectorPtr,alpha);
995 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
997 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
998 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
999 PyObject *res=PyList_New(result.size());
1000 for(int i=0;iL!=result.end(); i++, iL++)
1001 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1005 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
1007 std::vector<double> a0;
1008 std::vector<int> a1;
1009 std::vector<std::string> a2;
1010 self->getTinySerializationInformation(a0,a1,a2);
1011 PyObject *ret(PyTuple_New(3));
1012 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1013 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1015 PyObject *ret2(PyList_New(sz));
1017 for(int i=0;i<sz;i++)
1018 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1020 PyTuple_SetItem(ret,2,ret2);
1024 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1026 DataArrayInt *a0Tmp(0);
1027 DataArrayDouble *a1Tmp(0);
1028 self->serialize(a0Tmp,a1Tmp);
1029 PyObject *ret(PyTuple_New(2));
1030 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1031 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1035 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1037 std::vector<std::string> littleStrings;
1038 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1041 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1042 {// put an empty dict in input to say to __new__ to call __init__...
1043 PyObject *ret(PyTuple_New(1));
1044 PyObject *ret0(PyDict_New());
1045 PyTuple_SetItem(ret,0,ret0);
1049 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1051 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1052 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1053 PyObject *ret(PyTuple_New(2));
1054 PyTuple_SetItem(ret,0,ret0);
1055 PyTuple_SetItem(ret,1,ret1);
1059 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1061 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1062 if(!PyTuple_Check(inp))
1063 throw INTERP_KERNEL::Exception(MSG);
1064 int sz(PyTuple_Size(inp));
1066 throw INTERP_KERNEL::Exception(MSG);
1067 PyObject *elt0(PyTuple_GetItem(inp,0));
1068 PyObject *elt1(PyTuple_GetItem(inp,1));
1069 std::vector<double> a0;
1070 std::vector<int> a1;
1071 std::vector<std::string> a2;
1072 DataArrayInt *b0(0);
1073 DataArrayDouble *b1(0);
1075 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1076 throw INTERP_KERNEL::Exception(MSG);
1077 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1079 fillArrayWithPyListDbl3(a0py,tmp,a0);
1080 convertPyToNewIntArr3(a1py,a1);
1081 fillStringVector(a2py,a2);
1084 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1085 throw INTERP_KERNEL::Exception(MSG);
1086 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1088 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1089 if(!SWIG_IsOK(status))
1090 throw INTERP_KERNEL::Exception(MSG);
1091 b0=reinterpret_cast<DataArrayInt *>(argp);
1092 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1093 if(!SWIG_IsOK(status))
1094 throw INTERP_KERNEL::Exception(MSG);
1095 b1=reinterpret_cast<DataArrayDouble *>(argp);
1097 // useless here to call resizeForUnserialization because arrays are well resized.
1098 self->unserialization(a0,a1,b0,b1,a2);
1101 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1103 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1104 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1105 return MEDCouplingMesh::MergeMeshes(tmp);
1111 //== MEDCouplingMesh End
1113 %include "NormalizedGeometricTypes"
1114 %include "MEDCouplingNatureOfFieldEnum"
1116 namespace MEDCoupling
1118 class MEDCouplingNatureOfField
1121 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1122 static std::string GetReprNoThrow(NatureOfField nat);
1123 static std::string GetAllPossibilitiesStr();
1127 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1128 // include "MEDCouplingTimeDiscretization.i"
1130 namespace MEDCoupling
1132 class MEDCouplingGaussLocalization
1135 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1136 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1137 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1138 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1139 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1140 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1141 int getDimension() const throw(INTERP_KERNEL::Exception);
1142 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1143 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1144 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1145 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1147 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1148 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1149 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1150 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1151 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1152 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1153 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1154 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1155 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1156 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1157 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1158 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1160 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1164 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const throw(INTERP_KERNEL::Exception)
1166 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1170 MEDCouplingUMesh *buildRefCell() const throw(INTERP_KERNEL::Exception)
1172 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1178 class MEDCouplingSkyLineArray
1181 void set( DataArrayInt* index, DataArrayInt* value );
1182 int getNumberOf() const;
1183 int getLength() const;
1184 DataArrayInt* getIndexArray() const;
1185 DataArrayInt* getValuesArray() const;
1188 MEDCouplingSkyLineArray() throw(INTERP_KERNEL::Exception)
1190 return MEDCouplingSkyLineArray::New();
1193 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value) throw(INTERP_KERNEL::Exception)
1195 return MEDCouplingSkyLineArray::New(index, value);
1198 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value ) throw(INTERP_KERNEL::Exception)
1200 return MEDCouplingSkyLineArray::New(index, value);
1203 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other ) throw(INTERP_KERNEL::Exception)
1205 return MEDCouplingSkyLineArray::New(other);
1208 std::string __str__() const throw(INTERP_KERNEL::Exception)
1210 return self->simpleRepr();
1217 %include "MEDCouplingFieldDiscretization.i"
1219 //== MEDCouplingPointSet
1221 namespace MEDCoupling
1223 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1226 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1227 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1228 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1229 void zipCoords() throw(INTERP_KERNEL::Exception);
1230 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1231 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1232 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1233 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1234 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1235 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1236 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1237 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1238 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1239 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1240 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1241 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1242 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1243 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1244 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1245 virtual DataArrayInt *findBoundaryNodes() const;
1246 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1247 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1248 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1249 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1250 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1251 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1252 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1253 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1254 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1257 std::string __str__() const throw(INTERP_KERNEL::Exception)
1259 return self->simpleRepr();
1262 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1265 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1266 PyObject *res = PyList_New(2);
1267 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1268 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1272 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1274 DataArrayInt *comm, *commIndex;
1275 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1276 PyObject *res = PyList_New(2);
1277 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1278 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1282 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1284 DataArrayDouble *ret1=self->getCoords();
1287 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1290 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1292 int szArr,sw,iTypppArr;
1293 std::vector<int> stdvecTyyppArr;
1294 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1295 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1296 if(sw==3)//DataArrayInt
1298 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1299 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1300 std::string name=argpt->getName();
1302 ret->setName(name.c_str());
1304 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1307 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1309 int szArr,sw,iTypppArr;
1310 std::vector<int> stdvecTyyppArr;
1311 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1312 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1313 if(sw==3)//DataArrayInt
1315 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1316 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1317 std::string name=argpt->getName();
1319 ret->setName(name.c_str());
1321 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1324 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1326 int szArr,sw,iTypppArr;
1327 std::vector<int> stdvecTyyppArr;
1328 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1329 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1330 if(sw==3)//DataArrayInt
1332 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1333 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1334 std::string name=argpt->getName();
1336 ret->setName(name.c_str());
1338 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1341 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1343 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1344 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1347 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1349 int szArr,sw,iTypppArr;
1350 std::vector<int> stdvecTyyppArr;
1351 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1352 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1353 if(sw==3)//DataArrayInt
1355 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1356 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1357 std::string name=argpt->getName();
1359 ret->setName(name.c_str());
1361 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1364 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1366 int szArr,sw,iTypppArr;
1367 std::vector<int> stdvecTyyppArr;
1368 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1369 self->renumberNodes(tmp,newNbOfNodes);
1372 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1374 int szArr,sw,iTypppArr;
1375 std::vector<int> stdvecTyyppArr;
1376 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1377 self->renumberNodesCenter(tmp,newNbOfNodes);
1380 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1382 int spaceDim=self->getSpaceDimension();
1384 DataArrayDouble *a,*a2;
1385 DataArrayDoubleTuple *aa,*aa2;
1386 std::vector<double> bb,bb2;
1388 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1389 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1390 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1391 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1392 std::vector<int> nodes;
1393 self->findNodesOnLine(p,v,eps,nodes);
1394 DataArrayInt *ret=DataArrayInt::New();
1395 ret->alloc((int)nodes.size(),1);
1396 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1397 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1399 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1401 int spaceDim=self->getSpaceDimension();
1403 DataArrayDouble *a,*a2;
1404 DataArrayDoubleTuple *aa,*aa2;
1405 std::vector<double> bb,bb2;
1407 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1408 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1409 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1410 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1411 std::vector<int> nodes;
1412 self->findNodesOnPlane(p,v,eps,nodes);
1413 DataArrayInt *ret=DataArrayInt::New();
1414 ret->alloc((int)nodes.size(),1);
1415 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1416 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1419 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1423 DataArrayDoubleTuple *aa;
1424 std::vector<double> bb;
1426 int spaceDim=self->getSpaceDimension();
1427 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1428 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1429 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1430 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1433 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1435 DataArrayInt *c=0,*cI=0;
1439 DataArrayDoubleTuple *aa;
1440 std::vector<double> bb;
1442 int spaceDim=self->getSpaceDimension();
1443 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1444 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1445 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1446 PyObject *ret=PyTuple_New(2);
1447 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1448 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1452 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1454 DataArrayInt *c=0,*cI=0;
1455 int spaceDim=self->getSpaceDimension();
1458 DataArrayDoubleTuple *aa;
1459 std::vector<double> bb;
1462 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1463 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1465 PyObject *ret=PyTuple_New(2);
1466 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1467 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1471 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1475 DataArrayDoubleTuple *aa;
1476 std::vector<double> bb;
1478 int spaceDim=self->getSpaceDimension();
1479 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1480 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1482 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1483 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1486 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1490 std::vector<int> multiVal;
1491 std::pair<int, std::pair<int,int> > slic;
1492 MEDCoupling::DataArrayInt *daIntTyypp=0;
1493 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1497 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1499 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1501 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1503 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1507 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1509 DataArrayInt *v0=0,*v1=0;
1510 self->findCommonCells(compType,startCellId,v0,v1);
1511 PyObject *res = PyList_New(2);
1512 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1513 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1518 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1521 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1522 if (!SWIG_IsOK(res1))
1525 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1526 self->renumberNodesInConn(tmp);
1530 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1532 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1533 da2->checkAllocated();
1534 self->renumberNodesInConn(da2->getConstPointer());
1538 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1541 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1542 PyObject *ret=PyTuple_New(2);
1543 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1544 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1548 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1550 DataArrayInt *ret=0;
1552 int szArr,sw,iTypppArr;
1553 std::vector<int> stdvecTyyppArr;
1554 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1555 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1559 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1563 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1564 PyObject *res = PyList_New(3);
1565 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1566 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1567 PyList_SetItem(res,2,SWIG_From_int(ret2));
1571 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1575 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1576 PyObject *res = PyList_New(3);
1577 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1578 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1579 PyList_SetItem(res,2,SWIG_From_int(ret2));
1583 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1586 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1587 if (!SWIG_IsOK(res1))
1590 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1591 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1595 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1597 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1598 da2->checkAllocated();
1599 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1603 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1607 std::vector<int> multiVal;
1608 std::pair<int, std::pair<int,int> > slic;
1609 MEDCoupling::DataArrayInt *daIntTyypp=0;
1610 int nbc=self->getNumberOfCells();
1611 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1618 std::ostringstream oss;
1619 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1620 throw INTERP_KERNEL::Exception(oss.str().c_str());
1623 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1628 int tmp=nbc+singleVal;
1629 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1633 std::ostringstream oss;
1634 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1635 throw INTERP_KERNEL::Exception(oss.str().c_str());
1641 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1645 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1650 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1651 daIntTyypp->checkAllocated();
1652 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1655 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1659 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1662 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1663 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1664 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1665 for(int i=0;i<sz;i++)
1666 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1669 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1672 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1674 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1675 std::vector<double> val3;
1676 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1677 "Rotate2DAlg",2,true,nbNodes);
1679 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1680 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1683 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1686 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1687 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1688 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1689 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1690 for(int i=0;i<sz;i++)
1691 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1694 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1697 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1699 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1700 std::vector<double> val3;
1701 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1702 "Rotate3DAlg",3,true,nbNodes);
1704 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1705 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1706 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1711 //== MEDCouplingPointSet End
1713 class MEDCouplingUMeshCell
1716 INTERP_KERNEL::NormalizedCellType getType() const;
1719 std::string __str__() const throw(INTERP_KERNEL::Exception)
1721 return self->repr();
1724 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1727 const int *r=self->getAllConn(ret2);
1728 PyObject *ret=PyTuple_New(ret2);
1729 for(int i=0;i<ret2;i++)
1730 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1736 class MEDCouplingUMeshCellIterator
1743 MEDCouplingUMeshCell *ret=self->nextt();
1745 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1748 PyErr_SetString(PyExc_StopIteration,"No more data.");
1755 class MEDCouplingUMeshCellByTypeIterator
1758 ~MEDCouplingUMeshCellByTypeIterator();
1763 MEDCouplingUMeshCellEntry *ret=self->nextt();
1765 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1768 PyErr_SetString(PyExc_StopIteration,"No more data.");
1775 class MEDCouplingUMeshCellByTypeEntry
1778 ~MEDCouplingUMeshCellByTypeEntry();
1781 MEDCouplingUMeshCellByTypeIterator *__iter__()
1783 return self->iterator();
1788 class MEDCouplingUMeshCellEntry
1791 INTERP_KERNEL::NormalizedCellType getType() const;
1792 int getNumberOfElems() const;
1795 MEDCouplingUMeshCellIterator *__iter__()
1797 return self->iterator();
1802 //== MEDCouplingUMesh
1804 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1807 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1808 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1809 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1810 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1811 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1812 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1813 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1814 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1815 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1816 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1817 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1818 void computeTypes() throw(INTERP_KERNEL::Exception);
1819 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1820 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1822 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1823 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1824 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1825 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1826 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1827 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1828 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1829 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1830 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1831 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1832 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1833 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1834 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1835 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1836 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1837 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1838 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1839 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1840 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1841 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1842 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1843 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1844 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1845 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1846 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1847 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1848 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1849 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1850 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1851 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1852 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1853 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1854 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1855 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1856 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1857 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1858 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1859 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1860 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1861 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1862 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1863 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1864 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1865 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1866 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1867 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);
1868 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1869 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1870 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1871 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1872 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1874 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1876 return MEDCouplingUMesh::New();
1879 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1881 return MEDCouplingUMesh::New(meshName,meshDim);
1885 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1887 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1890 std::string __str__() const throw(INTERP_KERNEL::Exception)
1892 return self->simpleRepr();
1895 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1897 std::ostringstream oss;
1898 self->reprQuickOverview(oss);
1902 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1904 return self->cellIterator();
1907 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
1909 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
1913 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1915 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1916 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1917 PyObject *res=PyList_New(result.size());
1918 for(int i=0;iL!=result.end(); i++, iL++)
1919 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1923 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1927 std::vector<int> multiVal;
1928 std::pair<int, std::pair<int,int> > slic;
1929 MEDCoupling::DataArrayInt *daIntTyypp=0;
1930 int nbc=self->getNumberOfCells();
1931 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1938 std::ostringstream oss;
1939 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1940 throw INTERP_KERNEL::Exception(oss.str().c_str());
1944 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1951 int tmp=nbc+singleVal;
1952 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1957 std::ostringstream oss;
1958 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1959 throw INTERP_KERNEL::Exception(oss.str().c_str());
1965 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1971 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1972 daIntTyypp->checkAllocated();
1973 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1977 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1981 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1985 std::vector<int> multiVal;
1986 std::pair<int, std::pair<int,int> > slic;
1987 MEDCoupling::DataArrayInt *daIntTyypp=0;
1988 int nbc=self->getNumberOfCells();
1989 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1996 std::ostringstream oss;
1997 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1998 throw INTERP_KERNEL::Exception(oss.str().c_str());
2002 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2009 int tmp=nbc+singleVal;
2010 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2015 std::ostringstream oss;
2016 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2017 throw INTERP_KERNEL::Exception(oss.str().c_str());
2023 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2028 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2034 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2035 daIntTyypp->checkAllocated();
2036 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2040 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2044 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2046 int szArr,sw,iTypppArr;
2047 std::vector<int> stdvecTyyppArr;
2048 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2051 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2052 throw INTERP_KERNEL::Exception(oss.str().c_str());
2054 self->insertNextCell(type,size,tmp);
2057 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2059 int szArr,sw,iTypppArr;
2060 std::vector<int> stdvecTyyppArr;
2061 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2062 self->insertNextCell(type,szArr,tmp);
2065 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2067 DataArrayInt *ret=self->getNodalConnectivity();
2072 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2074 DataArrayInt *ret=self->getNodalConnectivityIndex();
2080 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2082 int szArr,sw,iTypppArr;
2083 std::vector<int> stdvecTyyppArr;
2084 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2085 int nbOfDepthPeelingPerformed=0;
2086 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2087 PyObject *res=PyTuple_New(2);
2088 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2089 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2093 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2095 DataArrayInt *v0=0,*v1=0;
2096 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2097 PyObject *res = PyList_New(2);
2098 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2099 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2103 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2107 DataArrayDoubleTuple *aa;
2108 std::vector<double> bb;
2110 int nbOfCompo=self->getSpaceDimension();
2111 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2114 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2115 PyObject *ret=PyTuple_New(2);
2116 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2117 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2121 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2123 DataArrayInt *ret1=0;
2124 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2125 PyObject *ret=PyTuple_New(2);
2126 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2127 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2131 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2134 DataArrayInt *ret1(0);
2135 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2136 PyObject *ret=PyTuple_New(3);
2137 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2138 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2139 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2143 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2145 std::vector<int> cells;
2146 self->checkButterflyCells(cells,eps);
2147 DataArrayInt *ret=DataArrayInt::New();
2148 ret->alloc((int)cells.size(),1);
2149 std::copy(cells.begin(),cells.end(),ret->getPointer());
2150 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2153 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2155 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2157 PyObject *ret = PyList_New(sz);
2158 for(int i=0;i<sz;i++)
2159 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2163 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2165 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2166 int sz=retCpp.size();
2167 PyObject *ret=PyList_New(sz);
2168 for(int i=0;i<sz;i++)
2169 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2173 static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2175 std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2176 int sz=retCpp.size();
2177 PyObject *ret=PyList_New(sz);
2178 for(int i=0;i<sz;i++)
2179 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2183 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2186 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2187 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2188 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2191 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2194 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2195 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2199 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2202 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2203 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2207 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2209 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2210 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2211 PyObject *ret=PyTuple_New(3);
2212 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2213 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2214 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2218 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2220 DataArrayInt *tmp0=0,*tmp1=0;
2221 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2222 PyObject *ret=PyTuple_New(2);
2223 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2224 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2228 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2232 std::vector<int> multiVal;
2233 std::pair<int, std::pair<int,int> > slic;
2234 MEDCoupling::DataArrayInt *daIntTyypp=0;
2235 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2239 return self->duplicateNodes(&singleVal,&singleVal+1);
2241 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2243 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2245 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2249 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2253 std::vector<int> multiVal;
2254 std::pair<int, std::pair<int,int> > slic;
2255 MEDCoupling::DataArrayInt *daIntTyypp=0;
2256 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2260 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2262 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2264 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2266 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2270 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2273 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2274 DataArrayInt *tmp0,*tmp1=0;
2275 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2276 PyObject *ret=PyTuple_New(2);
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 ));
2282 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2284 DataArrayInt *ret0=0,*ret1=0;
2285 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2286 PyObject *ret=PyTuple_New(2);
2287 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2288 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2292 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2294 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2295 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2296 DataArrayInt *ret1=0,*ret2=0;
2297 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2298 PyObject *ret=PyTuple_New(3);
2299 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2300 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2301 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2305 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2307 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2308 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2309 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2310 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2313 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2316 std::vector<const MEDCouplingUMesh *> meshes;
2317 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2318 std::vector<DataArrayInt *> corr;
2319 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2321 PyObject *ret1=PyList_New(sz);
2322 for(int i=0;i<sz;i++)
2323 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2324 PyObject *ret=PyList_New(2);
2325 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2326 PyList_SetItem(ret,1,ret1);
2330 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2332 std::vector<MEDCouplingUMesh *> meshes;
2333 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2334 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2337 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2339 std::vector<MEDCouplingUMesh *> meshes;
2340 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2341 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2344 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2348 std::vector<int> multiVal;
2349 std::pair<int, std::pair<int,int> > slic;
2350 MEDCoupling::DataArrayInt *daIntTyypp=0;
2352 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2353 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2357 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2359 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2361 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2363 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2367 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2369 DataArrayInt *arrOut=0,*arrIndexOut=0;
2372 std::vector<int> multiVal;
2373 std::pair<int, std::pair<int,int> > slic;
2374 MEDCoupling::DataArrayInt *daIntTyypp=0;
2376 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2377 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2382 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2387 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2392 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2396 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2398 PyObject *ret=PyTuple_New(2);
2399 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2400 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2404 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2406 DataArrayInt *arrOut=0,*arrIndexOut=0;
2407 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2408 PyObject *ret=PyTuple_New(2);
2409 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2410 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2414 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2416 if(!PySlice_Check(slic))
2417 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2418 Py_ssize_t strt=2,stp=2,step=2;
2419 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2421 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2422 arrIndxIn->checkAllocated();
2423 if(arrIndxIn->getNumberOfComponents()!=1)
2424 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2425 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2426 DataArrayInt *arrOut=0,*arrIndexOut=0;
2427 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2428 PyObject *ret=PyTuple_New(2);
2429 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2430 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2434 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2435 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2436 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2438 DataArrayInt *arrOut=0,*arrIndexOut=0;
2441 std::vector<int> multiVal;
2442 std::pair<int, std::pair<int,int> > slic;
2443 MEDCoupling::DataArrayInt *daIntTyypp=0;
2445 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2446 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2451 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2456 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2461 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2465 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2467 PyObject *ret=PyTuple_New(2);
2468 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2469 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2473 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2474 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2478 std::vector<int> multiVal;
2479 std::pair<int, std::pair<int,int> > slic;
2480 MEDCoupling::DataArrayInt *daIntTyypp=0;
2482 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2483 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2488 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2493 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2498 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2502 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2506 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2510 DataArrayDoubleTuple *aa;
2511 std::vector<double> bb;
2513 int spaceDim=self->getSpaceDimension();
2514 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2515 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2517 std::vector<int> cells;
2518 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2519 DataArrayInt *ret=DataArrayInt::New();
2520 ret->alloc((int)cells.size(),1);
2521 std::copy(cells.begin(),cells.end(),ret->getPointer());
2522 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2525 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2529 DataArrayDoubleTuple *aa;
2530 std::vector<double> bb;
2532 int spaceDim=self->getSpaceDimension();
2533 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2534 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2535 self->orientCorrectly2DCells(v,polyOnly);
2538 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2540 std::vector<int> cells;
2541 self->arePolyhedronsNotCorrectlyOriented(cells);
2542 DataArrayInt *ret=DataArrayInt::New();
2543 ret->alloc((int)cells.size(),1);
2544 std::copy(cells.begin(),cells.end(),ret->getPointer());
2545 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2548 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2552 self->getFastAveragePlaneOfThis(vec,pos);
2554 std::copy(vec,vec+3,vals);
2555 std::copy(pos,pos+3,vals+3);
2556 return convertDblArrToPyListOfTuple(vals,3,2);
2559 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2561 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2562 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2563 return MEDCouplingUMesh::MergeUMeshes(tmp);
2566 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2569 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2570 PyObject *ret=PyTuple_New(2);
2571 PyObject *ret0Py=ret0?Py_True:Py_False;
2573 PyTuple_SetItem(ret,0,ret0Py);
2574 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2578 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2581 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2582 PyObject *ret=PyTuple_New(2);
2583 PyObject *ret0Py=ret0?Py_True:Py_False;
2585 PyTuple_SetItem(ret,0,ret0Py);
2586 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2590 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2592 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2593 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2594 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2595 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2596 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2597 PyObject *ret=PyTuple_New(5);
2598 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2599 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2600 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2601 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2602 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2606 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2608 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2609 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2610 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2611 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2612 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2613 PyObject *ret=PyTuple_New(5);
2614 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2615 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2616 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2617 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2618 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2622 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2624 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2625 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2626 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2627 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2628 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2629 PyObject *ret=PyTuple_New(5);
2630 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2631 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2632 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2633 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2634 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2638 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2640 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2641 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2642 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2643 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2644 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2645 PyObject *ret=PyTuple_New(5);
2646 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2647 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2648 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2649 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2650 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2654 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2656 DataArrayInt *neighbors=0,*neighborsIdx=0;
2657 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2658 PyObject *ret=PyTuple_New(2);
2659 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2660 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2664 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2666 DataArrayInt *neighbors=0,*neighborsIdx=0;
2667 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2668 PyObject *ret=PyTuple_New(2);
2669 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2670 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2674 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const throw(INTERP_KERNEL::Exception)
2676 MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
2677 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2678 PyObject *ret=PyTuple_New(2);
2679 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2680 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2684 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2686 DataArrayInt *neighbors=0,*neighborsIdx=0;
2687 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2688 PyObject *ret=PyTuple_New(2);
2689 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2690 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2694 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2696 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2697 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2698 DataArrayInt *d2,*d3,*d4,*dd5;
2699 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2700 PyObject *ret=PyTuple_New(7);
2701 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2702 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2703 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2704 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2705 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2706 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2707 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2711 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2714 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2715 da->checkAllocated();
2716 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2719 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2722 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2723 da->checkAllocated();
2724 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2727 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2730 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2731 da->checkAllocated();
2732 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2735 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2738 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2739 da->checkAllocated();
2740 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2741 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2742 PyObject *res = PyList_New(result.size());
2743 for (int i=0;iL!=result.end(); i++, iL++)
2744 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2748 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2751 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2752 da->checkAllocated();
2753 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2754 ret->setName(da->getName().c_str());
2758 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2760 DataArrayInt *cellNb1=0,*cellNb2=0;
2761 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2762 PyObject *ret=PyTuple_New(3);
2763 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2764 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2765 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2769 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2771 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2772 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2773 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2774 PyObject *ret(PyTuple_New(4));
2775 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2776 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2777 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2778 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2782 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2784 int spaceDim=self->getSpaceDimension();
2786 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2788 DataArrayDouble *a,*a2;
2789 DataArrayDoubleTuple *aa,*aa2;
2790 std::vector<double> bb,bb2;
2792 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2793 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2794 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2795 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2797 DataArrayInt *cellIds=0;
2798 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2799 PyObject *ret=PyTuple_New(2);
2800 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2801 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2805 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2807 int spaceDim=self->getSpaceDimension();
2809 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2811 DataArrayDouble *a,*a2;
2812 DataArrayDoubleTuple *aa,*aa2;
2813 std::vector<double> bb,bb2;
2815 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2816 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2817 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2818 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2820 DataArrayInt *cellIds=0;
2821 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2822 PyObject *ret=PyTuple_New(2);
2823 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2824 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2828 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2831 DataArrayDouble *a,*a2;
2832 DataArrayDoubleTuple *aa,*aa2;
2833 std::vector<double> bb,bb2;
2835 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st paramater for origin.";
2836 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd paramater for vector.";
2837 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2838 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2839 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2843 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2845 int spaceDim=self->getSpaceDimension();
2847 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2849 DataArrayDouble *a,*a2;
2850 DataArrayDoubleTuple *aa,*aa2;
2851 std::vector<double> bb,bb2;
2853 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2854 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2855 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2856 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2857 return self->getCellIdsCrossingPlane(orig,vect,eps);
2860 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2864 std::vector<int> pos2;
2865 DataArrayInt *pos3=0;
2866 DataArrayIntTuple *pos4=0;
2867 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2872 self->convertToPolyTypes(&pos1,&pos1+1);
2879 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2884 self->convertToPolyTypes(pos3->begin(),pos3->end());
2888 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2892 void convertAllToPoly();
2893 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2894 bool unPolyze() throw(INTERP_KERNEL::Exception);
2895 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2896 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2897 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2900 //== MEDCouplingUMesh End
2902 //== MEDCouplingMappedExtrudedMesh
2904 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
2907 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2908 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
2909 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2910 int get2DCellIdForExtrusion() const;
2912 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2914 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2917 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
2919 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
2922 MEDCouplingMappedExtrudedMesh()
2924 return MEDCouplingMappedExtrudedMesh::New();
2927 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2929 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
2932 std::string __str__() const throw(INTERP_KERNEL::Exception)
2934 return self->simpleRepr();
2937 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2939 std::ostringstream oss;
2940 self->reprQuickOverview(oss);
2944 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2946 MEDCouplingUMesh *ret=self->getMesh2D();
2949 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2951 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2953 MEDCouplingUMesh *ret=self->getMesh1D();
2956 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2958 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2960 DataArrayInt *ret=self->getMesh3DIds();
2963 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2968 //== MEDCouplingMappedExtrudedMesh End
2970 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
2973 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2974 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2975 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2976 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2977 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2978 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2981 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2983 int szArr,sw,iTypppArr;
2984 std::vector<int> stdvecTyyppArr;
2985 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2986 self->insertNextCell(tmp,tmp+szArr);
2989 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2991 DataArrayInt *ret=self->getNodalConnectivity();
2992 if(ret) ret->incrRef();
2996 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2998 std::vector< const MEDCoupling1GTUMesh *> parts;
2999 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3000 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3005 //== MEDCoupling1SGTUMesh
3007 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3010 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3011 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3012 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
3013 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
3014 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
3015 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3016 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
3017 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
3018 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
3021 MEDCoupling1SGTUMesh()
3023 return MEDCoupling1SGTUMesh::New();
3026 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3028 return MEDCoupling1SGTUMesh::New(name,type);
3031 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3033 return MEDCoupling1SGTUMesh::New(m);
3036 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3038 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
3041 std::string __str__() const throw(INTERP_KERNEL::Exception)
3043 return self->simpleRepr();
3046 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3048 std::ostringstream oss;
3049 self->reprQuickOverview(oss);
3053 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3055 DataArrayInt *cellPerm(0),*nodePerm(0);
3056 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3057 PyObject *ret(PyTuple_New(3));
3058 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3059 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3060 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3064 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3066 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3067 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3068 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3071 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3073 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3074 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3075 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3080 //== MEDCoupling1SGTUMesh End
3082 //== MEDCoupling1DGTUMesh
3084 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3087 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3088 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3089 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3090 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3091 bool isPacked() const throw(INTERP_KERNEL::Exception);
3094 MEDCoupling1DGTUMesh()
3096 return MEDCoupling1DGTUMesh::New();
3098 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3100 return MEDCoupling1DGTUMesh::New(name,type);
3103 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3105 return MEDCoupling1DGTUMesh::New(m);
3108 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3110 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3113 std::string __str__() const throw(INTERP_KERNEL::Exception)
3115 return self->simpleRepr();
3118 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3120 std::ostringstream oss;
3121 self->reprQuickOverview(oss);
3125 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3127 DataArrayInt *ret=self->getNodalConnectivityIndex();
3128 if(ret) ret->incrRef();
3132 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3134 DataArrayInt *ret1=0,*ret2=0;
3135 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3136 PyObject *ret0Py=ret0?Py_True:Py_False;
3138 PyObject *ret=PyTuple_New(3);
3139 PyTuple_SetItem(ret,0,ret0Py);
3140 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3141 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3145 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3148 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3149 PyObject *ret=PyTuple_New(2);
3150 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3151 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3152 PyTuple_SetItem(ret,1,ret1Py);
3156 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3158 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3159 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3160 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3163 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3165 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3166 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3167 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3170 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3172 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3173 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3174 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3179 //== MEDCoupling1DGTUMeshEnd
3181 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3184 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3185 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3186 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3187 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3188 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3189 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3190 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3191 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3192 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3193 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3194 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3195 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3196 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3197 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3198 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3201 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3203 int tmpp1=-1,tmpp2=-1;
3204 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3205 std::vector< std::pair<int,int> > inp;
3209 for(int i=0;i<tmpp1;i++)
3210 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3215 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3216 inp.resize(tmpp1/2);
3217 for(int i=0;i<tmpp1/2;i++)
3218 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3221 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3222 return self->buildStructuredSubPart(inp);
3225 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3227 std::vector< std::pair<int,int> > inp;
3228 convertPyToVectorPairInt(part,inp);
3230 int szArr,sw,iTypppArr;
3231 std::vector<int> stdvecTyyppArr;
3232 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3233 std::vector<int> tmp5(tmp4,tmp4+szArr);
3235 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3238 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3240 std::vector< std::pair<int,int> > inp;
3241 convertPyToVectorPairInt(part,inp);
3242 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3245 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3247 std::vector< std::pair<int,int> > inp;
3248 convertPyToVectorPairInt(part,inp);
3249 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3252 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3254 std::vector< std::pair<int,int> > inp;
3255 convertPyToVectorPairInt(part,inp);
3256 std::vector<int> stWithGhost;
3257 std::vector< std::pair<int,int> > partWithGhost;
3258 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3259 PyObject *ret(PyTuple_New(2));
3260 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3261 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3265 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3267 std::vector< std::pair<int,int> > inp;
3268 convertPyToVectorPairInt(partCompactFormat,inp);
3269 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3272 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3274 std::vector< std::pair<int,int> > inp;
3275 convertPyToVectorPairInt(partCompactFormat,inp);
3276 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3279 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3281 std::vector< std::pair<int,int> > inp;
3282 convertPyToVectorPairInt(part,inp);
3283 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3286 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3288 int szArr,sw,iTypppArr;
3289 std::vector<int> stdvecTyyppArr;
3290 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3291 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3294 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3296 int szArr,sw,iTypppArr;
3297 std::vector<int> stdvecTyyppArr;
3298 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3299 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3302 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3304 std::vector< std::pair<int,int> > inp;
3305 convertPyToVectorPairInt(partCompactFormat,inp);
3306 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3309 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3311 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3312 PyObject *retPy=PyList_New(ret.size());
3313 for(std::size_t i=0;i<ret.size();i++)
3315 PyObject *tmp=PyTuple_New(2);
3316 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3317 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3318 PyList_SetItem(retPy,i,tmp);
3323 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3325 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3326 convertPyToVectorPairInt(r1,r1Cpp);
3327 convertPyToVectorPairInt(r2,r2Cpp);
3328 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3329 PyObject *retPy=PyList_New(ret.size());
3330 for(std::size_t i=0;i<ret.size();i++)
3332 PyObject *tmp=PyTuple_New(2);
3333 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3334 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3335 PyList_SetItem(retPy,i,tmp);
3340 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3342 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3343 convertPyToVectorPairInt(r1,r1Cpp);
3344 convertPyToVectorPairInt(r2,r2Cpp);
3345 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3348 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3350 int szArr,sw,iTypppArr;
3351 std::vector<int> stdvecTyyppArr;
3352 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3353 int szArr2,sw2,iTypppArr2;
3354 std::vector<int> stdvecTyyppArr2;
3355 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3356 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3357 std::vector< std::pair<int,int> > partCompactFormat;
3358 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3359 PyObject *ret=PyTuple_New(2);
3360 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3361 PyTuple_SetItem(ret,0,ret0Py);
3362 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3363 for(std::size_t i=0;i<partCompactFormat.size();i++)
3365 PyObject *tmp4=PyTuple_New(2);
3366 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3367 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3368 PyList_SetItem(ret1Py,i,tmp4);
3370 PyTuple_SetItem(ret,1,ret1Py);
3374 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3376 std::vector< std::pair<int,int> > param0,param1,ret;
3377 convertPyToVectorPairInt(bigInAbs,param0);
3378 convertPyToVectorPairInt(partOfBigInAbs,param1);
3379 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3380 PyObject *retPy(PyList_New(ret.size()));
3381 for(std::size_t i=0;i<ret.size();i++)
3383 PyObject *tmp(PyTuple_New(2));
3384 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3385 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3386 PyList_SetItem(retPy,i,tmp);
3391 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3393 std::vector< std::pair<int,int> > param0;
3394 convertPyToVectorPairInt(part,param0);
3395 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3396 PyObject *retPy(PyList_New(ret.size()));
3397 for(std::size_t i=0;i<ret.size();i++)
3399 PyObject *tmp(PyTuple_New(2));
3400 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3401 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3402 PyList_SetItem(retPy,i,tmp);
3407 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3409 std::vector< std::pair<int,int> > param0,param1;
3410 convertPyToVectorPairInt(startingFrom,param0);
3411 convertPyToVectorPairInt(goingTo,param1);
3412 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3415 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3417 std::vector< std::pair<int,int> > param0,param1,ret;
3418 convertPyToVectorPairInt(bigInAbs,param0);
3419 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3420 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3421 PyObject *retPy(PyList_New(ret.size()));
3422 for(std::size_t i=0;i<ret.size();i++)
3424 PyObject *tmp(PyTuple_New(2));
3425 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3426 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3427 PyList_SetItem(retPy,i,tmp);
3434 class MEDCouplingCurveLinearMesh;
3436 //== MEDCouplingCMesh
3438 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3441 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3442 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3443 void setCoords(const DataArrayDouble *coordsX,
3444 const DataArrayDouble *coordsY=0,
3445 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3446 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3447 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3449 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3451 return MEDCouplingCMesh::New();
3453 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3455 return MEDCouplingCMesh::New(meshName);
3458 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3460 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3462 std::string __str__() const throw(INTERP_KERNEL::Exception)
3464 return self->simpleRepr();
3466 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3468 std::ostringstream oss;
3469 self->reprQuickOverview(oss);
3472 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3474 DataArrayDouble *ret=self->getCoordsAt(i);
3482 //== MEDCouplingCMesh End
3484 //== MEDCouplingCurveLinearMesh
3486 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3489 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3490 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3491 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3493 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3495 return MEDCouplingCurveLinearMesh::New();
3497 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3499 return MEDCouplingCurveLinearMesh::New(meshName);
3501 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3503 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3505 std::string __str__() const throw(INTERP_KERNEL::Exception)
3507 return self->simpleRepr();
3509 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3511 std::ostringstream oss;
3512 self->reprQuickOverview(oss);
3515 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3517 DataArrayDouble *ret=self->getCoords();
3522 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3524 int szArr,sw,iTypppArr;
3525 std::vector<int> stdvecTyyppArr;
3526 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3527 self->setNodeGridStructure(tmp,tmp+szArr);
3532 //== MEDCouplingCurveLinearMesh End
3534 //== MEDCouplingIMesh
3536 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3539 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3541 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3542 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3543 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3544 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3545 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3546 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3547 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3548 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3549 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3550 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3551 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3556 return MEDCouplingIMesh::New();
3558 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3560 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3561 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3562 const int *nodeStrctPtr(0);
3563 const double *originPtr(0),*dxyzPtr(0);
3565 std::vector<int> bb0;
3566 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3569 std::vector<double> bb,bb2;
3571 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3572 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3574 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3577 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3579 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3582 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3584 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3587 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3590 std::vector<int> bb0;
3591 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3592 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3595 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3597 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3600 DataArrayDoubleTuple *aa;
3601 std::vector<double> bb;
3603 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3604 self->setOrigin(originPtr,originPtr+nbTuples);
3607 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3609 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3612 DataArrayDoubleTuple *aa;
3613 std::vector<double> bb;
3615 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3616 self->setDXYZ(originPtr,originPtr+nbTuples);
3619 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3621 std::vector< std::pair<int,int> > inp;
3622 convertPyToVectorPairInt(fineLocInCoarse,inp);
3623 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3626 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)
3628 std::vector< std::pair<int,int> > inp;
3629 convertPyToVectorPairInt(fineLocInCoarse,inp);
3630 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3633 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3635 std::vector< std::pair<int,int> > inp;
3636 convertPyToVectorPairInt(fineLocInCoarse,inp);
3637 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3640 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)
3642 std::vector< std::pair<int,int> > inp;
3643 convertPyToVectorPairInt(fineLocInCoarse,inp);
3644 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3647 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)
3649 std::vector< std::pair<int,int> > inp;
3650 convertPyToVectorPairInt(fineLocInCoarse,inp);
3651 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3654 std::string __str__() const throw(INTERP_KERNEL::Exception)
3656 return self->simpleRepr();
3658 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3660 std::ostringstream oss;
3661 self->reprQuickOverview(oss);
3667 //== MEDCouplingIMesh End
3671 namespace MEDCoupling
3673 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3676 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3677 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3678 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3679 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3680 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3681 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3682 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3683 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3684 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3685 std::string getName() const throw(INTERP_KERNEL::Exception);
3686 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3687 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3688 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3689 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3690 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3691 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3692 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3693 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3694 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3695 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3696 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3697 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3698 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3699 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3700 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3701 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3703 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3705 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3708 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3711 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3713 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3716 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3719 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3721 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3722 return convertIntArrToPyList3(ret);
3725 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3728 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3729 PyObject *ret=PyTuple_New(2);
3730 PyObject *ret0Py=ret0?Py_True:Py_False;
3732 PyTuple_SetItem(ret,0,ret0Py);
3733 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3737 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3739 DataArrayInt *ret1=0;
3740 MEDCouplingMesh *ret0=0;
3742 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3743 if (!SWIG_IsOK(res1))
3746 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3747 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3751 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3753 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3754 da2->checkAllocated();
3755 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3757 PyObject *res = PyList_New(2);
3758 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3759 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3763 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3765 DataArrayInt *ret1=0;
3767 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3768 PyObject *res=PyTuple_New(2);
3769 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3771 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3774 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3775 PyTuple_SetItem(res,1,res1);
3780 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3783 int v0; std::vector<int> v1;
3784 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3785 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3788 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3789 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3792 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3793 if (!SWIG_IsOK(res1))
3796 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3797 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3801 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3803 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3804 da2->checkAllocated();
3805 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3809 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3811 std::vector<int> tmp;
3812 self->getCellIdsHavingGaussLocalization(locId,tmp);
3813 DataArrayInt *ret=DataArrayInt::New();
3814 ret->alloc((int)tmp.size(),1);
3815 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3816 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3819 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3821 std::vector<int> inp0;
3822 convertPyToNewIntArr4(code,1,3,inp0);
3823 std::vector<const DataArrayInt *> inp1;
3824 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3825 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3830 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3833 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3834 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3835 static MEDCouplingFieldTemplate *New(TypeOfField type);
3836 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3837 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3840 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3842 return MEDCouplingFieldTemplate::New(f);
3845 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3847 return MEDCouplingFieldTemplate::New(f);
3850 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3852 return MEDCouplingFieldTemplate::New(type);
3855 std::string __str__() const throw(INTERP_KERNEL::Exception)
3857 return self->simpleRepr();
3860 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3862 std::ostringstream oss;
3863 self->reprQuickOverview(oss);
3869 class MEDCouplingFieldInt;
3871 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3874 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3875 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3876 void setTimeUnit(const std::string& unit);
3877 std::string getTimeUnit() const;
3878 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3879 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3880 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3881 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3882 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3883 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3884 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
3885 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3886 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3887 MEDCouplingFieldDouble *deepCopy() const;
3888 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
3889 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3890 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3891 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3892 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3893 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3894 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3895 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3896 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3897 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3898 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3899 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3900 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3901 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3902 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3903 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3904 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3905 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3906 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3907 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3908 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3909 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3910 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3911 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3912 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3913 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3914 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3915 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3916 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3917 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3918 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3919 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3920 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3921 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3922 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3923 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3924 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3925 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3926 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3927 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3928 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3929 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3930 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3931 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3932 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3933 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3934 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3935 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3936 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3937 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3938 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3939 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3940 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3941 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3942 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3943 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3944 double getMinValue() const throw(INTERP_KERNEL::Exception);
3945 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3946 double norm2() const throw(INTERP_KERNEL::Exception);
3947 double normMax() const throw(INTERP_KERNEL::Exception);
3948 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3949 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3950 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3951 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3952 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3953 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3954 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3955 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3956 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3957 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3958 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3959 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3960 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3961 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3962 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3963 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3964 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3965 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3966 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3967 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3968 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3969 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3971 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3973 return MEDCouplingFieldDouble::New(type,td);
3976 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3978 return MEDCouplingFieldDouble::New(ft,td);
3981 std::string __str__() const throw(INTERP_KERNEL::Exception)
3983 return self->simpleRepr();
3986 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3988 std::ostringstream oss;
3989 self->reprQuickOverview(oss);
3993 MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
3995 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
3999 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
4001 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4005 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4007 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4009 DataArrayDouble *a,*a2;
4010 DataArrayDoubleTuple *aa,*aa2;
4011 std::vector<double> bb,bb2;
4013 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4014 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4015 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4018 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
4020 DataArrayDouble *ret=self->getArray();
4026 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4028 std::vector<DataArrayDouble *> arrs=self->getArrays();
4029 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4033 PyObject *ret=PyTuple_New(sz);
4034 for(int i=0;i<sz;i++)
4037 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4039 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4044 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4046 std::vector<const DataArrayDouble *> tmp;
4047 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4049 std::vector<DataArrayDouble *> arrs(sz);
4050 for(int i=0;i<sz;i++)
4051 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4052 self->setArrays(arrs);
4055 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4057 DataArrayDouble *ret=self->getEndArray();
4063 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4067 DataArrayDoubleTuple *aa;
4068 std::vector<double> bb;
4070 const MEDCouplingMesh *mesh=self->getMesh();
4072 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4073 int spaceDim=mesh->getSpaceDimension();
4074 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4075 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4077 int sz=self->getNumberOfComponents();
4078 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4079 self->getValueOn(spaceLoc,res);
4080 return convertDblArrToPyList(res,sz);
4083 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4085 int sz=self->getNumberOfComponents();
4086 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4087 self->getValueOnPos(i,j,k,res);
4088 return convertDblArrToPyList(res,sz);
4091 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4093 const MEDCouplingMesh *mesh(self->getMesh());
4095 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4098 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4099 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4100 mesh->getSpaceDimension(),true,nbPts);
4101 return self->getValueOnMulti(inp,nbPts);
4104 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4108 DataArrayDoubleTuple *aa;
4109 std::vector<double> bb;
4111 const MEDCouplingMesh *mesh=self->getMesh();
4113 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4114 int spaceDim=mesh->getSpaceDimension();
4115 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4116 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4119 int sz=self->getNumberOfComponents();
4120 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4121 self->getValueOn(spaceLoc,time,res);
4122 return convertDblArrToPyList(res,sz);
4125 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4127 if(self->getArray()!=0)
4128 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4131 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4132 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4133 self->setArray(arr);
4137 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4140 double tmp0=self->getTime(tmp1,tmp2);
4141 PyObject *res = PyList_New(3);
4142 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4143 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4144 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4148 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4151 double tmp0=self->getStartTime(tmp1,tmp2);
4152 PyObject *res = PyList_New(3);
4153 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4154 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4155 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4159 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4162 double tmp0=self->getEndTime(tmp1,tmp2);
4163 PyObject *res = PyList_New(3);
4164 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4165 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4166 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4169 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4171 int sz=self->getNumberOfComponents();
4172 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4173 self->accumulate(tmp);
4174 return convertDblArrToPyList(tmp,sz);
4176 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4178 int sz=self->getNumberOfComponents();
4179 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4180 self->integral(isWAbs,tmp);
4181 return convertDblArrToPyList(tmp,sz);
4183 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4185 int sz=self->getNumberOfComponents();
4186 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4187 self->getWeightedAverageValue(tmp,isWAbs);
4188 return convertDblArrToPyList(tmp,sz);
4190 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4192 int sz=self->getNumberOfComponents();
4193 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4195 return convertDblArrToPyList(tmp,sz);
4197 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4199 int sz=self->getNumberOfComponents();
4200 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4202 return convertDblArrToPyList(tmp,sz);
4204 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4206 int szArr,sw,iTypppArr;
4207 std::vector<int> stdvecTyyppArr;
4208 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4209 self->renumberCells(tmp,check);
4212 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4214 int szArr,sw,iTypppArr;
4215 std::vector<int> stdvecTyyppArr;
4216 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4217 self->renumberCellsWithoutMesh(tmp,check);
4220 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4222 int szArr,sw,iTypppArr;
4223 std::vector<int> stdvecTyyppArr;
4224 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4225 self->renumberNodes(tmp,eps);
4228 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4230 int szArr,sw,iTypppArr;
4231 std::vector<int> stdvecTyyppArr;
4232 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4233 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4236 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4240 std::vector<int> multiVal;
4241 std::pair<int, std::pair<int,int> > slic;
4242 MEDCoupling::DataArrayInt *daIntTyypp=0;
4243 const MEDCouplingMesh *mesh=self->getMesh();
4245 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4246 int nbc=mesh->getNumberOfCells();
4247 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4254 std::ostringstream oss;
4255 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4256 throw INTERP_KERNEL::Exception(oss.str().c_str());
4259 return self->buildSubPart(&singleVal,&singleVal+1);
4264 int tmp=nbc+singleVal;
4265 return self->buildSubPart(&tmp,&tmp+1);
4269 std::ostringstream oss;
4270 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4271 throw INTERP_KERNEL::Exception(oss.str().c_str());
4277 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4281 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4286 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4287 daIntTyypp->checkAllocated();
4288 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4291 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4295 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4297 const char msg[]="MEDCouplingFieldDouble::__getitem__ : invalid call Available API are : \n-myField[dataArrayInt]\n-myField[slice]\n-myField[pythonListOfCellIds]\n-myField[integer]\n-myField[dataArrayInt,1]\n-myField[slice,1]\n-myField[pythonListOfCellIds,1]\n-myField[integer,1]\n";
4298 if(PyTuple_Check(li))
4300 Py_ssize_t sz=PyTuple_Size(li);
4302 throw INTERP_KERNEL::Exception(msg);
4303 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4306 std::vector<int> multiVal;
4307 std::pair<int, std::pair<int,int> > slic;
4308 MEDCoupling::DataArrayInt *daIntTyypp=0;
4309 if(!self->getArray())
4310 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4312 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4313 catch(INTERP_KERNEL::Exception& e)
4314 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4315 MCAuto<MEDCouplingFieldDouble> ret0=MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4316 DataArrayDouble *ret0Arr=ret0->getArray();
4318 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4323 std::vector<int> v2(1,singleVal);
4324 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4325 ret0->setArray(aarr);
4330 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4331 ret0->setArray(aarr);
4336 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4337 std::vector<int> v2(nbOfComp);
4338 for(int i=0;i<nbOfComp;i++)
4339 v2[i]=slic.first+i*slic.second.second;
4340 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4341 ret0->setArray(aarr);
4345 throw INTERP_KERNEL::Exception(msg);
4350 return MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,li);
4353 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4356 double r1=self->getMaxValue2(tmp);
4357 PyObject *ret=PyTuple_New(2);
4358 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4359 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4363 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4366 double r1=self->getMinValue2(tmp);
4367 PyObject *ret=PyTuple_New(2);
4368 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4369 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4373 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4375 std::vector<int> tmp;
4376 convertPyToNewIntArr3(li,tmp);
4377 return self->keepSelectedComponents(tmp);
4380 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4382 std::vector<int> tmp;
4383 convertPyToNewIntArr3(li,tmp);
4384 self->setSelectedComponents(f,tmp);
4387 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4390 DataArrayDouble *a,*a2;
4391 DataArrayDoubleTuple *aa,*aa2;
4392 std::vector<double> bb,bb2;
4395 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4396 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4397 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4398 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4400 return self->extractSlice3D(orig,vect,eps);
4403 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4405 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4408 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4410 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4413 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4415 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.";
4416 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4419 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4421 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4423 return (*self)-(*other);
4425 throw INTERP_KERNEL::Exception(msg);
4430 DataArrayDoubleTuple *aa;
4431 std::vector<double> bb;
4433 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4438 if(!self->getArray())
4439 throw INTERP_KERNEL::Exception(msg2);
4440 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4441 ret->applyLin(1.,-val);
4442 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4443 ret2->setArray(ret);
4448 if(!self->getArray())
4449 throw INTERP_KERNEL::Exception(msg2);
4450 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4451 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4452 ret2->setArray(ret);
4457 if(!self->getArray())
4458 throw INTERP_KERNEL::Exception(msg2);
4459 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4460 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4461 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4462 ret2->setArray(ret);
4467 if(!self->getArray())
4468 throw INTERP_KERNEL::Exception(msg2);
4469 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4470 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4471 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4472 ret2->setArray(ret);
4476 { throw INTERP_KERNEL::Exception(msg); }
4480 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4482 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4485 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4487 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4490 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4492 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4495 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4497 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.";
4498 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4501 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4503 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4505 return (*self)/(*other);
4507 throw INTERP_KERNEL::Exception(msg);
4512 DataArrayDoubleTuple *aa;
4513 std::vector<double> bb;
4515 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4521 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4522 if(!self->getArray())
4523 throw INTERP_KERNEL::Exception(msg2);
4524 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4525 ret->applyLin(1./val,0);
4526 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4527 ret2->setArray(ret);
4532 if(!self->getArray())
4533 throw INTERP_KERNEL::Exception(msg2);
4534 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4535 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4536 ret2->setArray(ret);
4541 if(!self->getArray())
4542 throw INTERP_KERNEL::Exception(msg2);
4543 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4544 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4545 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4546 ret2->setArray(ret);
4551 if(!self->getArray())
4552 throw INTERP_KERNEL::Exception(msg2);
4553 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4554 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4555 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4556 ret2->setArray(ret);
4560 { throw INTERP_KERNEL::Exception(msg); }
4564 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4566 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4569 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4571 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.";
4572 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4575 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4577 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4579 return (*self)^(*other);
4581 throw INTERP_KERNEL::Exception(msg);
4586 DataArrayDoubleTuple *aa;
4587 std::vector<double> bb;
4589 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4594 if(!self->getArray())
4595 throw INTERP_KERNEL::Exception(msg2);
4596 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4598 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4599 ret2->setArray(ret);
4604 if(!self->getArray())
4605 throw INTERP_KERNEL::Exception(msg2);
4606 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4607 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4608 ret2->setArray(ret);
4613 if(!self->getArray())
4614 throw INTERP_KERNEL::Exception(msg2);
4615 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4616 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4617 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4618 ret2->setArray(ret);
4623 if(!self->getArray())
4624 throw INTERP_KERNEL::Exception(msg2);
4625 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4626 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4627 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4628 ret2->setArray(ret);
4632 { throw INTERP_KERNEL::Exception(msg); }
4636 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4638 return self->negate();
4641 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4643 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.";
4644 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4647 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4649 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4653 Py_XINCREF(trueSelf);
4657 throw INTERP_KERNEL::Exception(msg);
4662 DataArrayDoubleTuple *aa;
4663 std::vector<double> bb;
4665 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4670 if(!self->getArray())
4671 throw INTERP_KERNEL::Exception(msg2);
4672 self->getArray()->applyLin(1.,val);
4673 Py_XINCREF(trueSelf);
4678 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4681 Py_XINCREF(trueSelf);
4686 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4687 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4688 ret2->setArray(aaa);
4690 Py_XINCREF(trueSelf);
4695 if(!self->getArray())
4696 throw INTERP_KERNEL::Exception(msg2);
4697 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4698 self->getArray()->addEqual(aaa);
4699 Py_XINCREF(trueSelf);
4703 { throw INTERP_KERNEL::Exception(msg); }
4707 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4709 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.";
4710 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4713 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4715 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4719 Py_XINCREF(trueSelf);
4723 throw INTERP_KERNEL::Exception(msg);
4728 DataArrayDoubleTuple *aa;
4729 std::vector<double> bb;
4731 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4736 if(!self->getArray())
4737 throw INTERP_KERNEL::Exception(msg2);
4738 self->getArray()->applyLin(1.,-val);
4739 Py_XINCREF(trueSelf);
4744 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4747 Py_XINCREF(trueSelf);
4752 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4753 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4754 ret2->setArray(aaa);
4756 Py_XINCREF(trueSelf);
4761 if(!self->getArray())
4762 throw INTERP_KERNEL::Exception(msg2);
4763 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4764 self->getArray()->substractEqual(aaa);
4765 Py_XINCREF(trueSelf);
4769 { throw INTERP_KERNEL::Exception(msg); }
4773 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4775 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.";
4776 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4779 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4781 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4785 Py_XINCREF(trueSelf);
4789 throw INTERP_KERNEL::Exception(msg);
4794 DataArrayDoubleTuple *aa;
4795 std::vector<double> bb;
4797 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4802 if(!self->getArray())
4803 throw INTERP_KERNEL::Exception(msg2);
4804 self->getArray()->applyLin(val,0);
4805 Py_XINCREF(trueSelf);
4810 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4813 Py_XINCREF(trueSelf);
4818 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4819 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4820 ret2->setArray(aaa);
4822 Py_XINCREF(trueSelf);
4827 if(!self->getArray())
4828 throw INTERP_KERNEL::Exception(msg2);
4829 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4830 self->getArray()->multiplyEqual(aaa);
4831 Py_XINCREF(trueSelf);
4835 { throw INTERP_KERNEL::Exception(msg); }
4839 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4841 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.";
4842 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4845 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4847 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4851 Py_XINCREF(trueSelf);
4855 throw INTERP_KERNEL::Exception(msg);
4860 DataArrayDoubleTuple *aa;
4861 std::vector<double> bb;
4863 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4869 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4870 if(!self->getArray())
4871 throw INTERP_KERNEL::Exception(msg2);
4872 self->getArray()->applyLin(1./val,0);
4873 Py_XINCREF(trueSelf);
4878 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4881 Py_XINCREF(trueSelf);
4886 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4887 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4888 ret2->setArray(aaa);
4890 Py_XINCREF(trueSelf);
4895 if(!self->getArray())
4896 throw INTERP_KERNEL::Exception(msg2);
4897 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4898 self->getArray()->divideEqual(aaa);
4899 Py_XINCREF(trueSelf);
4903 { throw INTERP_KERNEL::Exception(msg); }
4907 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4909 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.";
4910 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4913 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4915 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4919 Py_XINCREF(trueSelf);
4923 throw INTERP_KERNEL::Exception(msg);
4928 DataArrayDoubleTuple *aa;
4929 std::vector<double> bb;
4931 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4936 if(!self->getArray())
4937 throw INTERP_KERNEL::Exception(msg2);
4938 self->getArray()->applyPow(val);
4939 Py_XINCREF(trueSelf);
4944 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4947 Py_XINCREF(trueSelf);
4952 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4953 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4954 ret2->setArray(aaa);
4956 Py_XINCREF(trueSelf);
4961 if(!self->getArray())
4962 throw INTERP_KERNEL::Exception(msg2);
4963 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4964 self->getArray()->powEqual(aaa);
4965 Py_XINCREF(trueSelf);
4969 { throw INTERP_KERNEL::Exception(msg); }
4973 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4975 std::vector<const MEDCouplingFieldDouble *> tmp;
4976 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4977 return MEDCouplingFieldDouble::MergeFields(tmp);
4980 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4982 std::vector<const MEDCouplingFieldDouble *> tmp;
4983 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4984 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4987 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4989 std::vector<double> a0;
4990 std::vector<int> a1;
4991 std::vector<std::string> a2;
4992 self->getTinySerializationDbleInformation(a0);
4993 self->getTinySerializationIntInformation(a1);
4994 self->getTinySerializationStrInformation(a2);
4996 PyObject *ret(PyTuple_New(3));
4997 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4998 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
5000 PyObject *ret2(PyList_New(sz));
5002 for(int i=0;i<sz;i++)
5003 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
5005 PyTuple_SetItem(ret,2,ret2);
5009 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5011 DataArrayInt *ret0(0);
5012 std::vector<DataArrayDouble *> ret1;
5013 self->serialize(ret0,ret1);
5016 std::size_t sz(ret1.size());
5017 PyObject *ret(PyTuple_New(2));
5018 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
5019 PyObject *ret1Py(PyList_New(sz));
5020 for(std::size_t i=0;i<sz;i++)
5024 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5026 PyTuple_SetItem(ret,1,ret1Py);
5030 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
5032 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
5033 if(!PyTuple_Check(args))
5034 throw INTERP_KERNEL::Exception(MSG);
5035 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
5036 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
5037 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
5039 PyObject *tmp0(PyTuple_New(1));
5040 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
5041 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
5043 Py_DECREF(selfMeth);
5044 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
5045 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
5046 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
5048 PyObject *a(PyInt_FromLong(0));
5049 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
5052 throw INTERP_KERNEL::Exception(MSG);
5053 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
5054 throw INTERP_KERNEL::Exception(MSG);
5055 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
5058 Py_DECREF(initMeth);
5063 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
5064 {// put an empty dict in input to say to __new__ to call __init__...
5065 self->checkConsistencyLight();
5066 PyObject *ret(PyTuple_New(1));
5067 PyObject *ret0(PyDict_New());
5069 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
5070 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
5071 PyDict_SetItem(ret0,a,d);
5072 Py_DECREF(a); Py_DECREF(d);
5074 PyTuple_SetItem(ret,0,ret0);
5078 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5080 self->checkConsistencyLight();
5081 PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
5082 PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
5083 const MEDCouplingMesh *mesh(self->getMesh());
5086 PyObject *ret(PyTuple_New(3));
5087 PyTuple_SetItem(ret,0,ret0);
5088 PyTuple_SetItem(ret,1,ret1);
5089 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
5093 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5095 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
5096 if(!PyTuple_Check(inp))
5097 throw INTERP_KERNEL::Exception(MSG);
5098 int sz(PyTuple_Size(inp));
5100 throw INTERP_KERNEL::Exception(MSG);
5102 PyObject *elt2(PyTuple_GetItem(inp,2));
5104 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
5105 if(!SWIG_IsOK(status))
5106 throw INTERP_KERNEL::Exception(MSG);
5107 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
5109 PyObject *elt0(PyTuple_GetItem(inp,0));
5110 PyObject *elt1(PyTuple_GetItem(inp,1));
5111 std::vector<double> a0;
5112 std::vector<int> a1;
5113 std::vector<std::string> a2;
5114 DataArrayInt *b0(0);
5115 std::vector<DataArrayDouble *>b1;
5117 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5118 throw INTERP_KERNEL::Exception(MSG);
5119 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5121 fillArrayWithPyListDbl3(a0py,tmp,a0);
5122 convertPyToNewIntArr3(a1py,a1);
5123 fillStringVector(a2py,a2);
5126 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5127 throw INTERP_KERNEL::Exception(MSG);
5128 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5130 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5131 if(!SWIG_IsOK(status))
5132 throw INTERP_KERNEL::Exception(MSG);
5133 b0=reinterpret_cast<DataArrayInt *>(argp);
5134 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5136 self->checkForUnserialization(a1,b0,b1);
5137 // useless here to call resizeForUnserialization because arrays are well resized.
5138 self->finishUnserialization(a1,a0,a2);
5143 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5146 int getNumberOfFields() const;
5147 MEDCouplingMultiFields *deepCopy() const;
5148 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5149 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5150 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5151 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5152 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5155 std::string __str__() const throw(INTERP_KERNEL::Exception)
5157 return self->simpleRepr();
5159 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5161 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5162 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5164 std::vector<MEDCouplingFieldDouble *> fs(sz);
5165 for(int i=0;i<sz;i++)
5166 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5167 return MEDCouplingMultiFields::New(fs);
5169 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5171 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5172 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5174 std::vector<MEDCouplingFieldDouble *> fs(sz);
5175 for(int i=0;i<sz;i++)
5176 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5177 return MEDCouplingMultiFields::New(fs);
5179 PyObject *getFields() const
5181 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5182 int sz=fields.size();
5183 PyObject *res = PyList_New(sz);
5184 for(int i=0;i<sz;i++)
5188 fields[i]->incrRef();
5189 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5193 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5198 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5200 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5204 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5207 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5209 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5211 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5213 PyObject *res = PyList_New(sz);
5214 for(int i=0;i<sz;i++)
5219 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5223 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5228 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5230 std::vector<int> refs;
5231 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5233 PyObject *res = PyList_New(sz);
5234 for(int i=0;i<sz;i++)
5239 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5243 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5247 PyObject *ret=PyTuple_New(2);
5248 PyTuple_SetItem(ret,0,res);
5249 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5252 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5254 std::vector<DataArrayDouble *> ms=self->getArrays();
5256 PyObject *res = PyList_New(sz);
5257 for(int i=0;i<sz;i++)
5262 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5266 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5271 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5273 std::vector< std::vector<int> > refs;
5274 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5276 PyObject *res = PyList_New(sz);
5277 PyObject *res2 = PyList_New(sz);
5278 for(int i=0;i<sz;i++)
5283 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5287 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5289 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5292 PyObject *ret=PyTuple_New(2);
5293 PyTuple_SetItem(ret,0,res);
5294 PyTuple_SetItem(ret,1,res2);
5300 class MEDCouplingFieldInt : public MEDCouplingField
5303 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5304 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5305 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5306 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5307 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5308 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5309 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5310 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5311 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5312 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5314 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5316 return MEDCouplingFieldInt::New(type,td);
5319 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5321 return MEDCouplingFieldInt::New(ft,td);
5324 std::string __str__() const throw(INTERP_KERNEL::Exception)
5326 return self->simpleRepr();
5329 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5331 std::ostringstream oss;
5332 self->reprQuickOverview(oss);
5336 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5338 DataArrayInt *ret=self->getArray();
5344 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5347 double tmp0=self->getTime(tmp1,tmp2);
5348 PyObject *res = PyList_New(3);
5349 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5350 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5351 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5357 class MEDCouplingDefinitionTime
5360 MEDCouplingDefinitionTime();
5361 void assign(const MEDCouplingDefinitionTime& other);
5362 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5363 double getTimeResolution() const;
5364 std::vector<double> getHotSpotsTime() const;
5367 std::string __str__() const throw(INTERP_KERNEL::Exception)
5369 std::ostringstream oss;
5370 self->appendRepr(oss);
5374 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5376 int meshId,arrId,arrIdInField,fieldId;
5377 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5378 PyObject *res=PyList_New(4);
5379 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5380 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5381 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5382 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5386 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5388 int meshId,arrId,arrIdInField,fieldId;
5389 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5390 PyObject *res=PyList_New(4);
5391 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5392 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5393 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5394 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5400 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5403 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5404 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5408 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5410 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5411 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5413 std::vector<MEDCouplingFieldDouble *> fs(sz);
5414 for(int i=0;i<sz;i++)
5415 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5416 return MEDCouplingFieldOverTime::New(fs);
5418 std::string __str__() const throw(INTERP_KERNEL::Exception)
5420 return self->simpleRepr();
5422 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5424 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5425 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5427 std::vector<MEDCouplingFieldDouble *> fs(sz);
5428 for(int i=0;i<sz;i++)
5429 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5430 return MEDCouplingFieldOverTime::New(fs);
5435 class MEDCouplingCartesianAMRMesh;
5437 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5440 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5441 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5442 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5445 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5447 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5455 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5458 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5459 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5460 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5463 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5465 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5466 return convertFromVectorPairInt(ret);
5469 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5471 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5472 return convertFromVectorPairInt(ret);
5475 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5477 std::vector< std::pair<int,int> > inp;
5478 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5479 self->addPatch(inp,factors);
5482 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5484 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5486 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5487 if(patchId==mesh->getNumberOfPatches())
5489 std::ostringstream oss;
5490 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5491 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5494 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5500 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5502 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5504 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5505 mesh->removePatch(patchId);
5508 int __len__() const throw(INTERP_KERNEL::Exception)
5510 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5512 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5513 return mesh->getNumberOfPatches();
5518 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5522 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5525 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5526 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5527 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5528 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5529 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5530 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5531 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5532 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5533 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5534 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5535 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5536 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5537 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5539 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5540 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5541 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5542 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5543 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5544 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5545 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5546 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5547 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5548 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5549 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5550 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5551 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5552 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5553 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5554 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5555 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5556 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5557 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5558 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5561 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5563 std::vector< std::pair<int,int> > inp;
5564 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5565 self->addPatch(inp,factors);
5568 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5570 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5572 PyObject *ret = PyList_New(sz);
5573 for(int i=0;i<sz;i++)
5575 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5578 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5583 // agy : don't know why typemap fails here ??? let it in the extend section
5584 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5586 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5589 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5591 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5592 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5598 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5600 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5601 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5607 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5609 std::vector<int> out1;
5610 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5611 PyObject *ret(PyTuple_New(2));
5612 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5613 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5617 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5619 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5621 PyObject *ret = PyList_New(sz);
5622 for(int i=0;i<sz;i++)
5623 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5627 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5629 std::vector<const DataArrayDouble *> inp;
5630 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5631 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5634 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5636 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5642 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5644 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5650 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5652 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5658 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5660 const MEDCouplingIMesh *ret(self->getImageMesh());
5663 return const_cast<MEDCouplingIMesh *>(ret);
5666 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5668 if(patchId==self->getNumberOfPatches())
5670 std::ostringstream oss;
5671 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5672 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5675 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5681 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5683 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5684 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5685 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5688 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5690 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5691 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5692 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5695 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5697 self->removePatch(patchId);
5700 int __len__() const throw(INTERP_KERNEL::Exception)
5702 return self->getNumberOfPatches();
5707 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5711 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5714 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5717 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5719 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5720 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5721 const int *nodeStrctPtr(0);
5722 const double *originPtr(0),*dxyzPtr(0);
5724 std::vector<int> bb0;
5725 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5728 std::vector<double> bb,bb2;
5730 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5731 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5733 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5736 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5738 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5739 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5740 std::vector< std::vector<int> > inp2;
5741 convertPyToVectorOfVectorOfInt(factors,inp2);
5742 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5745 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5747 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5750 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5752 return MEDCouplingCartesianAMRMesh::New(mesh);
5757 class MEDCouplingDataForGodFather : public RefCountObject
5760 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5761 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5762 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5763 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5764 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5765 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5766 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5767 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5768 virtual void alloc() throw(INTERP_KERNEL::Exception);
5769 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5772 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5774 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5782 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5785 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5786 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5787 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5788 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5789 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5790 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5791 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5792 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5793 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5796 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5798 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5799 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5800 MEDCouplingAMRAttribute *ret(0);
5803 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5804 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5806 catch(INTERP_KERNEL::Exception&)
5808 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5809 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5814 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5816 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5819 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5821 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5822 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5828 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5830 std::vector< std::vector<std::string> > compNamesCpp;
5831 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5832 self->spillInfoOnComponents(compNamesCpp);
5835 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5837 std::vector<int> inp0;
5838 if(!fillIntVector(nfs,inp0))
5839 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5840 std::size_t sz(inp0.size());
5841 std::vector<NatureOfField> inp00(sz);
5842 for(std::size_t i=0;i<sz;i++)
5843 inp00[i]=(NatureOfField)inp0[i];
5844 self->spillNatures(inp00);
5847 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5849 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5850 int sz((int)ret.size());
5851 PyObject *retPy(PyList_New(sz));
5852 for(int i=0;i<sz;i++)
5853 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5859 class DenseMatrix : public RefCountObject, public TimeLabel
5862 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5863 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5864 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5865 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5867 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5868 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5869 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5870 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5871 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5872 void transpose() throw(INTERP_KERNEL::Exception);
5874 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5875 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5876 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5879 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5881 return DenseMatrix::New(nbRows,nbCols);
5884 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5886 return DenseMatrix::New(array,nbRows,nbCols);
5889 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5892 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5893 PyObject *ret=PyTuple_New(2);
5894 PyObject *ret0Py=ret0?Py_True:Py_False;
5896 PyTuple_SetItem(ret,0,ret0Py);
5897 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5901 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5903 DataArrayDouble *ret(self->getData());
5909 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5911 return MEDCoupling::DenseMatrix::Add(self,other);
5914 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5916 return MEDCoupling::DenseMatrix::Substract(self,other);
5919 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5921 return MEDCoupling::DenseMatrix::Multiply(self,other);
5924 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5926 return MEDCoupling::DenseMatrix::Multiply(self,other);
5929 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5931 self->addEqual(other);
5932 Py_XINCREF(trueSelf);
5936 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5938 self->substractEqual(other);
5939 Py_XINCREF(trueSelf);
5943 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5945 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5955 __filename=os.environ.get('PYTHONSTARTUP')
5956 if __filename and os.path.isfile(__filename):
5957 execfile(__filename)